/* define frequency of the heartbeat and frequency how often it's checked */ #define XPC_HB_DEFAULT_INTERVAL 5/* incr HB every x secs */ #define XPC_HB_CHECK_DEFAULT_INTERVAL 20/* check HB every x secs */
/* define the process name of HB checker and the CPU it is pinned to */ #define XPC_HB_CHECK_THREAD_NAME "xpc_hb" #define XPC_HB_CHECK_CPU 0
/* define the process name of the discovery thread */ #define XPC_DISCOVERY_THREAD_NAME "xpc_discovery"
/* *thereservedpage * *SALreservesonepageofmemoryperpartitionforXPC.Thoughafullpage *inlength(16384bytes),itsstartingaddressisnotpagealigned,butit *iscachelinealigned.Thereservedpageconsistsofthefollowing: * *reservedpageheader * *Thefirsttwo64-bytecachelinesofthereservedpagecontainthe *header(structxpc_rsvd_page).BeforeSALinitializationhascompleted, *SALhassetupthefollowingfieldsofthereservedpageheader: *SAL_signature,SAL_version,SAL_partid,andSAL_nasids_size.The *otherfieldsaresetupbyXPC.(xpc_rsvd_pagepointstothelocal *partition'sreservedpage.) * *part_nasidsmask *mach_nasidsmask * *SALalsosetsuptwobitmaps(ormasks),onethatreflectstheactual *nasidsinthispartition(part_nasids),andtheotherthatreflects *theactualnasidsintheentiremachine(mach_nasids).We'reonly *interestedintheevennumberednasids(whichcontaintheprocessors *and/ormemory),soweonlyneedhalfasmanybitstorepresentthe *nasids.Whenmappingnasidtobitinamask(orbittonasid)besure *toeitherdivideormultiplyby2.Thepart_nasidsmaskislocated *startingatthefirstcachelinefollowingthereservedpageheader.The *mach_nasidsmaskfollowsrightafterthepart_nasidsmask.Thesizein *bytesofeachmaskisreflectedbythereservedpageheaderfield *'SAL_nasids_size'.(Localpartition'smaskpointersarexpc_part_nasids *andxpc_mach_nasids.) * *Immediatelyfollowingthemach_nasidsmaskaretheXPCvariables *requiredbyotherpartitions.Firstarethosethataregenerictoall *partitions(vars),followedonthenextavailablecachelinebythose *whicharepartitionspecific(varspart).ThesearesetupbyXPC. * *Note:Until'ts_jiffies'issetnon-zero,thepartitionXPCcodehasnotbeen *initialized.
*/ struct xpc_rsvd_page {
u64 SAL_signature; /* SAL: unique signature */
u64 SAL_version; /* SAL: version */ short SAL_partid; /* SAL: partition ID */ short max_npartitions; /* value of XPC_MAX_PARTITIONS */
u8 version;
u8 pad1[3]; /* align to next u64 in 1st 64-byte cacheline */ unsignedlong ts_jiffies; /* timestamp when rsvd pg was setup by XPC */ union { struct { unsignedlong heartbeat_gpa; /* phys addr */ unsignedlong activate_gru_mq_desc_gpa; /* phys addr */
} uv;
} sn;
u64 pad2[9]; /* align to last u64 in 2nd 64-byte cacheline */
u64 SAL_nasids_size; /* SAL: size of each nasid mask in bytes */
};
#define XPC_RP_VERSION _XPC_VERSION(3, 0) /* version 3.0 of the reserved page */
/* *Thefollowingstructuredescribesthepartition'sheartbeatinfowhich *willbeperiodicallyreadbyotherpartitionstodeterminewhetherthis *XPCisstill'alive'.
*/ struct xpc_heartbeat_uv { unsignedlong value; unsignedlong offline; /* if 0, heartbeat should be changing */
};
/* *InfopertinenttoaGRUmessagequeueusingawatchlistforirqgeneration.
*/ struct xpc_gru_mq_uv { void *address; /* address of GRU message queue */ unsignedint order; /* size of GRU message queue as a power of 2 */ int irq; /* irq raised when message is received in mq */ int mmr_blade; /* blade where watchlist was allocated from */ unsignedlong mmr_offset; /* offset of irq mmr located on mmr_blade */ unsignedlong mmr_value; /* value of irq mmr located on mmr_blade */ int watchlist_num; /* number of watchlist allocatd by BIOS */ void *gru_mq_desc; /* opaque structure used by the GRU driver */
};
/* *Theactivate_mqisusedtosend/receiveGRUmessagesthataffectXPC's *partitionactivestateandchannelstate.Thisisuvonly.
*/ struct xpc_activate_mq_msghdr_uv { unsignedint gru_msg_hdr; /* FOR GRU INTERNAL USE ONLY */ short partid; /* sender's partid */
u8 act_state; /* sender's act_state at time msg sent */
u8 type; /* message's type */ unsignedlong rp_ts_jiffies; /* timestamp of sender's rp setup by XPC */
};
/* activate_mq defined message types */ #define XPC_ACTIVATE_MQ_MSG_SYNC_ACT_STATE_UV 0
struct xpc_activate_mq_msg_chctl_closereply_uv { struct xpc_activate_mq_msghdr_uv hdr; short ch_number;
};
struct xpc_activate_mq_msg_chctl_openrequest_uv { struct xpc_activate_mq_msghdr_uv hdr; short ch_number; short entry_size; /* size of notify_mq's GRU messages */ short local_nentries; /* ??? Is this needed? What is? */
};
struct xpc_activate_mq_msg_chctl_openreply_uv { struct xpc_activate_mq_msghdr_uv hdr; short ch_number; short remote_nentries; /* ??? Is this needed? What is? */ short local_nentries; /* ??? Is this needed? What is? */ unsignedlong notify_gru_mq_desc_gpa;
};
struct xpc_activate_mq_msg_chctl_opencomplete_uv { struct xpc_activate_mq_msghdr_uv hdr; short ch_number;
};
struct xpc_notify_mq_msghdr_uv { union { unsignedint gru_msg_hdr; /* FOR GRU INTERNAL USE ONLY */ struct xpc_fifo_entry_uv next; /* FOR XPC INTERNAL USE ONLY */
} u; short partid; /* FOR XPC INTERNAL USE ONLY */
u8 ch_number; /* FOR XPC INTERNAL USE ONLY */
u8 size; /* FOR XPC INTERNAL USE ONLY */ unsignedint msg_slot_number; /* FOR XPC INTERNAL USE ONLY */
};
struct xpc_send_msg_slot_uv *send_msg_slots; void *recv_msg_slots; /* each slot will hold a xpc_notify_mq_msg_uv */ /* structure plus the user's payload */
struct xpc_channel { short partid; /* ID of remote partition connected */
spinlock_t lock; /* lock for updating this structure */ unsignedint flags; /* general flags */
enum xp_retval reason; /* reason why channel is disconnect'g */ int reason_line; /* line# disconnect initiated from */
u16 number; /* channel # */
u16 entry_size; /* sizeof each msg entry */
u16 local_nentries; /* #of msg entries in local msg queue */
u16 remote_nentries; /* #of msg entries in remote msg queue */
atomic_t references; /* #of external references to queues */
u8 remote_rp_version; /* version# of partition's rsvd pg */ unsignedlong remote_rp_ts_jiffies; /* timestamp when rsvd pg setup */ unsignedlong remote_rp_pa; /* phys addr of partition's rsvd pg */
u64 last_heartbeat; /* HB at last read */
u32 activate_IRQ_rcvd; /* IRQs since activation */
spinlock_t act_lock; /* protect updating of act_state */
u8 act_state; /* from XPC HB viewpoint */ enum xp_retval reason; /* reason partition is deactivating */ int reason_line; /* line# deactivation initiated from */
unsignedlong disengage_timeout; /* timeout in jiffies */ struct timer_list disengage_timer;
/* XPC infrastructure referencing and teardown control */
u8 setup_state; /* infrastructure setup state */
wait_queue_head_t teardown_wq; /* kthread waiting to teardown infra */
atomic_t references; /* #of references to infrastructure */
u8 nchannels; /* #of defined channels supported */
atomic_t nchannels_active; /* #of channels that are not DISCONNECTED */
atomic_t nchannels_engaged; /* #of channels engaged with remote part */ struct xpc_channel *channels; /* array of channel structures */
/* fields used for managing channel avialability and activity */
union xpc_channel_ctl_flags chctl; /* chctl flags yet to be processed */
spinlock_t chctl_lock; /* chctl flags lock */
void *remote_openclose_args_base; /* base address of kmalloc'd space */ struct xpc_openclose_args *remote_openclose_args; /* copy of remote's */ /* args */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.