kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Move definition of __ex to kvm_host.h
@ 2020-05-08  6:27 Uros Bizjak
  2020-05-08 17:57 ` Sean Christopherson
  0 siblings, 1 reply; 3+ messages in thread
From: Uros Bizjak @ 2020-05-08  6:27 UTC (permalink / raw)
  To: kvm; +Cc: Uros Bizjak, Paolo Bonzini

Move the definition of __ex to a common include to be
shared between VMX and SVM.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 arch/x86/include/asm/kvm_host.h | 2 ++
 arch/x86/kvm/svm/svm.c          | 2 --
 arch/x86/kvm/vmx/ops.h          | 2 --
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 35a915787559..4df0c07b0a62 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1620,6 +1620,8 @@ asmlinkage void kvm_spurious_fault(void);
 	"668: \n\t"							\
 	_ASM_EXTABLE(666b, 667b)
 
+#define __ex(x) __kvm_handle_fault_on_reboot(x)
+
 #define KVM_ARCH_WANT_MMU_NOTIFIER
 int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end);
 int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end);
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 57fdd752d2bb..9ea0a69d7fee 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -42,8 +42,6 @@
 
 #include "svm.h"
 
-#define __ex(x) __kvm_handle_fault_on_reboot(x)
-
 MODULE_AUTHOR("Qumranet");
 MODULE_LICENSE("GPL");
 
diff --git a/arch/x86/kvm/vmx/ops.h b/arch/x86/kvm/vmx/ops.h
index 5f1ac002b4b6..3cec799837e8 100644
--- a/arch/x86/kvm/vmx/ops.h
+++ b/arch/x86/kvm/vmx/ops.h
@@ -10,8 +10,6 @@
 #include "evmcs.h"
 #include "vmcs.h"
 
-#define __ex(x) __kvm_handle_fault_on_reboot(x)
-
 asmlinkage void vmread_error(unsigned long field, bool fault);
 __attribute__((regparm(0))) void vmread_error_trampoline(unsigned long field,
 							 bool fault);
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: x86: Move definition of __ex to kvm_host.h
  2020-05-08  6:27 [PATCH] KVM: x86: Move definition of __ex to kvm_host.h Uros Bizjak
@ 2020-05-08 17:57 ` Sean Christopherson
  2020-05-08 18:14   ` Uros Bizjak
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Christopherson @ 2020-05-08 17:57 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: kvm, Paolo Bonzini

On Fri, May 08, 2020 at 08:27:53AM +0200, Uros Bizjak wrote:
> Move the definition of __ex to a common include to be
> shared between VMX and SVM.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> ---
>  arch/x86/include/asm/kvm_host.h | 2 ++
>  arch/x86/kvm/svm/svm.c          | 2 --
>  arch/x86/kvm/vmx/ops.h          | 2 --
>  3 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 35a915787559..4df0c07b0a62 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -1620,6 +1620,8 @@ asmlinkage void kvm_spurious_fault(void);
>  	"668: \n\t"							\
>  	_ASM_EXTABLE(666b, 667b)
>  
> +#define __ex(x) __kvm_handle_fault_on_reboot(x)

Moving this to asm/kvm_host.h is a bit sketchy as __ex() isn't exactly the
most unique name.  arch/x86/kvm/x86.h would probably be a better
destination as it's "private".  __ex() is only used in vmx.c, nested.c and
svm.c, all of which already include x86.h.

> +
>  #define KVM_ARCH_WANT_MMU_NOTIFIER
>  int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end);
>  int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end);
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 57fdd752d2bb..9ea0a69d7fee 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -42,8 +42,6 @@
>  
>  #include "svm.h"
>  
> -#define __ex(x) __kvm_handle_fault_on_reboot(x)
> -
>  MODULE_AUTHOR("Qumranet");
>  MODULE_LICENSE("GPL");
>  
> diff --git a/arch/x86/kvm/vmx/ops.h b/arch/x86/kvm/vmx/ops.h
> index 5f1ac002b4b6..3cec799837e8 100644
> --- a/arch/x86/kvm/vmx/ops.h
> +++ b/arch/x86/kvm/vmx/ops.h
> @@ -10,8 +10,6 @@
>  #include "evmcs.h"
>  #include "vmcs.h"
>  
> -#define __ex(x) __kvm_handle_fault_on_reboot(x)
> -
>  asmlinkage void vmread_error(unsigned long field, bool fault);
>  __attribute__((regparm(0))) void vmread_error_trampoline(unsigned long field,
>  							 bool fault);
> -- 
> 2.25.4
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: x86: Move definition of __ex to kvm_host.h
  2020-05-08 17:57 ` Sean Christopherson
@ 2020-05-08 18:14   ` Uros Bizjak
  0 siblings, 0 replies; 3+ messages in thread
From: Uros Bizjak @ 2020-05-08 18:14 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: kvm, Paolo Bonzini

On Fri, May 8, 2020 at 7:57 PM Sean Christopherson
<sean.j.christopherson@intel.com> wrote:
>
> On Fri, May 08, 2020 at 08:27:53AM +0200, Uros Bizjak wrote:
> > Move the definition of __ex to a common include to be
> > shared between VMX and SVM.
> >
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> > ---
> >  arch/x86/include/asm/kvm_host.h | 2 ++
> >  arch/x86/kvm/svm/svm.c          | 2 --
> >  arch/x86/kvm/vmx/ops.h          | 2 --
> >  3 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> > index 35a915787559..4df0c07b0a62 100644
> > --- a/arch/x86/include/asm/kvm_host.h
> > +++ b/arch/x86/include/asm/kvm_host.h
> > @@ -1620,6 +1620,8 @@ asmlinkage void kvm_spurious_fault(void);
> >       "668: \n\t"                                                     \
> >       _ASM_EXTABLE(666b, 667b)
> >
> > +#define __ex(x) __kvm_handle_fault_on_reboot(x)
>
> Moving this to asm/kvm_host.h is a bit sketchy as __ex() isn't exactly the
> most unique name.  arch/x86/kvm/x86.h would probably be a better
> destination as it's "private".  __ex() is only used in vmx.c, nested.c and
> svm.c, all of which already include x86.h.

I have put this define nearby __kvm_handle_fault_on_reboot, as __ex is
its sole user.

OTOH, it looks that __kvm_handle_fault_on_reboot definition and
kvm_spurious_fault prototype can both  be moved to x86.h.

Uros.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-08 18:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  6:27 [PATCH] KVM: x86: Move definition of __ex to kvm_host.h Uros Bizjak
2020-05-08 17:57 ` Sean Christopherson
2020-05-08 18:14   ` Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).