]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen: is_hvm_{domain,vcpu} should evaluate to false when !CONFIG_HVM
authorWei Liu <wei.liu2@citrix.com>
Sun, 26 Aug 2018 12:19:35 +0000 (13:19 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 28 Aug 2018 13:47:06 +0000 (14:47 +0100)
Turn them into static inline functions which evaluate to false when
CONFIG_HVM is not set. ARM won't be broken because ARM guests are set
to PV type in the hypervisor.

But ARM has plan to switch to HVM guest type inside the hypervisor, so
preemptively introduce CONFIG_HVM for ARM here.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/Kconfig
xen/include/xen/sched.h

index 586bc62582470dbe8c3ccfd4692fe88a15772976..c0e969e45a167169c13d3397841fcc3299539a30 100644 (file)
@@ -52,6 +52,9 @@ config HAS_ITS
         prompt "GICv3 ITS MSI controller support" if EXPERT = "y"
         depends on GICV3 && !NEW_VGIC
 
+config HVM
+        def_bool y
+
 config NEW_VGIC
        bool
        prompt "Use new VGIC implementation"
index 2cffb2c91911dfa7d373dd492dd44f915cfa55b1..0ba80cb1a89e743d536a8991dcd043c1562ec339 100644 (file)
@@ -879,8 +879,17 @@ void watchdog_domain_destroy(struct domain *d);
 
 #define is_pv_domain(d) ((d)->guest_type == guest_type_pv)
 #define is_pv_vcpu(v)   (is_pv_domain((v)->domain))
-#define is_hvm_domain(d) ((d)->guest_type == guest_type_hvm)
-#define is_hvm_vcpu(v)   (is_hvm_domain(v->domain))
+
+static inline bool is_hvm_domain(const struct domain *d)
+{
+    return IS_ENABLED(CONFIG_HVM) ? d->guest_type == guest_type_hvm : false;
+}
+
+static inline bool is_hvm_vcpu(const struct vcpu *v)
+{
+    return is_hvm_domain(v->domain);
+}
+
 #define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
                            cpumask_weight((v)->cpu_hard_affinity) == 1)
 #ifdef CONFIG_HAS_PASSTHROUGH