]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Merge commit 'kvm-vmenter-load-store-regs' into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 30 May 2026 20:37:48 +0000 (22:37 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 30 May 2026 20:42:15 +0000 (22:42 +0200)
Convert the repeated register save/restore sequences into macros,
trading some level of implementation trickiness for conciseness (more
than one register can be saved/restored with one invocation) and a
smaller chance of cut and paste errors between VMX and SVM files.

This becomes more useful with the upcoming support for APX, which
would need to add 32 lines to the VM entry/exit paths.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1  2 
arch/x86/include/asm/kvm_host.h

index 8a53ca619570175e99ef6452296ac4f863c3de34,aa77ccb7aaa587f7eda0212073fa6af12c7632a0..53527b0550c7ec11c31b1e2b5e860ca5178dadaf
@@@ -182,21 -182,20 +182,21 @@@ enum kvm_reg 
        VCPU_REGS_RSI = __VCPU_REGS_RSI,
        VCPU_REGS_RDI = __VCPU_REGS_RDI,
  #ifdef CONFIG_X86_64
-       VCPU_REGS_R8  = __VCPU_REGS_R8,
-       VCPU_REGS_R9  = __VCPU_REGS_R9,
-       VCPU_REGS_R10 = __VCPU_REGS_R10,
-       VCPU_REGS_R11 = __VCPU_REGS_R11,
-       VCPU_REGS_R12 = __VCPU_REGS_R12,
-       VCPU_REGS_R13 = __VCPU_REGS_R13,
-       VCPU_REGS_R14 = __VCPU_REGS_R14,
-       VCPU_REGS_R15 = __VCPU_REGS_R15,
+       VCPU_REGS_R8  = 8,
+       VCPU_REGS_R9,
+       VCPU_REGS_R10,
+       VCPU_REGS_R11,
+       VCPU_REGS_R12,
+       VCPU_REGS_R13,
+       VCPU_REGS_R14,
+       VCPU_REGS_R15,
  #endif
 -      VCPU_REGS_RIP,
 -      NR_VCPU_REGS,
 +      NR_VCPU_GENERAL_PURPOSE_REGS,
  
 -      VCPU_EXREG_PDPTR = NR_VCPU_REGS,
 -      VCPU_EXREG_CR0,
 +      VCPU_REG_RIP = NR_VCPU_GENERAL_PURPOSE_REGS,
 +
 +      VCPU_REG_PDPTR,
 +      VCPU_REG_CR0,
        /*
         * Alias AMD's ERAPS (not a real register) to CR3 so that common code
         * can trigger emulation of the RAP (Return Address Predictor) with