From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUn2u-0004GX-1Z for qemu-devel@nongnu.org; Tue, 02 Aug 2016 23:40:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUn2r-000488-K7 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 23:40:38 -0400 Date: Wed, 3 Aug 2016 13:37:46 +1000 From: David Gibson Message-ID: <20160803033746.GI27583@voom.fritz.box> References: <1470193641-26000-1-git-send-email-peterx@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="e5GLnnZ8mDMEwH4V" Content-Disposition: inline In-Reply-To: <1470193641-26000-1-git-send-email-peterx@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] kvm-irqchip: only commit route when irqchip is used List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: qemu-devel@nongnu.org, aik@ozlabs.ru, qemu-ppc@nongnu.org, pbonzini@redhat.com, alex.williamson@redhat.com, mst@redhat.com, thuth@redhat.com --e5GLnnZ8mDMEwH4V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 03, 2016 at 11:07:21AM +0800, Peter Xu wrote: > Reported from Alexey Kardashevskiy: >=20 > 3f1fea0fb5bf "kvm-irqchip: do explicit commit when update irq" produces > a crash on pseries guest running with VFIO on POWER8 machine as it does > not support KVM_CAP_IRQCHIP (KVM_CAP_IRQ_XICS is there instead). At the > result, KVMState::irq_routes is NULL when VFIO calls > kvm_irqchip_commit_routes. >=20 > This makes the routing update conditional. >=20 > Reported-by: Alexey Kardashevskiy > Tested-by: Alexey Kardashevskiy > Signed-off-by: Peter Xu Applied to ppc-for-2.7, thanks. > --- > kvm-all.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/kvm-all.c b/kvm-all.c > index ef81ca5..65608de 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -1047,6 +1047,14 @@ void kvm_irqchip_commit_routes(KVMState *s) > { > int ret; > =20 > + if (kvm_gsi_direct_mapping()) { > + return; > + } > + > + if (!kvm_gsi_routing_enabled()) { > + return; > + } > + > s->irq_routes->flags =3D 0; > trace_kvm_irqchip_commit_routes(); > ret =3D kvm_vm_ioctl(s, KVM_SET_GSI_ROUTING, s->irq_routes); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --e5GLnnZ8mDMEwH4V Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXoWcKAAoJEGw4ysog2bOSmb8P/irYG3gN8xeUGK+o6YifUv1Y KwB3EOFqSzc5E5mL/GkbK9yzzk+nLb0Pkrqqk7PDhDVqu/ZnHy2z96sm70dXFEt7 7M4YYPNBbdAVc68iEztjBcdzTZZ5tqRcs2jQnNLba1Kk2ArWCGzzfe0C4Oq6dgkN 1CZRBIAN5SI356gmq7YS/4yU+IfkMOladh9lEVRdAkLwk9TmEi/ILJ7AZB5xPEQt RynWcEzzrrgulghjyUTmq3LKsnp/IEKIkCupsQWKWFAYrbpocgUdKwBtlV6SJ0Bc z23l2V3wLZI2mOTWmhHWkXraIf6he7WqpddGVKwUO97tBoDUAKVkglSsjP+BzQ/y 0QY79wgmOE5Hd9psdifDAwrt2p07xzF8Rv6w+nD55O6CsEpUEQMrteLCpUZCD3U4 L/gUVRZrHtOVwJsHYRemlSJM7CbMXlOo1LYi5SM4K/3gsGF2ORA4OrFn3wKe/wLo seVqxPNth64FoTOLBvmN9oXj9aqpF0Uv568bWihQbqayUtGkWR6rp8YTMVCKjxSP 5/36xkHmGh+MJFActLEPl/It0rpVLTXWRqZo8JkCui6rrxrOCzxe3ZXlhzUCIWrA 8Qrm18U49MSKkskYf/veOGym/fdAUFI5iBOxul/PkOG2x9827gdHNEZoCCJ0x7TG Kw6mVh7K4G+uERhXN+T/ =s6R+ -----END PGP SIGNATURE----- --e5GLnnZ8mDMEwH4V--