From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTf6G-0007rA-GP for qemu-devel@nongnu.org; Wed, 10 Feb 2016 19:27:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTf6F-0000BZ-Hx for qemu-devel@nongnu.org; Wed, 10 Feb 2016 19:27:12 -0500 Date: Thu, 11 Feb 2016 09:37:42 +1000 From: David Gibson Message-ID: <20160210233742.GG29288@voom.bne.redhat.com> References: <1455127752-17293-1-git-send-email-thuth@redhat.com> <1455127752-17293-4-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nhYGnrYv1PEJ5gA2" Content-Disposition: inline In-Reply-To: <1455127752-17293-4-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/4] hw/ppc/spapr: Implement the h_set_xdabr hypercall List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, laurent@vivier.eu --nhYGnrYv1PEJ5gA2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 10, 2016 at 07:09:11PM +0100, Thomas Huth wrote: > The H_SET_XDABR hypercall is similar to H_SET_DABR, but also sets > the extended DABR (DABRX) register. >=20 > Signed-off-by: Thomas Huth > --- > hw/ppc/spapr_hcall.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) >=20 > diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c > index 6b9d512..f14f849 100644 > --- a/hw/ppc/spapr_hcall.c > +++ b/hw/ppc/spapr_hcall.c > @@ -366,6 +366,27 @@ static target_ulong h_set_dabr(PowerPCCPU *cpu, sPAP= RMachineState *spapr, > return H_SUCCESS; > } > =20 > +static target_ulong h_set_xdabr(PowerPCCPU *cpu, sPAPRMachineState *spap= r, > + target_ulong opcode, target_ulong *args) > +{ > + CPUState *cs =3D CPU(cpu); > + target_ulong dabrx =3D args[1]; > + > + if (!has_spr(cpu, SPR_DABR) || !has_spr(cpu, SPR_DABRX)) { > + return H_HARDWARE; > + } > + > + if ((dabrx & ~0xfULL) !=3D 0 || (dabrx & H_DABRX_HYPERVISOR) !=3D 0 > + || (dabrx & (H_DABRX_KERNEL | H_DABRX_USER)) =3D=3D 0) { > + return H_PARAMETER; > + } > + > + set_spr(cs, SPR_DABRX, dabrx, -1L); > + set_spr(cs, SPR_DABR, args[0], -1L); Same comments for set_spr(). > + > + return H_SUCCESS; > +} > + > #define FLAGS_REGISTER_VPA 0x0000200000000000ULL > #define FLAGS_REGISTER_DTL 0x0000400000000000ULL > #define FLAGS_REGISTER_SLBSHADOW 0x0000600000000000ULL > @@ -1024,6 +1045,7 @@ static void hypercall_register_types(void) > /* processor register resource access h-calls */ > spapr_register_hypercall(H_SET_SPRG0, h_set_sprg0); > spapr_register_hypercall(H_SET_DABR, h_set_dabr); > + spapr_register_hypercall(H_SET_XDABR, h_set_xdabr); > spapr_register_hypercall(H_SET_MODE, h_set_mode); > =20 > /* "debugger" hcalls (also used by SLOF). Note: We do -not- differen= ciate --=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 --nhYGnrYv1PEJ5gA2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWu8nGAAoJEGw4ysog2bOSa9AQAK9llos4/S3ElvIwtxndZJ1V lJvl/M698PIyAzgabWQNgmrGcLNmCXHrfGb2dv8FkKWbtl2g/+p+afIZGzNWTjCY xwoMpKlqQ0V7PnsT+zQMBpRrbW4HURByOeMYmoVDxqLPCvBukzTHymhFNNH2NEkq O4Ib9qiEFgvDV1Xsf2UJwoTTfDwZrGnQqpd02/DlBx/2i4HLgTlC5+CDGXQp9LLu 7/0CXF9QQfemdf9maSJos3/i5sYG0oSGIG79iLK0hhYe7yjzqOJaXEqRhAGEoq+s mwnrmO26zjNdJrcQOMFN0HTXrqSTozleEKZHyF5tFh9aOscAfsmZSGsyOb7XH8wD Xyg8c5SKxrc9RRUlMI9rKh1bWrVuMFlBhz2q2NsgjA9NAr3nWBY5shyOZoD+97K9 urUqX8eU1hp7O/bITNVAxAhUmTa1hR3VBL56UhOTi1gYGTCRCkkd6NWJcVdqehvO dEOd1QkCuCTo2eWHIwvj3aeVmAE3nYnKz5BGhIMQVrEd0AxzLh3H/GMSuiDnXWSi Rdy4hsRsj2uLWtidCHhg2qmLXrv5ONf8ldL7ZAetHdbf/kFUMuVCwtzch3scku5/ xRGTRGgN2l/r+XsTrbxnpFH5ZAq6Z7lFUHWiRMmsajSqkXFDIjrjfC5bHB3v5Lf+ Bq7TE8XVRvnNRQj5SksH =GYwz -----END PGP SIGNATURE----- --nhYGnrYv1PEJ5gA2--