From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXs9j-00087n-KE for qemu-devel@nongnu.org; Thu, 11 Aug 2016 11:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXs9d-0002UP-Lk for qemu-devel@nongnu.org; Thu, 11 Aug 2016 11:44:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXs9d-0002UK-GT for qemu-devel@nongnu.org; Thu, 11 Aug 2016 11:44:21 -0400 Date: Thu, 11 Aug 2016 17:44:16 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Message-ID: <20160811154416.GC10637@potion> References: <1470922183-22873-1-git-send-email-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470922183-22873-1-git-send-email-peterx@redhat.com> Subject: Re: [Qemu-devel] [PATCH] intel_iommu: add "eim" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@web.de, pbonzini@redhat.com, imammedo@redhat.com, davidkiarie4@gmail.com, rth@twiddle.net 2016-08-11 21:29+0800, Peter Xu: > Adding one extra property for intel-iommu device to decide whether we > should support EIM bit for IR. > > Now we are throwing high 24 bits of dest_id away directly. This will > cause interrupt issues with guests that: > > - enabled x2apic with cluster mode > - have more than 16 vcpus (so will have more than 1 cluster) Good catch, it is a problem starting at 9 VCPUs, because that one is already "0x100" and we truncate to 8 bits ... > Let's make xapic the default one, and for the brave people who would > like to try EIM and know the side effects, we can do it by explicitly > enabling EIM using: This might bite us: users cannot easily tell when EIM is sane, so eim=on is going to be a hazard even after some KVM/QEMU has it fixed. I'd make make eim=on fail when logical x2APIC is broken. Right now, we can allow eim=on if maximal APIC ID < 8, because physical 0xffffffff gets truncated to 0xff and is still interpreted as a broadcast thanks to the quirk. Logical 0xff gets misinterpreted as a broadcast, but it would address all APICs anyway and KVM's lowest-priority works for broadcast too, so it is fine to do so. Not very wise, though. :) > -device intel-iommu,intremap=on,eim=on > > Even after we have x2apic support, it'll still be good if we can provide > a way to switch xapic/x2apic from QEMU side for e.g. debugging purpose, > which is an alternative for tuning guest kernel boot parameters. > > We can switch the default to "on" after x2apic fully supported. > > Signed-off-by: Peter Xu > --- > This will have small conflict with Radim's patches to selectively > enable EIM. I can do a rebase when needed. This patch made me realize that broadcast quirk is not enough, so I'll do v2 on top of this.