Received: from eggs.gnu.org ([2001:4830:134:3::10]:43349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btehj-0005e9-CY for qemu-devel@nongnu.org; Mon, 10 Oct 2016 13:49:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btehf-0002Y5-D9 for qemu-devel@nongnu.org; Mon, 10 Oct 2016 13:49:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btehf-0002Xw-76 for qemu-devel@nongnu.org; Mon, 10 Oct 2016 13:49:31 -0400 Date: Mon, 10 Oct 2016 14:49:28 -0300 From: Eduardo Habkost Message-ID: <20161010174928.GH22870@thinpad.lan.raisama.net> References: <20161010152848.17902-1-rkrcmar@redhat.com> <20161010152848.17902-7-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161010152848.17902-7-rkrcmar@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v5 6/7] intel_iommu: reject broken EIM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Radim =?utf-8?B?S3LEjW3DocWZ?= Cc: qemu-devel@nongnu.org, Peter Xu , Igor Mammedov , Paolo Bonzini , Richard Henderson , "Michael S. Tsirkin" On Mon, Oct 10, 2016 at 05:28:47PM +0200, Radim Kr=C4=8Dm=C3=A1=C5=99 wro= te: > Cluster x2APIC cannot work without KVM's x2apic API when the maximal > APIC ID is greater than 8 and only KVM's LAPIC can support x2APIC, so w= e > forbid other APICs and also the old KVM case with less than 9, to > simplify the code. >=20 > There is no point in enabling EIM in forbidden APICs, so we keep it > enabled only for the KVM APIC; unconditionally, because making the > option depend on KVM version would be a maintanance burden. >=20 > Old QEMUs would enable eim whenever intremap was on, which would trick > guests into thinking that they can enable cluster x2APIC even if any > interrupt destination would get clamped to 8 bits. > Depending on your configuration, QEMU could notice that the destination > LAPIC is not present and report it with a very non-obvious: >=20 > KVM: injection failed, MSI lost (Operation not permitted) >=20 > Or the guest could say something about unexpected interrupts, because > clamping leads to aliasing so interrupts were being delivered to > incorrect VCPUs. >=20 > KVM_X2APIC_API is the feature that allows us to enable EIM for KVM. >=20 > QEMU 2.7 allowed EIM whenever interrupt remapping was enabled. In orde= r > to keep backward compatibility, we again allow guests to misbehave in > non-obvious ways, and make it the default for old machine types. >=20 > A user can enable the buggy mode it with "x-buggy-eim=3Don". >=20 > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 Reviewed-by: Eduardo Habkost --=20 Eduardo