* [PATCH] x86: fix !CONFIG_HVM build for clang 3.8
@ 2018-10-04 16:42 Wei Liu
2018-10-04 16:52 ` Razvan Cojocaru
2018-10-05 7:59 ` Jan Beulich
0 siblings, 2 replies; 3+ messages in thread
From: Wei Liu @ 2018-10-04 16:42 UTC (permalink / raw)
To: xen-devel
Cc: Andrew Cooper, Tamas K Lengyel, Wei Liu, Razvan Cojocaru, Jan Beulich
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@citrix.com>
---
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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: fix !CONFIG_HVM build for clang 3.8
2018-10-04 16:42 [PATCH] x86: fix !CONFIG_HVM build for clang 3.8 Wei Liu
@ 2018-10-04 16:52 ` Razvan Cojocaru
2018-10-05 7:59 ` Jan Beulich
1 sibling, 0 replies; 3+ messages in thread
From: Razvan Cojocaru @ 2018-10-04 16:52 UTC (permalink / raw)
To: Wei Liu, xen-devel; +Cc: Andrew Cooper, Tamas K Lengyel, Jan Beulich
On 10/4/18 7:42 PM, Wei Liu wrote:
> 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@citrix.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Thanks,
Razvan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: fix !CONFIG_HVM build for clang 3.8
2018-10-04 16:42 [PATCH] x86: fix !CONFIG_HVM build for clang 3.8 Wei Liu
2018-10-04 16:52 ` Razvan Cojocaru
@ 2018-10-05 7:59 ` Jan Beulich
1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2018-10-05 7:59 UTC (permalink / raw)
To: Wei Liu; +Cc: Andrew Cooper, Tamas K Lengyel, Razvan Cojocaru, xen-devel
>>> On 04.10.18 at 18:42, <wei.liu2@citrix.com> wrote:
> 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@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-05 7:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 16:42 [PATCH] x86: fix !CONFIG_HVM build for clang 3.8 Wei Liu
2018-10-04 16:52 ` Razvan Cojocaru
2018-10-05 7:59 ` Jan Beulich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.