]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge tag 'kvm-x86-apic-6.20' of https://github.com/kvm-x86/linux into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 9 Feb 2026 18:33:30 +0000 (19:33 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Feb 2026 17:45:32 +0000 (12:45 -0500)
KVM x86 APIC-ish changes for 6.20

 - Fix a benign bug where KVM could use the wrong memslots (ignored SMM) when
   creating a vCPU-specific mapping of guest memory.

 - Clean up KVM's handling of marking mapped vCPU pages dirty.

 - Drop a pile of *ancient* sanity checks hidden behind in KVM's unused
   ASSERT() macro, most of which could be trivially triggered by the guest
   and/or user, and all of which were useless.

 - Fold "struct dest_map" into its sole user, "struct rtc_status", to make it
   more obvious what the weird parameter is used for, and to allow burying the
   RTC shenanigans behind CONFIG_KVM_IOAPIC=y.

 - Bury all of ioapic.h and KVM_IRQCHIP_KERNEL behind CONFIG_KVM_IOAPIC=y.

 - Add a regression test for recent APICv update fixes.

 - Rework KVM's handling of VMCS updates while L2 is active to temporarily
   switch to vmcs01 instead of deferring the update until the next nested
   VM-Exit.  The deferred updates approach directly contributed to several
   bugs, was proving to be a maintenance burden due to the difficulty in
   auditing the correctness of deferred updates, and was polluting
   "struct nested_vmx" with a growing pile of booleans.

 - Handle "hardware APIC ISR", a.k.a. SVI, updates in kvm_apic_update_apicv()
   to consolidate the updates, and to co-locate SVI updates with the updates
   for KVM's own cache of ISR information.

 - Drop a dead function declaration.

1  2 
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/ioapic.c
arch/x86/kvm/irq.c
arch/x86/kvm/lapic.c
arch/x86/kvm/lapic.h
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h
tools/testing/selftests/kvm/Makefile.kvm
tools/testing/selftests/kvm/include/x86/apic.h

Simple merge
index a26fa4222f292a2726eb7a30c83489db84dd2c3e,9a99d01b111cebf658ac426e83407e46fd1d4e94..a38a8e2ac70b18552d53dd32881b8dc3208223d6
@@@ -561,10 -555,9 +555,9 @@@ static void kvm_ioapic_update_eoi_one(s
        spin_lock(&ioapic->lock);
  
        if (trigger_mode != IOAPIC_LEVEL_TRIG ||
 -          kvm_lapic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI)
 +          kvm_lapic_suppress_eoi_broadcast(apic))
                return;
  
-       ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG);
        ent->fields.remote_irr = 0;
        if (!ent->fields.mask && (ioapic->irr & (1 << pin))) {
                ++ioapic->irq_eoi[pin];
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index c3c464513b4e4cb4f6a889ffb89f3176a1888424,6f00bd8271c20101569bb169a5bec94c2b64acee..0166944fa998c0885616f738540c463da2978043
@@@ -118,6 -115,8 +118,7 @@@ TEST_GEN_PROGS_x86 += x86/ucna_injectio
  TEST_GEN_PROGS_x86 += x86/userspace_io_test
  TEST_GEN_PROGS_x86 += x86/userspace_msr_exit_test
  TEST_GEN_PROGS_x86 += x86/vmx_apic_access_test
 -TEST_GEN_PROGS_x86 += x86/vmx_dirty_log_test
+ TEST_GEN_PROGS_x86 += x86/vmx_apicv_updates_test
  TEST_GEN_PROGS_x86 += x86/vmx_exception_with_invalid_guest_state
  TEST_GEN_PROGS_x86 += x86/vmx_msrs_test
  TEST_GEN_PROGS_x86 += x86/vmx_invalid_nested_guest_state
index e9b9aebaac9731abd43b67827b36c52d4cfebb86,d42a0998d868672e517c9676731c56e091dbd3ff..5ca6bacbd70e1ac4df75fcf1175c6c26393304e4
  #define       APIC_TMICT      0x380
  #define       APIC_TMCCT      0x390
  #define       APIC_TDCR       0x3E0
 +#define       APIC_SELF_IPI   0x3F0
  
+ #define APIC_VECTOR_TO_BIT_NUMBER(v) ((unsigned int)(v) % 32)
+ #define APIC_VECTOR_TO_REG_OFFSET(v) ((unsigned int)(v) / 32 * 0x10)
  void apic_disable(void);
  void xapic_enable(void);
  void x2apic_enable(void);