From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxOVH-0004Gm-G8 for qemu-devel@nongnu.org; Thu, 20 Oct 2016 21:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxOVF-0004MP-RK for qemu-devel@nongnu.org; Thu, 20 Oct 2016 21:20:11 -0400 Date: Fri, 21 Oct 2016 12:09:54 +1100 From: David Gibson Message-ID: <20161021010954.GY11140@umbus.fritz.box> References: <20161020065912.16132-1-npiggin@gmail.com> <20161020065912.16132-3-npiggin@gmail.com> <20161021004058.074a7769@roar.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XZLT0nNRngx3qG4/" Content-Disposition: inline In-Reply-To: <20161021004058.074a7769@roar.ozlabs.ibm.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/3] ppc: allow system reset interrupt to be delivered to guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nicholas Piggin Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , qemu-devel@nongnu.org, qemu-ppc@nongnu.org --XZLT0nNRngx3qG4/ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2016 at 12:40:58AM +1100, Nicholas Piggin wrote: > On Thu, 20 Oct 2016 15:08:07 +0200 > C=E9dric Le Goater wrote: >=20 > > On 10/20/2016 08:59 AM, Nicholas Piggin wrote: > > > Signed-off-by: Nicholas Piggin > > > --- > > > target-ppc/excp_helper.c | 8 ++++++-- > > > 1 file changed, 6 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c > > > index 53c4075..477af10 100644 > > > --- a/target-ppc/excp_helper.c > > > +++ b/target-ppc/excp_helper.c > > > @@ -390,9 +390,13 @@ static inline void powerpc_excp(PowerPCCPU *cpu,= int excp_model, int excp) > > > /* indicate that we resumed from power save mode */ > > > msr |=3D 0x10000; > > > new_msr |=3D ((target_ulong)1 << MSR_ME); > > > + new_msr |=3D (target_ulong)MSR_HVB; > > > + } else { > > > + /* The ISA specifies the HV bit is set when the hardware interr= upt > > > + * is raised, however when hypervisors deliver the exception to > > > + * guests, it should not be set. > > > + */ > > > } > > > - > > > - new_msr |=3D (target_ulong)MSR_HVB; > > > ail =3D 0; > > > break; > > > case POWERPC_EXCP_DSEG: /* Data segment exception = */ > > > =20 > >=20 > > should not that be cleared later on in powerpc_excp() by : > >=20 > > env->msr =3D new_msr & env->msr_mask; > >=20 > > ? but the routine is rather long so I might be missing a branch. >=20 > No you're right, so it can't leak into the guest, phew! >=20 > The problem I get is the interrupt code doing some things differently > depending on on the HV bit. For example what I noticed is the guest > losing its LE bit upon entry. >=20 > Perhaps a cleaner way is for the system reset case to set new_msr > according to the ISA, and then apply the msr_mask (or at least mask > out HV) before calculating the exception model? Any preference? I think the proposed revision makes sense. --=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 --XZLT0nNRngx3qG4/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYCWriAAoJEGw4ysog2bOSsMYQAKouiNmHmcoz2YQ2PFfEzW0A jVHAziyiGDkPEU9JS/ZCWeFL+3NJQtT4ebHh7457ExXVFM71D82Vh9htrfI0NlMe DBX0K15gCyfsBUkfhBv7+uW4MUeg/Oa3BLAdY/Brc6jquUJMwdbDD0sN2DYTpTpQ 3xXU18K/pGRVVTjJ4m2U5jxa71qK0cjODr7vjm3XGWLY/GL872kJ0vSphWzZ241z OdUeHXelcz9IL6gRg2pX9FgDoNme/ohrfV4VZTL0ll3uHyU3To23z4321605ocL4 FpyCp8DmU4D/VMNiuIjt8f1vuvAXNbrQrcvkBlTmqM/u/qpAcW5qS1DyJo7KbBN5 jUthqyIra/sDPtVNVyalQarKOrBAqYMPHdhSJs9j2XxzLwNdcWbj4K1ilkJso9vg RhcX0Up/sSx2LAEODSbMzV3JLSDCNvtOLfSLWE537Urfbu0u1nHnLBUeGaGPlZbi bMBpd2wNliBPEfwMCQLPidd9WtWXZgpuF3Q0kPciOpVkbEUqmWCXNixFuKFKeuuz 7tn7tT7/RRIrgM0tw0IYbGcglN246cm70LAPJPYOhIKKVuRnox1jRAqG0ZW0kxP2 1h9sSDAFSy2l/YGRKPNAmKdKSn7Cf4jpqp2RO+eMCBZMvVi+q/WH1zGi041XxMgi 9pUWVMEFQ1BCCr4Edjr3 =QAqD -----END PGP SIGNATURE----- --XZLT0nNRngx3qG4/--