From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEnFh-0000Bi-Bi for qemu-devel@nongnu.org; Sun, 19 Jun 2016 20:39:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEnFf-0006Uo-4W for qemu-devel@nongnu.org; Sun, 19 Jun 2016 20:39:44 -0400 Date: Mon, 20 Jun 2016 10:23:22 +1000 From: David Gibson Message-ID: <20160620002322.GM7790@voom.fritz.box> References: <1466159840-22141-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8c07nsHwQobhlezh" Content-Disposition: inline In-Reply-To: <1466159840-22141-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] powerpc/mm: Update the WIMG check during H_ENTER List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" Cc: paulus@samba.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --8c07nsHwQobhlezh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 17, 2016 at 04:07:20PM +0530, Aneesh Kumar K.V wrote: > Support for 0 value for memeory coherence is optional and with ppc64 > we can always enable memory coherence. Linux kernel did that during > the development of 4.7 kernel. But that resulted in failure in Qemu > in H_ENTER hcall due to below check. The mentioned change was reverted > in the kernel and kernel right now enable memory coherence only if > cache inhibited is not set. Nevertheless update qemu WIMG flag check > to cover the case where we enable memory coherence along with cache > inhibited flag. >=20 > In order to handle older and newer kernel version consider both Cache > inhibitted and (cache inhibitted | memory conference) as valid values > for wimg flags. >=20 > Signed-off-by: Aneesh Kumar K.V Applied to ppc-for-2.7 > --- > hw/ppc/spapr_hcall.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c > index 2ba5cbdb194a..e011ed4b664b 100644 > --- a/hw/ppc/spapr_hcall.c > +++ b/hw/ppc/spapr_hcall.c > @@ -102,11 +102,15 @@ static target_ulong h_enter(PowerPCCPU *cpu, sPAPRM= achineState *spapr, > return H_PARAMETER; > } > } else { > + target_ulong wimg_flags; > /* Looks like an IO address */ > /* FIXME: What WIMG combinations could be sensible for IO? > * For now we allow WIMG=3D010x, but are there others? */ > /* FIXME: Should we check against registered IO addresses? */ > - if ((ptel & (HPTE64_R_W | HPTE64_R_I | HPTE64_R_M)) !=3D HPTE64_= R_I) { > + wimg_flags =3D (ptel & (HPTE64_R_W | HPTE64_R_I | HPTE64_R_M)); > + > + if (wimg_flags !=3D HPTE64_R_I && > + wimg_flags !=3D (HPTE64_R_I | HPTE64_R_M)) { > return H_PARAMETER; > } > } --=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 --8c07nsHwQobhlezh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXZzd6AAoJEGw4ysog2bOShU8QAIlvvyO6yaFnPIk+LXLpcE71 BEZE8ojUnCAtZCoPMVZzhjb2j7guYp2bjUz63ohaYdNVDUuniMh9xtFqpPuQ9kQx XegXCPyQ/CRhx5qjRRw+qeEic8rxHUXxYqI11m/sKl/4AiqeuovOMcRuYw8oxDgk Kk8iHomoZ1Pmk8hPnISp/g+UE0erEVEoFDuwvLhz1tGNW44F40BPkFweDKFHK+JJ eKC9ASkucaMs4422FIugTlTs8iYuIuiRVwCvQYrVRG1CHeq2rdfG4EJpFF4xjkm9 iOYU9UD6APhB68WAhhy7PcSZFTqeORtyrKgAnWH5bqxwo43RD/x2L/bImsg003CM fSwXi9xn21uQSTjkOqdGCe3nUuRGt/VmVLOVTx+zOZwprwifykVayTgDxTHgia4y 0iF6i67kiOO7UmpV71jXfPDoXX34uQcuhaY6+PJTaZP2zn2nBZihGqBB2v2gnWkU 6W4uKd1zCir3EqxFoCa5QyzaAPmIQA5CLediZ69BOPDtYVl9VxlpdTsHXaZOuyFz uHaoEh+Ce7pM2norMi4Y1xur0ZhPc0JtaRukJJSiJudZKKZvgCwatcfYIb11VANM PcCXHpDDOmDrk5mM3ykFxlRI27PkVmPJO6fcmHF2QmG3OdjshMNM8l46xxC8RW6k aXdCWNyDhP0KkMJ9UC32 =aEPU -----END PGP SIGNATURE----- --8c07nsHwQobhlezh--