Start-of-day shared data structure

group start_of_day_shared_data_structure

Xen/kernel shared data pointer provided in start_info.

This structure is defined to be both smaller than a page, and the only data on the shared page, but may vary in actual size even within compatible Xen versions; guests should not rely on the size of this structure remaining constant.

A domain can create “event channels” on which it can send and receive asynchronous event notifications. There are three classes of event that are delivered by this mechanism:

  1. Bi-directional inter- and intra-domain connections. Domains must arrange out-of-band to set up a connection (usually by allocating an unbound ‘listener’ port and avertising that via a storage service such as xenstore).
  2. Physical interrupts. A domain with suitable hardware-access privileges can bind an event-channel port to a physical interrupt source.
  3. Virtual interrupts (‘events’). A domain can bind an event-channel port to a virtual interrupt source, such as the virtual-timer device or the emergency console.

Event channels are addressed by a “port index”. Each channel is associated with two bits of information:

  1. PENDING notifies the domain that there is a pending notification to be processed. This bit is cleared by the guest.
  2. MASK if this bit is clear then a 0->1 transition of PENDING will cause an asynchronous upcall to be scheduled. This bit is only updated by the guest. It is read-only within Xen. If a channel becomes pending while the channel is masked then the ‘edge’ is lost (i.e., when the channel is unmasked, the guest must manually handle pending notifications as no upcall will be scheduled by Xen).

To expedite scanning of pending notifications, any 0->1 pending transition on an unmasked channel causes a corresponding bit in a per-vcpu selector word to be set. Each bit in the selector covers a ‘C long’ in the PENDING bitfield array.

Wallclock time: updated by control software or RTC emulation. Guests should base their gettimeofday() syscall on this wallclock-base value.

The values of wc_sec and wc_nsec are offsets from the Unix epoch adjusted by the domain’s ‘time offset’ (in seconds) as set either by XEN_DOMCTL_settimeoffset, or adjusted via a guest write to the emulated RTC.

struct shared_info

Public Members

struct vcpu_info shared_info::vcpu_info[1]
xen_ulong_t shared_info::evtchn_pending[sizeof(xen_ulong_t) *8]
xen_ulong_t shared_info::evtchn_mask[sizeof(xen_ulong_t) *8]
uint32_t wc_version

Version counter: see vcpu_time_info_t.

uint32_t wc_sec
uint32_t wc_nsec
uint32_t wc_sec_hi
struct arch_shared_info arch