Re: [Xen-devel] [PATCH 27/34] x86: make hvm_inject_* functions build when !CONFIG_HVM

2018-08-24 Thread Wei Liu
On Tue, Aug 21, 2018 at 10:37:24AM +0200, Roger Pau Monné wrote:
> On Fri, Aug 17, 2018 at 04:12:45PM +0100, Wei Liu wrote:
> > They reference hvm_inject_event which is HVM code (not compiled). They
> > aren't used by code outside HVM code anyway.
> 
> Can you put all the functions inside of an #ifdef CONFIG_HVM instead
> of making them no-ops?
> 
> Thanks, Roger.

This patch has been dropped in new version of the series.

Wei.

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

Re: [Xen-devel] [PATCH 27/34] x86: make hvm_inject_* functions build when !CONFIG_HVM

2018-08-21 Thread Jan Beulich
>>> On 17.08.18 at 17:12,  wrote:
> They reference hvm_inject_event which is HVM code (not compiled). They
> aren't used by code outside HVM code anyway.

Again looks to be a case of DCE doing its job (if arranged for properly)
instead of adding #ifdef-s to functions which ought to be entirely
unavailable when !HVM. So if anything, I could once again see the
functions as a whole disappear in that case, not just their bodies.

Jan



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

Re: [Xen-devel] [PATCH 27/34] x86: make hvm_inject_* functions build when !CONFIG_HVM

2018-08-21 Thread Roger Pau Monné
On Fri, Aug 17, 2018 at 04:12:45PM +0100, Wei Liu wrote:
> They reference hvm_inject_event which is HVM code (not compiled). They
> aren't used by code outside HVM code anyway.

Can you put all the functions inside of an #ifdef CONFIG_HVM instead
of making them no-ops?

Thanks, Roger.

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

[Xen-devel] [PATCH 27/34] x86: make hvm_inject_* functions build when !CONFIG_HVM

2018-08-17 Thread Wei Liu
They reference hvm_inject_event which is HVM code (not compiled). They
aren't used by code outside HVM code anyway.

Signed-off-by: Wei Liu 
---
 xen/include/asm-x86/hvm/hvm.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index b3bc8d2..0444f3b 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -422,6 +422,7 @@ static inline void hvm_inject_exception(
 unsigned int vector, unsigned int type,
 unsigned int insn_len, int error_code)
 {
+#if CONFIG_HVM
 struct x86_event event = {
 .vector = vector,
 .type = type,
@@ -430,10 +431,12 @@ static inline void hvm_inject_exception(
 };
 
 hvm_inject_event(&event);
+#endif
 }
 
 static inline void hvm_inject_hw_exception(unsigned int vector, int errcode)
 {
+#if CONFIG_HVM
 struct x86_event event = {
 .vector = vector,
 .type = X86_EVENTTYPE_HW_EXCEPTION,
@@ -441,10 +444,12 @@ static inline void hvm_inject_hw_exception(unsigned int 
vector, int errcode)
 };
 
 hvm_inject_event(&event);
+#endif
 }
 
 static inline void hvm_inject_page_fault(int errcode, unsigned long cr2)
 {
+#if CONFIG_HVM
 struct x86_event event = {
 .vector = TRAP_page_fault,
 .type = X86_EVENTTYPE_HW_EXCEPTION,
@@ -453,6 +458,7 @@ static inline void hvm_inject_page_fault(int errcode, 
unsigned long cr2)
 };
 
 hvm_inject_event(&event);
+#endif
 }
 
 static inline int hvm_event_pending(struct vcpu *v)
-- 
git-series 0.9.1

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