diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index 602e5396b620..e096559711a3 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -345,15 +345,13 @@ xen_hvm_init(enum xen_hvm_init_type init_type) return; /* - * If xen_domain_type is not set at this point + * If the Xen domain type is not set at this point * it means we are inside a (PV)HVM guest, because * for PVH the guest type is set much earlier * (see hammer_time_xen). */ - if (!xen_domain()) { - xen_domain_type = XEN_HVM_DOMAIN; + if (!xen_domain()) vm_guest = VM_GUEST_XEN; - } setup_xen_features(); #ifdef SMP diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index c9537d153820..9ea276caee81 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -165,7 +165,6 @@ hammer_time_xen(vm_paddr_t start_info_paddr) int rc; if (isxen()) { - xen_domain_type = XEN_HVM_DOMAIN; vm_guest = VM_GUEST_XEN; rc = xen_hvm_init_hypercall_stubs(XEN_HVM_INIT_EARLY); if (rc) { diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index 2cb45d5d438b..d009b1af11fa 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -79,30 +79,22 @@ extern shared_info_t *HYPERVISOR_shared_info; extern bool xen_suspend_cancelled; -enum xen_domain_type { - XEN_NATIVE, /* running on bare hardware */ - XEN_PV_DOMAIN, /* running in a PV domain */ - XEN_HVM_DOMAIN, /* running in a Xen hvm domain */ -}; - -extern enum xen_domain_type xen_domain_type; - -static inline int +static inline bool xen_domain(void) { - return (xen_domain_type != XEN_NATIVE); + return (vm_guest == VM_GUEST_XEN); } -static inline int +static inline bool xen_pv_domain(void) { - return (xen_domain_type == XEN_PV_DOMAIN); + return (false); } -static inline int +static inline bool xen_hvm_domain(void) { - return (xen_domain_type == XEN_HVM_DOMAIN); + return (vm_guest == VM_GUEST_XEN); } static inline bool diff --git a/sys/xen/xen_common.c b/sys/xen/xen_common.c index ae70a721477a..025f52cceee6 100644 --- a/sys/xen/xen_common.c +++ b/sys/xen/xen_common.c @@ -41,8 +41,6 @@ #include /*-------------------------------- Global Data -------------------------------*/ -enum xen_domain_type xen_domain_type = XEN_NATIVE; - /** * Start info flags. ATM this only used to store the initial domain flag for * PVHv2, and it's always empty for HVM guests.