[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86: fix !CONFIG_HVM build for clang 3.8



It is discovered that hvm_funcs made it into monitor.o even when HVM
is disabled. This version of clang doesn't seem to completely
eliminate the code after is_hvm_domain() in
arch_monitor_get_capabilities().

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/include/asm-x86/hvm/hvm.h | 10 ++++++++++
 xen/include/asm-x86/monitor.h |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 3959604287..e2cbcf53db 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -379,6 +379,11 @@ unsigned long hvm_cr4_guest_valid_bits(const struct domain 
*d, bool restore);
 
 #define hvm_long_mode_active(v) (!!((v)->arch.hvm.guest_efer & EFER_LMA))
 
+static inline bool hvm_has_set_descriptor_access_exiting(void)
+{
+    return hvm_funcs.set_descriptor_access_exiting;
+}
+
 static inline int
 hvm_guest_x86_mode(struct vcpu *v)
 {
@@ -757,6 +762,11 @@ static inline void hvm_inject_hw_exception(unsigned int 
vector, int errcode)
     ASSERT_UNREACHABLE();
 }
 
+static inline bool hvm_has_set_descriptor_access_exiting(void)
+{
+    return false;
+}
+
 #define is_viridian_domain(d) ((void)(d), false)
 #define has_viridian_time_ref_count(d) ((void)(d), false)
 #define hvm_long_mode_active(v) ((void)(v), false)
diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h
index e02484f56b..4afb0665e8 100644
--- a/xen/include/asm-x86/monitor.h
+++ b/xen/include/asm-x86/monitor.h
@@ -90,7 +90,7 @@ static inline uint32_t arch_monitor_get_capabilities(struct 
domain *d)
     if ( hvm_is_singlestep_supported() )
         capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP);
 
-    if ( hvm_funcs.set_descriptor_access_exiting )
+    if ( hvm_has_set_descriptor_access_exiting() )
         capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_DESC_ACCESS);
 
     return capabilities;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.