On Fri, May 26, 2023, Michal Luczaj wrote: > On 5/26/23 18:17, Sean Christopherson wrote: > > On Fri, May 26, 2023, Michal Luczaj wrote: > >> Maybe it's not important, but what about moving xapic_id_mismatch > >> (re)initialization after "retry:"? > > > > Oof, good catch. I think it makes sense to move max_id (re)initialization too, > > even though I can't imagine it would matter in practice. > > Right, I forgot that max APIC ID can decrease along the way. Actually, we don't want to reset max_id. That would allow userspace or the guest to put KVM into an infinite loop, e.g. by toggling the APIC of the vCPU with the highest x2APIC ID between enabled and disabled. The downside of not shrinking the size is quite negligible.