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:38:26 EST
On 10/28/26 18:37, Sean Christopherson wrote:
generation countersHowever, address space 0 and address space 1 maintain separate
starting from 0.
This is also incorrect:
for (i = 0; i < kvm_arch_nr_memslot_as_ids(kvm); i++) {
for (j = 0; j < 2; j++) {
slots = &kvm->__memslots[i][j];
atomic_long_set(&slots->last_used_slot, (unsigned long)NULL);
slots->hva_tree = RB_ROOT_CACHED;
slots->gfn_tree = RB_ROOT;
hash_init(slots->id_hash);
slots->node_idx = j;
/* Generations must be different for each address space. */
slots->generation = i;
}
An MMIO access cached in SMM (e.g., GFN 0xFED40000 with gen = 4) matches in normal mode where gen is also 4.Hmm, this isn't adding up for me. It should be impossible for the generation to
be '4' for SMM, because SMM is supposed to use odd-numbered generations. From
kvm_swap_active_memslots():
vcpu_cache_mmio_info() does not use the address space id:
u64 gen = kvm_memslots(vcpu->kvm)->generation;
Will send a patch soon.
Paolo