From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Date: Thu, 03 Sep 2015 05:32:45 +0000 Subject: Re: [PATCH 2/2] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set Message-Id: <20150903053245.GN6537@voom.redhat.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="5FetH82qe0Z6y/zI" List-Id: References: <20150903052123.GB4377@iris.ozlabs.ibm.com> In-Reply-To: <20150903052123.GB4377@iris.ozlabs.ibm.com> To: Paul Mackerras Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org --5FetH82qe0Z6y/zI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 03, 2015 at 03:21:23PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" >=20 > The code that handles the case when we receive a H_DOORBELL interrupt > has a comment which says "Hypervisor doorbell - exit only if host IPI > flag set". However, the current code does not actually check if the > host IPI flag is set. This is due to a comparison instruction that > got missed. >=20 > As a result, the current code performs the exit to host only > if some sibling thread or a sibling sub-core is exiting to the > host. This implies that, an IPI sent to a sibling core in > (subcores-per-core !=3D 1) mode will be missed by the host unless the > sibling core is on the exit path to the host. >=20 > This patch adds the missing comparison operation which will ensure > that when HOST_IPI flag is set, we unconditionally exit to the host. >=20 > Fixes: 66feed61cdf6 > Cc: stable@vger.kernel.org # v4.1+ > Signed-off-by: Gautham R. Shenoy > Signed-off-by: Paul Mackerras Reviewed-by: David Gibson > --- > arch/powerpc/kvm/book3s_hv_rmhandlers.S | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/b= ook3s_hv_rmhandlers.S > index b07f045..2273dca 100644 > --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S > +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S > @@ -1213,6 +1213,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) > cmpwi r12, BOOK3S_INTERRUPT_H_DOORBELL > bne 3f > lbz r0, HSTATE_HOST_IPI(r13) > + cmpwi r0, 0 > beq 4f > b guest_exit_cont > 3: --=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 --5FetH82qe0Z6y/zI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV59t9AAoJEGw4ysog2bOS9uEQAMMgCDFVdWeeZ4ZLFZEnCHVG jtENLoeTX+L3JS/U6UHFz8q9VvAQTYeDEcbQN3akMobmLXu/LKe2iFjBs4Ojdh0A qAgMVW8FZO5s4HoKB2xndq2ryzav5caXUDkMQmykAGC8v7q0Gb9HVSa7ghOyTvuJ cf2JMWmJPJ44VrNzHTsUdU/neQFjS9M2FKuqAjOcGr6392+8Qjwtt8Ud2z1hfwjC 9oUzT1CRPh0AJKG8ZRRUF9NF8gXhVrqaynAtmLkOXxvqP6hw10/oQBMBhVRB9z6h sHDjawtl8ltsOvJ0qKMjnwnPqpEsAcSWN2WJfbQ2l3VqaU+lx0YkikL1OURlKkh9 loracO4Q2g+PC5xb147uPwlZqeq3AYyM2XC6LzYC5AS5PkESAnZNO1vgOl4mcdYp L/kVLSobBCCT+mWZgQM46A7U5jqW1CnoAKdgsOnpS3MM/BfMrxRCjflZzhAbXm9h saVY8dD219duH3smdlOdP/sycNoL7ABC3H+4IzAoNO1UG2LhEn1GfX9sNp2Pb58X GIOKDCLWmdSe95ytBrx+7hnadnZZOU7wK4zh208PvgIk1ayBJ0xc+Swjgc4Hd1ls zqDzbS9jhxw57NLTe02gIukXGYmO9gKBiyrjlhxWiSNv0wFkD1K2dnBATSqCn1Kw R/vJrH8agWaD9jGKBDzG =jeLn -----END PGP SIGNATURE----- --5FetH82qe0Z6y/zI-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH 2/2] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set Date: Thu, 3 Sep 2015 15:32:45 +1000 Message-ID: <20150903053245.GN6537@voom.redhat.com> References: <20150903052123.GB4377@iris.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5FetH82qe0Z6y/zI" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org To: Paul Mackerras Return-path: Received: from ozlabs.org ([103.22.144.67]:52988 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750705AbbICFc0 (ORCPT ); Thu, 3 Sep 2015 01:32:26 -0400 Content-Disposition: inline In-Reply-To: <20150903052123.GB4377@iris.ozlabs.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: --5FetH82qe0Z6y/zI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 03, 2015 at 03:21:23PM +1000, Paul Mackerras wrote: > From: "Gautham R. Shenoy" >=20 > The code that handles the case when we receive a H_DOORBELL interrupt > has a comment which says "Hypervisor doorbell - exit only if host IPI > flag set". However, the current code does not actually check if the > host IPI flag is set. This is due to a comparison instruction that > got missed. >=20 > As a result, the current code performs the exit to host only > if some sibling thread or a sibling sub-core is exiting to the > host. This implies that, an IPI sent to a sibling core in > (subcores-per-core !=3D 1) mode will be missed by the host unless the > sibling core is on the exit path to the host. >=20 > This patch adds the missing comparison operation which will ensure > that when HOST_IPI flag is set, we unconditionally exit to the host. >=20 > Fixes: 66feed61cdf6 > Cc: stable@vger.kernel.org # v4.1+ > Signed-off-by: Gautham R. Shenoy > Signed-off-by: Paul Mackerras Reviewed-by: David Gibson > --- > arch/powerpc/kvm/book3s_hv_rmhandlers.S | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/b= ook3s_hv_rmhandlers.S > index b07f045..2273dca 100644 > --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S > +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S > @@ -1213,6 +1213,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) > cmpwi r12, BOOK3S_INTERRUPT_H_DOORBELL > bne 3f > lbz r0, HSTATE_HOST_IPI(r13) > + cmpwi r0, 0 > beq 4f > b guest_exit_cont > 3: --=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 --5FetH82qe0Z6y/zI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV59t9AAoJEGw4ysog2bOS9uEQAMMgCDFVdWeeZ4ZLFZEnCHVG jtENLoeTX+L3JS/U6UHFz8q9VvAQTYeDEcbQN3akMobmLXu/LKe2iFjBs4Ojdh0A qAgMVW8FZO5s4HoKB2xndq2ryzav5caXUDkMQmykAGC8v7q0Gb9HVSa7ghOyTvuJ cf2JMWmJPJ44VrNzHTsUdU/neQFjS9M2FKuqAjOcGr6392+8Qjwtt8Ud2z1hfwjC 9oUzT1CRPh0AJKG8ZRRUF9NF8gXhVrqaynAtmLkOXxvqP6hw10/oQBMBhVRB9z6h sHDjawtl8ltsOvJ0qKMjnwnPqpEsAcSWN2WJfbQ2l3VqaU+lx0YkikL1OURlKkh9 loracO4Q2g+PC5xb147uPwlZqeq3AYyM2XC6LzYC5AS5PkESAnZNO1vgOl4mcdYp L/kVLSobBCCT+mWZgQM46A7U5jqW1CnoAKdgsOnpS3MM/BfMrxRCjflZzhAbXm9h saVY8dD219duH3smdlOdP/sycNoL7ABC3H+4IzAoNO1UG2LhEn1GfX9sNp2Pb58X GIOKDCLWmdSe95ytBrx+7hnadnZZOU7wK4zh208PvgIk1ayBJ0xc+Swjgc4Hd1ls zqDzbS9jhxw57NLTe02gIukXGYmO9gKBiyrjlhxWiSNv0wFkD1K2dnBATSqCn1Kw R/vJrH8agWaD9jGKBDzG =jeLn -----END PGP SIGNATURE----- --5FetH82qe0Z6y/zI--