KVM: x86: Move definition of __ex to kvm_host.h
PATCH 1/1 KVM: x86: Move definition of __ex to kvm_host.h
Move the definition of __ex to a common include to be shared between VMX and SVM.
--- 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(-)
arch/x86/include/asm/kvm_host.h +2 -0
@@ -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);
arch/x86/kvm/svm/svm.c +0 -2
@@ -42,8 +42,6 @@#include "svm.h" -#define __ex (x) __kvm_handle_fault_on_reboot(x) -MODULE_AUTHOR ("Qumranet" );MODULE_LICENSE ("GPL" );
arch/x86/kvm/vmx/ops.h +0 -2
@@ -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);
Signature · 1 line
2.25.4
Quoted 16 lines · Uros Bizjak
Move the definition of
__exto a common include to be shared between VMX and SVM.Cc Paolo Bonzini <[email protected]>Signed-off-by Uros Bizjak <[email protected]>--- 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(-)arch/x86/include/asm/kvm_host.h +0
-0
arch/x86/include/asm/kvm_host.h asmlinkage void kvm_spurious_fault(void); · line 1623
Quoted 4 lines
arch/x86/include/asm/kvm_host.h +1
-0@@ -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.
Quoted 33 lines
arch/x86/include/asm/kvm_host.h +1
-0+#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);arch/x86/kvm/svm/svm.c +0
-2@@ -42,8 +42,6 @@#include "svm.h" -#define __ex (x) __kvm_handle_fault_on_reboot(x) -MODULE_AUTHOR ("Qumranet" );MODULE_LICENSE ("GPL" );arch/x86/kvm/vmx/ops.h +0
-2@@ -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);Signature · 1 line
2.25.4
Quoted 21 lines · Sean Christopherson
Quoted 19 lines · Uros Bizjak
Move the definition of
__exto a common include to be shared between VMX and SVM.Cc Paolo Bonzini <[email protected]>Signed-off-by Uros Bizjak <[email protected]>--- 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(-)arch/x86/include/asm/kvm_host.h +0
-0@@ -1620,6 +1620,8 @@ asmlinkage void kvm_spurious_fault(void);"668: \n\t" \ _ASM_EXTABLE(666b ,667b )
Quoted 6 lines
arch/x86/include/asm/kvm_host.h asmlinkage void kvm_spurious_fault(void); · line 1623
Quoted 1 line
arch/x86/include/asm/kvm_host.h +1
-0+#define __ex (x) __kvm_handle_fault_on_reboot(x)Moving this to
asm/kvm_host.his a bit sketchy as__ex()isn't exactly the most unique name.arch/x86/kvm/x86.hwould probably be a better destination as it's "private".__ex()is only used invmx.c,nested.candsvm.c, all of which already includex86.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.