]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge branch 'kvm-ghcb-for-7.2' into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Jun 2026 15:00:06 +0000 (17:00 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Jun 2026 15:00:06 +0000 (17:00 +0200)
Merge the final part of the GHCB 7.2 fixes at
https://lore.kernel.org/kvm/20260529183549.1104619-1-pbonzini@redhat.com/.

Patches 1-17 have already been included in Linux 7.1; these are minor
cleanups, and fixes for behaviors that are suboptimal or contradicting
the specification.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1  2 
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/sev.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/vmx/capabilities.h
arch/x86/kvm/vmx/vmenter.S
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 07469d1cfe7462cb78f75d973abbf0b855cfc2e5,31568274d8bb020c0560d6a7580a5e0d13a460fc..810119167f798b7a27b4fd5487d14de4ee433e9b
@@@ -14,8 -14,8 +14,9 @@@ extern bool __read_mostly flexpriority_
  extern bool __read_mostly enable_ept;
  extern bool __read_mostly enable_unrestricted_guest;
  extern bool __read_mostly enable_ept_ad_bits;
+ extern bool __read_mostly enable_cet;
  extern bool __read_mostly enable_pml;
 +extern bool __read_mostly enable_mbec;
  extern int __read_mostly pt_mode;
  
  #define PT_MODE_SYSTEM                0
index 4b7aaa7430fb006254a6dbe0caba04a68272c773,ff1f254a0ef4e2ad1c2378d1a9fd588849d6a474..00d807505fc88e6f2a4fc9a0a62b51cfc036d4ad
@@@ -6,40 -7,30 +6,8 @@@
  #include <asm/percpu.h>
  #include <asm/segment.h>
  #include "kvm-asm-offsets.h"
 -#include "run_flags.h"
 -
 -#define WORD_SIZE (BITS_PER_LONG / 8)
 -
 -#define VCPU_RAX      __VCPU_REGS_RAX * WORD_SIZE
 -#define VCPU_RCX      __VCPU_REGS_RCX * WORD_SIZE
 -#define VCPU_RDX      __VCPU_REGS_RDX * WORD_SIZE
 -#define VCPU_RBX      __VCPU_REGS_RBX * WORD_SIZE
 -/* Intentionally omit RSP as it's context switched by hardware */
 -#define VCPU_RBP      __VCPU_REGS_RBP * WORD_SIZE
 -#define VCPU_RSI      __VCPU_REGS_RSI * WORD_SIZE
 -#define VCPU_RDI      __VCPU_REGS_RDI * WORD_SIZE
 -
 -#ifdef CONFIG_X86_64
 -#define VCPU_R8               __VCPU_REGS_R8  * WORD_SIZE
 -#define VCPU_R9               __VCPU_REGS_R9  * WORD_SIZE
 -#define VCPU_R10      __VCPU_REGS_R10 * WORD_SIZE
 -#define VCPU_R11      __VCPU_REGS_R11 * WORD_SIZE
 -#define VCPU_R12      __VCPU_REGS_R12 * WORD_SIZE
 -#define VCPU_R13      __VCPU_REGS_R13 * WORD_SIZE
 -#define VCPU_R14      __VCPU_REGS_R14 * WORD_SIZE
 -#define VCPU_R15      __VCPU_REGS_R15 * WORD_SIZE
 -#endif
 +#include "vmenter.h"
  
- .macro VMX_DO_EVENT_IRQOFF call_insn call_target
-       /*
-        * Unconditionally create a stack frame, getting the correct RSP on the
-        * stack (for x86-64) would take two instructions anyways, and RBP can
-        * be used to restore RSP to make objtool happy (see below).
-        */
-       push %_ASM_BP
-       mov %_ASM_SP, %_ASM_BP
- #ifdef CONFIG_X86_64
-       /*
-        * Align RSP to a 16-byte boundary (to emulate CPU behavior) before
-        * creating the synthetic interrupt stack frame for the IRQ/NMI.
-        */
-       and  $-16, %rsp
-       push $__KERNEL_DS
-       push %rbp
- #endif
-       pushf
-       push $__KERNEL_CS
-       \call_insn \call_target
-       /*
-        * "Restore" RSP from RBP, even though IRET has already unwound RSP to
-        * the correct value.  objtool doesn't know the callee will IRET and,
-        * without the explicit restore, thinks the stack is getting walloped.
-        * Using an unwind hint is problematic due to x86-64's dynamic alignment.
-        */
-       leave
-       RET
- .endm
  .section .noinstr.text, "ax"
  
  /**
Simple merge
index 48f259015ce4421e06425b3baa1b4b7d4865897d,0550359ed798fc6b336027543d1561210c7b3af1..a5e09bf431ceef412940b0afdc5b8dc7211d7eda
@@@ -14309,7 -14330,7 +14316,7 @@@ int kvm_handle_invpcid(struct kvm_vcpu 
                 * the RAP (Return Address Predicator).
                 */
                if (guest_cpu_cap_has(vcpu, X86_FEATURE_ERAPS))
-                       kvm_register_is_dirty(vcpu, VCPU_REG_ERAPS);
 -                      kvm_register_mark_dirty(vcpu, VCPU_EXREG_ERAPS);
++                      kvm_register_mark_dirty(vcpu, VCPU_REG_ERAPS);
  
                kvm_invalidate_pcid(vcpu, operand.pcid);
                return kvm_skip_emulated_instruction(vcpu);