]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86: turn is_pv_{,32bit_}{domain,vcpu} into inline functions
authorWei Liu <wei.liu2@citrix.com>
Thu, 4 Oct 2018 15:43:22 +0000 (16:43 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 15 Oct 2018 14:23:36 +0000 (15:23 +0100)
And make them work with CONFIG_PV.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/include/asm-x86/domain.h
xen/include/xen/sched.h

index cb0721e9d5bc2ca31a7eb9592443d51284a3914c..e7b82279e7981303c9dc91b592403b0c94c0f1b2 100644 (file)
@@ -13,8 +13,6 @@
 #include <public/hvm/hvm_info_table.h>
 
 #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
-#define is_pv_32bit_domain(d)  ((d)->arch.is_32bit_pv)
-#define is_pv_32bit_vcpu(v)    (is_pv_32bit_domain((v)->domain))
 
 #define is_hvm_pv_evtchn_domain(d) (is_hvm_domain(d) && \
         (d)->arch.hvm.irq->callback_via_type == HVMIRQ_callback_vector)
index 0ddff03a3042fbb445bb9ba6e8d0845f039a8120..4b2380536749acd24459176a4a27a9d48e0f4a8a 100644 (file)
@@ -873,8 +873,27 @@ void watchdog_domain_destroy(struct domain *d);
 
 #define VM_ASSIST(d, t) (test_bit(VMASST_TYPE_ ## t, &(d)->vm_assist))
 
-#define is_pv_domain(d) ((d)->guest_type == guest_type_pv)
-#define is_pv_vcpu(v)   (is_pv_domain((v)->domain))
+static inline bool is_pv_domain(const struct domain *d)
+{
+    return IS_ENABLED(CONFIG_PV) ? d->guest_type == guest_type_pv : false;
+}
+
+static inline bool is_pv_vcpu(const struct vcpu *v)
+{
+    return is_pv_domain(v->domain);
+}
+
+#ifdef CONFIG_COMPAT
+static inline bool is_pv_32bit_domain(const struct domain *d)
+{
+    return is_pv_domain(d) && d->arch.is_32bit_pv;
+}
+
+static inline bool is_pv_32bit_vcpu(const struct vcpu *v)
+{
+    return is_pv_32bit_domain(v->domain);
+}
+#endif
 
 static inline bool is_hvm_domain(const struct domain *d)
 {