From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zru22-00041T-Ov for qemu-devel@nongnu.org; Thu, 29 Oct 2015 16:42:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zru1y-0000yS-Ml for qemu-devel@nongnu.org; Thu, 29 Oct 2015 16:42:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zru1y-0000yN-EL for qemu-devel@nongnu.org; Thu, 29 Oct 2015 16:42:42 -0400 References: From: Eric Blake Message-ID: <563284BB.1030108@redhat.com> Date: Thu, 29 Oct 2015 14:42:35 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LbjeqgEFNcAie6GJN7niX6vFwKVrfKQam" Subject: Re: [Qemu-devel] RFC: Add support for KVM_CAP_SPLIT_IRQCHIP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matt Gingell , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LbjeqgEFNcAie6GJN7niX6vFwKVrfKQam Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/29/2015 02:25 PM, Matt Gingell wrote: > Hi, >=20 > The following patch adds support for the new KVM split irqchip > interface discussed recently on the KVM mailing list. >=20 > [kvm] KVM: x86: Split the APIC from the rest of IRQCHIP. > http://www.mailbrowse.com/kvm/138252.html >=20 > Our testing found some issues with the implementation of split IRQ > chip in the kernel, and without changes to address those it will not > be possible to test this. We've been able to do some preliminary > testing of the QEMU against our local kernel though and I'm able to > boot Linux and Windows with KVM_CAP_SPLIT_IRQCHIP enabled. >=20 > While we work on getting the KVM piece ready to submit, I'd appreciate > any feedback or discussion on the user space portion. >=20 > Thanks, > Matt Gingell >=20 > diff --git a/hw/core/machine.c b/hw/core/machine.c > index f4db340..3c14e78 100644 Your diff doesn't include the usual '---' separator and diffstat provided by 'git send-email'; making it a bit harder to see at a glance what your patch touches. I'm just doing an interface review, since I happened to notice that it touched a .json file. > +++ b/qapi/common.json > @@ -114,3 +114,19 @@ > ## > { 'enum': 'OnOffAuto', > 'data': [ 'auto', 'on', 'off' ] } > + > +## > +# @OnOffSplit > +# > +# An enumeration of three values: on, off, and split > +# > +# @on: Enabled > +# > +# @off: Disabled > +# > +# @split: Mixed > +# > +# Since: 2.5 (???) The question marks should not be in the final patch (but this is an RFC, so that's okay). On the other hand, you've missed soft freeze for 2.5, so it may end up being something we add for 2.6 instead. > +## > +{ 'enum': 'OnOffSplit', > + 'data': [ 'on', 'off', 'split' ] } Nothing in the user interface seems to use this new enum, so you are just using it internally. That's okay; it's not the first time. > @@ -54,10 +55,15 @@ This is used to enable an accelerator. Depending on= the target architecture, > kvm, xen, or tcg can be available. By default, tcg is used. If there i= s more > than one accelerator specified, the next one is used if the previous o= ne fails > to initialize. > +<<<<<<< > @item kernel_irqchip=3Don|off > Enables in-kernel irqchip support for the chosen accelerator when avai= lable. > @item gfx_passthru=3Don|off > Enables IGD GFX passthrough support for the chosen machine when availa= ble. > +=3D=3D=3D=3D=3D=3D=3D > +@item kernel_irqchip=3Don|off|split > +Controls in-kernel irqchip support for the chosen accelerator when ava= ilable. > +>>>>>>> Umm, you really don't want merge markers in your commit. > @@ -2799,6 +2805,20 @@ void kvm_arch_init_irq_routing(KVMState *s) > */ > kvm_msi_via_irqfd_allowed =3D true; > kvm_gsi_routing_allowed =3D true; > + > + if (kvm_irqchip_is_split()) { > + int i; > + > + /* If the ioapic is in QEMU and the lapics are in KVM, reserve= > + MSI routes for signaling interrupts to the local apics. */ > + for (i =3D 0; i < IOAPIC_NUM_PINS; i++) { > + struct MSIMessage msg =3D { 0x0, 0x0 }; > + if (kvm_irqchip_add_msi_route(s, msg) < 0) { > + fprintf(stderr, "Could not enable split IRQ mode."); > + exit(-1); exit(-1) is usually NOT what you want (yes, xargs has a special case when $? is 255 - but it is seldom used). You probably want exit(1). We are trying to avoid the addition of new fprintf(stderr), and instead use error_report(), in part because it gives more consistent output (such as the option to prepend timestamps). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --LbjeqgEFNcAie6GJN7niX6vFwKVrfKQam Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWMoS7AAoJEKeha0olJ0NqxNwIAKBJaE6Np7iw10Os4Zc0JXbc jTYEuJp1W3nyeo29HY8E8dvAIC9YhPjHH+uzDJsA8jSDTJJM2dWo9PpqbtU4KuTx 04tSE5DssQddGMG6G5n9cszT9ANhhKN69Vcmtxo5CNIrB1UDA1fnIPazY0iBsakm /nhc/q1PgmLObb18ATME7BaOXUNS4gzWtkza07VyrRIsB17KrhBkxtxcXirHAxoR 5FObxIvlrr6ttnbK91Tw9l4feB7Ava6xUsQ83icV7IhAJhbvA6S7lI8MgL4SM9Vx XLqYJjTTY4NZY71i58matT/8rzhxS9GVHZW708LNDNzOWXxOintWQab1lFZr+/M= =lLSK -----END PGP SIGNATURE----- --LbjeqgEFNcAie6GJN7niX6vFwKVrfKQam--