Re: [REGRESSION] KVM: x86: OVMF boot hang with SMM enabled after commit b3e6212dea2e ("KVM: x86: Use active memslots for the per-vCPU MMIO cache")
From: Paolo Bonzini
Date: Wed Oct 28 2026 - 14:45:30 EST
On 10/28/26 19:01, Sean Christopherson wrote:
2. 'trace-cmd stream -e kvm:kvm_exit' shows a storm of 32-bit IN reads on port 0x608
(the ICH9 ACPI PM timer):
kvm_exit: reason IO_INSTRUCTION rip 0x7b125f0c info 608000b 0
This is already too late - the problem happened earlier.
Heh, I did the same thing. I was like, "this code doesn't exist!!!", thenvcpu_cache_mmio_info() does not use the address space id:Nevermind, wrong tree - I was reinventing the (apparently buggy) commit
u64 gen = kvm_memslots(vcpu->kvm)->generation;
Will send a patch soon.
because it's past 7.3.0-rc7... still looking.
realized the commit isn't in kvm/next.
I'll try to reproduce tomorrow. Sami, can you check
1) if this patch gives the WARN (with vanilla 6.18.58):
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index cfe96962a4e4..a96d839a317b 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -263,6 +263,7 @@ static inline void vcpu_cache_mmio_info(struct kvm_vcpu *vcpu,
vcpu->arch.mmio_access = access;
vcpu->arch.mmio_gfn = gfn;
vcpu->arch.mmio_gen = gen;
+ WARN_ON_ONCE((gen & 1) != kvm_arch_vcpu_memslots_id(vcpu));
}
static inline bool vcpu_match_mmio_gen(struct kvm_vcpu *vcpu)
2) if patch 1 or patch 2 separately are enough to fix the issue;
If you have time, can you also check if it fails to boot even before reaching Windows (you can try any Linux ISO, or even with no disk at all)? Also, just to cover all bases is your machine Intel or AMD?
Thanks,
Paolo