Re: [PATCH 16/19] KVM: x86: Explicitly track all possibilities for APIC map's logical modes

From: Sean Christopherson
Date: Fri Sep 16 2022 - 14:58:45 EST


On Wed, Aug 31, 2022, Maxim Levitsky wrote:
> On Wed, 2022-08-31 at 16:56 +0000, Sean Christopherson wrote:
> > On Wed, Aug 31, 2022, Maxim Levitsky wrote:
> > > > @@ -993,7 +1011,7 @@ static bool kvm_apic_is_broadcast_dest(struct kvm *kvm, struct kvm_lapic **src,
> > > > {
> > > > if (kvm->arch.x2apic_broadcast_quirk_disabled) {
> > > > if ((irq->dest_id == APIC_BROADCAST &&
> > > > - map->mode != KVM_APIC_MODE_X2APIC))
> > > > + map->logical_mode != KVM_APIC_MODE_X2APIC))
> > > > return true;
> > > > if (irq->dest_id == X2APIC_BROADCAST)
> > > > return true;
> > >
> > > To be honest I would put that patch first, and then do all the other patches,
> > > this way you would avoid all of the hacks they do and removed here.
> >
> > I did it this way so that I could test this patch for correctness. Without the
> > bug fixes in place it's not really possible to verify this patch is 100% correct.
> >
> > I completely agree that it would be a lot easier to read/understand/review if
> > this came first, but I'd rather not sacrifice the ability to easily test this patch.
> >
>
> I am not 100% sure about this, but I won't argue about it, let it be.

Whelp, so much for my argument. I'm going to bite the bullet and move this patch
first so that the fix for logical x2APIC mode[*] doesn't need to pile on the hacks.

[*] https://lore.kernel.org/all/YyTF7SsMjm+pClqh@xxxxxxxxxx