From: Paolo Bonzini Subject: Re: [PATCH v3 12/14] KVM: x86: add a flag to disable KVM x2apic broadcast quirk Date: Wed, 13 Jul 2016 17:30:30 +0200 Message-ID: <5ae63d79-ff54-8a4f-8438-16ce5ae22ca0@redhat.com> References: <20160712200930.32143-1-rkrcmar@redhat.com> <20160712200930.32143-13-rkrcmar@redhat.com> <4b30aa90-24bb-c5d0-18c0-b1fb4a62014f@redhat.com> <20160713151413.GD22438@potion> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Lan, Tianyu" , Igor Mammedov , Jan Kiszka , Peter Xu , Yang Zhang To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: In-Reply-To: <20160713151413.GD22438@potion> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 13/07/2016 17:14, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > 2016-07-13 10:38+0200, Paolo Bonzini: >> On 12/07/2016 22:09, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >>> @@ -619,14 +619,17 @@ static bool kvm_apic_match_logical_addr(struc= t kvm_lapic *apic, u32 mda) >>> /* 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. >>> + * >>> + * The broadcast quirk can be disabled with KVM_CAP_X2APIC_API. >> >> --verbose version: >> >> /* 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. >> + * - dest always begins at 0 while xAPIC MDA has offset 24. This = is >> + * just a quirk in the API and is not problematic. >> * >> - * The broadcast quirk can be disabled with KVM_CAP_X2APIC_API. >> + * - in-kernel IOAPIC messages have to be delivered directly to >> + * x2APIC, because the kernel does not support interrupt remappi= ng. >> + * In order to support broadcast without interrupt remapping, x2= APIC >> + * rewrites the destination of non-IPI messages (and also of IPI= s sent >> + * from xAPIC-mode LAPICs) from APIC_BROADCAST to X2APIC_BROADCA= ST. >=20 > KVM doesn't do the operation in parentheses since 394457a928e0 ("KVM: > x86: some apic broadcast modes does not work"). >=20 > Following patches added only !ipi case (I already regret posting them= ). >=20 >> + * >> + * The broadcast quirk can be disabled with KVM_CAP_X2APIC_API. Th= is is >> + * important when userspace wants to use x2APIC-format MSIs, becaus= e >> + * APIC_BROADCAST (0xff) is a legal route for "cluster 0, CPUs 0-7"= =2E >> */ >> >> Sounds good? >=20 > Except that one bit. (Code alone really can't explain the what happe= ns > here.) >=20 Ok, will fix both bits tomorrow and repush to kvm/queue. Then test, push to kvm/next, and pass the tree to you. Thanks! Paolo