x86: fix !CONFIG_HVM build for clang 3.8
PATCH 1/1 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().
--- xen/include/asm-x86/hvm/hvm.h | 10 ++++++++++ xen/include/asm-x86/monitor.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
xen/include/asm-x86/hvm/hvm.h +10 -0
@@ -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)
xen/include/asm-x86/monitor.h +1 -1
@@ -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;
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 6 lines · Wei Liu
It is discovered that
hvm_funcsmade it into monitor.o even when HVM is disabled. This version of clang doesn't seem to completely eliminate the code afteris_hvm_domain()inarch_monitor_get_capabilities().Signed-off-by Wei Liu <[email protected]>
Thanks,
Razvan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 04.10.18 at 18:42, <[email protected]> wrote:
It is discovered that
hvm_funcsmade it into monitor.o even when HVM is disabled. This version of clang doesn't seem to completely eliminate the code afteris_hvm_domain()inarch_monitor_get_capabilities().Signed-off-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel