[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150130130941.GB28519@potion.redhat.com>
Date: Fri, 30 Jan 2015 14:09:41 +0100
From: Radim Krčmář <rkrcmar@...hat.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Nadav Amit <namit@...technion.ac.il>,
Gleb Natapov <gleb@...nel.org>
Subject: Re: [PATCH 5/8] KVM: x86: use MDA for interrupt matching
2015-01-30 10:03+0100, Paolo Bonzini:
> On 29/01/2015 22:48, Radim Krčmář wrote:
> > +/* KVM APIC implementation has two quirks
> > + * - dest always begins at 0 while xAPIC MDA has offset 24,
> > + * - IOxAPIC messages have to be delivered (directly) to x2APIC.
> > + */
> > +static u32
> > +kvm_apic_mda(unsigned int dest, struct kvm_lapic *ipi, bool x2apic_dest)
>
> Please pass two struct kvm_lapic, so that you can write
>
> bool ipi = source != NULL;
> bool x2apic_mda = apic_x2apic_mode(ipi ? source : dest);
>
> Looks a little nicer to me at least.
Definitely.
> > +{
> > + bool x2apic_mda = ipi ? apic_x2apic_mode(ipi) : x2apic_dest;
> > +
> > + if (!ipi && dest == APIC_BROADCAST)
> > + dest = X2APIC_BROADCAST;
>
> This works, but it is not super-clear that you are shifting left by 24
> here, and right in kvm_apic_broadcast(). What if you just make it
>
> if (!ipi && dest == APIC_BROADCAST && x2apic_mda)
> return X2APIC_BROADCAST.
It's better, it will be that way in v2 of [5-8/8], thanks.
(I was using it twice in earlier iterations and didn't think again.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists