From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag06d-00059l-1X for qemu-devel@nongnu.org; Tue, 15 Mar 2016 21:18:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag06b-00071J-7f for qemu-devel@nongnu.org; Tue, 15 Mar 2016 21:18:34 -0400 Date: Wed, 16 Mar 2016 12:07:46 +1100 From: David Gibson Message-ID: <20160316010746.GT9032@voom> References: <1457974600-13828-1-git-send-email-clg@fr.ibm.com> <1457974600-13828-10-git-send-email-clg@fr.ibm.com> <56E71317.1070706@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VZEZlOQeSr/zV9d3" Content-Disposition: inline In-Reply-To: <56E71317.1070706@redhat.com> Subject: Re: [Qemu-devel] [PATCH 09/17] ppc: SPURR & PURR are HV writeable and privileged List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --VZEZlOQeSr/zV9d3 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2016 at 08:37:59PM +0100, Thomas Huth wrote: > On 14.03.2016 17:56, C=E9dric Le Goater wrote: > > From: Benjamin Herrenschmidt > >=20 > > Those are HV writeable, so we provide a dummy write. We eventually need > > to provide a better emulation but for now this will get us going. > >=20 > > We also make them non-user readable as per the architecture. > >=20 > > Signed-off-by: Benjamin Herrenschmidt > > --- > > target-ppc/translate_init.c | 25 +++++++++++++++++-------- > > 1 file changed, 17 insertions(+), 8 deletions(-) > >=20 > > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > > index 7a399b97bc6f..10f67136b609 100644 > > --- a/target-ppc/translate_init.c > > +++ b/target-ppc/translate_init.c > > @@ -293,6 +293,13 @@ static void spr_read_purr (DisasContext *ctx, int = gprn, int sprn) > > { > > gen_helper_load_purr(cpu_gpr[gprn], cpu_env); > > } > > + > > +__attribute__ ((unused)) > > +static void spr_write_purr(DisasContext *ctx, int gprn, int sprn) > > +{ > > + /* Temporary placeholder */ > > +} >=20 > What's the "__attribute__ ((unused))" needed here for? The function is > referenced below, so it should be "used"? > Or is this simply about handling the CONFIG_USER_ONLY case? Then I think > it would be nicer to change the #ifdef in front of it to include > "!defined(CONFIG_USER_ONLY)", too. Ah, yes. I second Thomas' comment. >=20 > Thomas >=20 > > #endif > > #endif > > =20 > > @@ -7828,14 +7835,16 @@ static void gen_spr_book3s_purr(CPUPPCState *en= v) > > { > > #if !defined(CONFIG_USER_ONLY) > > /* PURR & SPURR: Hack - treat these as aliases for the TB for now = */ > > - spr_register_kvm(env, SPR_PURR, "PURR", > > - &spr_read_purr, SPR_NOACCESS, > > - &spr_read_purr, SPR_NOACCESS, > > - KVM_REG_PPC_PURR, 0x00000000); > > - spr_register_kvm(env, SPR_SPURR, "SPURR", > > - &spr_read_purr, SPR_NOACCESS, > > - &spr_read_purr, SPR_NOACCESS, > > - KVM_REG_PPC_SPURR, 0x00000000); > > + spr_register_kvm_hv(env, SPR_PURR, "PURR", > > + SPR_NOACCESS, SPR_NOACCESS, > > + &spr_read_purr, SPR_NOACCESS, > > + &spr_read_purr, &spr_write_purr, > > + KVM_REG_PPC_PURR, 0x00000000); > > + spr_register_kvm_hv(env, SPR_SPURR, "SPURR", > > + SPR_NOACCESS, SPR_NOACCESS, > > + &spr_read_purr, SPR_NOACCESS, > > + &spr_read_purr, &spr_write_purr, > > + KVM_REG_PPC_SPURR, 0x00000000); > > #endif > > } > > =20 > >=20 >=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 --VZEZlOQeSr/zV9d3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW6LHiAAoJEGw4ysog2bOSb3kQAI+M1XR/1qRYoj51ZkX+QGoQ rqYWLaJflf2umomnvtJqf9bSkIIzaQN1baMxo6KyJHG5SnLPbHQ+SPX339/LarT0 XubZ9qAvjM0YmKK1FT36bMTCr/n3+cFHOmvJJCHa2QjByYqvGuwp4CGmg9xQwu1C aCtp5AleJ25TAL9tWMxUIpTkLsC4MHG6kpkiqI1iYfUuKIHQwqLwkc6zDTeYVqTb cbfSwTpL79ZKMaSsUj783pMxorsFDLX4lMVHfy48nHBEtqpO1etQUucXeNMTPouM UKfiBdhsLtbvBGpduuQYtUAvlbFDQcffPfN/XvksbzXl1WfWyeuBlLyyyfnalB2a ImJBVgeeuL8pGFUkPm44LBAYuJ2mL0nqz1spjNRZ+0FZPR2AVsCScY2hk/Jzg+Md G4KGzySxow8npWosVnfl3TIa2iE+2a/gwFIs+hVj2A+LBNpyAgMk+nHAZ0HUB1zO Yu5L+lYePJboW+h/ZHvjJClnKavub9AAtb9gAGVxqbZPSFBtcwrhtg9pX99YGJGp IMIH9t5i3rRsDzuhU1d38cVtWZWjyradqNMsy+weFWB1T2zDxBkRehQBYavjNSqf LvpwgbOD/PCn5+bFnAe3r54B9wIDMo6vnqVq5jPoUo0K0uWRFKayWYxxRr+frz7S SyzDGcYWnan/7G4uc8+G =BS93 -----END PGP SIGNATURE----- --VZEZlOQeSr/zV9d3--