Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/xen/hvm.c
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* If non-zero, the hypervisor has been configured to use a direct | * If non-zero, the hypervisor has been configured to use a direct | ||||
* IDT event callback for interrupt injection. | * IDT event callback for interrupt injection. | ||||
*/ | */ | ||||
int xen_vector_callback_enabled; | int xen_vector_callback_enabled; | ||||
/** | /** | ||||
* Start info flags. ATM this only used to store the initial domain flag for | |||||
* PVHv2, and it's always empty for HVM guests. | |||||
*/ | |||||
uint32_t hvm_start_flags; | |||||
/** | |||||
* Signal whether the vector injected for the event channel upcall requires to | * Signal whether the vector injected for the event channel upcall requires to | ||||
* be EOI'ed on the local APIC. | * be EOI'ed on the local APIC. | ||||
*/ | */ | ||||
bool xen_evtchn_needs_ack; | bool xen_evtchn_needs_ack; | ||||
/*------------------------------- Per-CPU Data -------------------------------*/ | /*------------------------------- Per-CPU Data -------------------------------*/ | ||||
DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); | DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); | ||||
DPCPU_DEFINE(struct vcpu_info *, vcpu_info); | DPCPU_DEFINE(struct vcpu_info *, vcpu_info); | ||||
▲ Show 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | xen_hvm_cpu_init(void) | ||||
rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); | rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); | ||||
if (rc != 0) | if (rc != 0) | ||||
DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); | DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); | ||||
else | else | ||||
DPCPU_SET(vcpu_info, vcpu_info); | DPCPU_SET(vcpu_info, vcpu_info); | ||||
} | } | ||||
SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); | SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); | ||||
/* HVM/PVH start_info accessors */ | |||||
static vm_paddr_t | |||||
hvm_get_xenstore_mfn(void) | |||||
{ | |||||
return (hvm_get_parameter(HVM_PARAM_STORE_PFN)); | |||||
} | |||||
static evtchn_port_t | |||||
hvm_get_xenstore_evtchn(void) | |||||
{ | |||||
return (hvm_get_parameter(HVM_PARAM_STORE_EVTCHN)); | |||||
} | |||||
static vm_paddr_t | |||||
hvm_get_console_mfn(void) | |||||
{ | |||||
return (hvm_get_parameter(HVM_PARAM_CONSOLE_PFN)); | |||||
} | |||||
static evtchn_port_t | |||||
hvm_get_console_evtchn(void) | |||||
{ | |||||
return (hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN)); | |||||
} | |||||
static uint32_t | |||||
hvm_get_start_flags(void) | |||||
{ | |||||
return (hvm_start_flags); | |||||
} | |||||
struct hypervisor_info hypervisor_info = { | |||||
.get_xenstore_mfn = hvm_get_xenstore_mfn, | |||||
.get_xenstore_evtchn = hvm_get_xenstore_evtchn, | |||||
.get_console_mfn = hvm_get_console_mfn, | |||||
.get_console_evtchn = hvm_get_console_evtchn, | |||||
.get_start_flags = hvm_get_start_flags, | |||||
}; |