xen: remove xen_domain_type enum/variable

The vm_guest variable readily covers all uses of xen_domain_type, so
merge them together.  Since support for PV domains has been removed
hard-core xen_pv_domain() to return false.

Reviewed by: royger
This commit is contained in:
Elliott Mitchell 2022-08-06 09:02:03 -07:00 committed by Roger Pau Monné
parent d48760ffe9
commit c7368ccb68
4 changed files with 8 additions and 21 deletions

View file

@ -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

View file

@ -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) {

View file

@ -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

View file

@ -41,8 +41,6 @@
#include <contrib/xen/vcpu.h>
/*-------------------------------- 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.