From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bChve-0004z4-N0 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 02:34:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bChvb-0003ty-DE for qemu-devel@nongnu.org; Tue, 14 Jun 2016 02:34:25 -0400 Date: Tue, 14 Jun 2016 16:15:27 +1000 From: David Gibson Message-ID: <20160614061527.GO4882@voom.fritz.box> References: <1465795496-15071-1-git-send-email-clg@kaod.org> <1465795496-15071-3-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9DptZICXTlJ7FQ09" Content-Disposition: inline In-Reply-To: <1465795496-15071-3-git-send-email-clg@kaod.org> Subject: Re: [Qemu-devel] [PATCH 02/10] ppc: Create cpu_ppc_set_papr() helper (for LPCR) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Benjamin Herrenschmidt --9DptZICXTlJ7FQ09 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 13, 2016 at 07:24:48AM +0200, C=E9dric Le Goater wrote: > From: Benjamin Herrenschmidt >=20 > And move the code adjusting the MSR mask and calling kvmppc_set_papr() > to it. This allows us to add a few more things such as disabling setting > of MSR:HV and appropriate LPCR bits which will be used when fixing > the exception model. >=20 > Signed-off-by: Benjamin Herrenschmidt > Reviewed-by: David Gibson > [clg: previous commit 26a7f1291bb5 did not include the LPCR setting as > it was not needed at the time ] I see how this came about, but it means the commit message (both long and short) is confusingly mismatched from the code now. > Signed-off-by: C=E9dric Le Goater > --- > target-ppc/translate_init.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > index ca894ff4af45..edfd91a85425 100644 > --- a/target-ppc/translate_init.c > +++ b/target-ppc/translate_init.c > @@ -8509,6 +8509,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) > void cpu_ppc_set_papr(PowerPCCPU *cpu) > { > CPUPPCState *env =3D &cpu->env; > + ppc_spr_t *lpcr =3D &env->spr_cb[SPR_LPCR]; > ppc_spr_t *amor =3D &env->spr_cb[SPR_AMOR]; > =20 > /* PAPR always has exception vectors in RAM not ROM. To ensure this, > @@ -8518,6 +8519,19 @@ void cpu_ppc_set_papr(PowerPCCPU *cpu) > */ > env->msr_mask &=3D ~((1ull << MSR_EP) | MSR_HVB); > =20 > + /* Set emulated LPCR to not send interrupts to hypervisor. Note that > + * under KVM, the actual HW LPCR will be set differently by KVM itse= lf, > + * the settings below ensure proper operations with TCG in absence of > + * a real hypervisor > + */ > + lpcr->default_value &=3D ~(LPCR_VPM0 | LPCR_VPM1 | LPCR_ISL | LPCR_K= BV); > + lpcr->default_value |=3D LPCR_LPES0 | LPCR_LPES1; > + > + /* We should be followed by a CPU reset but update the active value > + * just in case... > + */ > + env->spr[SPR_LPCR] =3D lpcr->default_value; > + > /* Set a full AMOR so guest can use the AMR as it sees fit */ > env->spr[SPR_AMOR] =3D amor->default_value =3D 0xffffffffffffffffull; > =20 --=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 --9DptZICXTlJ7FQ09 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXX6D/AAoJEGw4ysog2bOSPrQP/1jO24MFnKHrnqVHjlWu7qMQ C9NmYrTTgEofOYFBLuWFz0AR/ZRrqYRuj3bfe3z4oz3+yLPJ1oCXCZ7RscSNqlWu 90HJK916IVFee5SFNO6N7E6tKeSmt4MfbYgP877BL8egG2BWnc1dLA6TExMpDDcO /VdRaAUyLbeq+c0lxcHnXFP33G4g7YOEqgsI5EsgW/7rBlmv0xsPXODeBk4ceM2e rY4K3rck0GFAOpF8EMEOWArr9j7LPZey5qZDa44D/NwxUZEAknJ836q5p5P9o1aY fN1+Z26BnD/EBbxiS5uJ1QrWqcEnR1bY2QMLQBw/Cz+cW0sfjZaLDgEsWHHA5X4E KehHC445QtaPQR+wPqC7p7lldHXEdWKzRvI374QDD/CvWs4+XY8MvUiTpjzn15M+ u/smO/y1Og4Pu+MPX+QuQuJbhkonrtoDDjicRa1FnboQwr2eigSsGAs/yjiGhXsw s6uSA9BYWnBGFhqsX1gW9jD0sJu+h90nfBiSXcO2JImxLqBGo0XlwOJnpPO9UPPS n+zXi8qu9BFGk/DS7tXnirRiTAtg4xOqRacemY7EL4zNXqtUPvMa/o2SZqwQNuaL iTcYvPmg/0VyG2n9EAv/N/TApLACx4L3V+AoNsjEG1neuYWXyzKIizmlJs0Li1kx sO2WlXi9VT4maJI14v5i =/9fp -----END PGP SIGNATURE----- --9DptZICXTlJ7FQ09--