Re: [PATCH v2] KVM: x86: Track kvm_vcpu_arch.pending_ioapic_eoi as a u8 to drop dead BUG_ON()

From: Huang, Kai

Date: Thu Aug 06 2026 - 17:51:35 EST


On Thu, 2026-08-06 at 10:14 -0700, Sean Christopherson wrote:
> Track the vector associated with KVM_EXIT_IOAPIC_EOI as a u8, as the vector
> is zero-initialized and is only ever set to a legal vector. I.e. unlike
> many of the other vector variables in KVM, it can't be -1 (and can't be
> greater than 255, though that should hold true for all vectors in KVM).
>
> Drop the now fully dead BUG_ON(), which aside from being completely
> unnecessary, was also useless, as it wouldn't guard against a negative
> value, i.e. wouldn't detect KVM's magic -1 value.
>
> For all intents and purposes, no functional change intended.
>
> Suggested-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
>

Reviewed-by: Kai Huang <kai.huang@xxxxxxxxx>