From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8jGY-0001fu-4k for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:11:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8jGT-0008QJ-Mx for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:11:32 -0400 Date: Fri, 3 Jun 2016 17:12:10 +1000 From: David Gibson Message-ID: <20160603071210.GT1087@voom.fritz.box> References: <1464655277-14748-1-git-send-email-david@gibson.dropbear.id.au> <1464655277-14748-5-git-send-email-david@gibson.dropbear.id.au> <574E1021.8040805@ilande.co.uk> <20160601021511.GA15455@voom.fritz.box> <574E88AC.7020608@ilande.co.uk> <20160602031752.GJ15455@voom.fritz.box> <574FE228.5070008@kaod.org> <574FE419.8080201@ilande.co.uk> <574FECED.90201@kaod.org> <574FF285.3080008@ilande.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pd495SECmvzXpBRb" Content-Disposition: inline In-Reply-To: <574FF285.3080008@ilande.co.uk> Subject: Re: [Qemu-devel] [Qemu-ppc] [PULL 04/12] ppc: tlbie, tlbia and tlbisync are HV only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , peter.maydell@linaro.org, pbonzini@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, bharata.rao@gmail.com --pd495SECmvzXpBRb Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 02, 2016 at 09:47:01AM +0100, Mark Cave-Ayland wrote: > On 02/06/16 09:23, C=E9dric Le Goater wrote: >=20 > > On 06/02/2016 09:45 AM, Mark Cave-Ayland wrote: > >> On 02/06/16 08:37, C=E9dric Le Goater wrote: > >>> On 06/02/2016 05:17 AM, David Gibson wrote: > >>>> On Wed, Jun 01, 2016 at 08:03:08AM +0100, Mark Cave-Ayland wrote: > >>>>> On 01/06/16 03:15, David Gibson wrote: > >>>>> > >>>>>> On Tue, May 31, 2016 at 11:28:49PM +0100, Mark Cave-Ayland wrote: > >>>>>>> On 31/05/16 01:41, David Gibson wrote: > >>>>>>> > >>>>>>>> From: Benjamin Herrenschmidt > >>>>>>>> > >>>>>>>> Not that anything remotely recent supports tlbia but ... > >>>>>>>> > >>>>>>>> Signed-off-by: Benjamin Herrenschmidt > >>>>>>>> Signed-off-by: David Gibson > >>>>>>>> --- > >>>>>>>> target-ppc/translate.c | 6 +++--- > >>>>>>>> 1 file changed, 3 insertions(+), 3 deletions(-) > >>>>>>>> > >>>>>>>> diff --git a/target-ppc/translate.c b/target-ppc/translate.c > >>>>>>>> index dfd3010..690ffd2 100644 > >>>>>>>> --- a/target-ppc/translate.c > >>>>>>>> +++ b/target-ppc/translate.c > >>>>>>>> @@ -4858,7 +4858,7 @@ static void gen_tlbie(DisasContext *ctx) > >>>>>>>> #if defined(CONFIG_USER_ONLY) > >>>>>>>> gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); > >>>>>>>> #else > >>>>>>>> - if (unlikely(ctx->pr)) { > >>>>>>>> + if (unlikely(ctx->pr || !ctx->hv)) { > >>>>>>>> gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); > >>>>>>>> return; > >>>>>>>> } > >>>>>>>> @@ -4879,7 +4879,7 @@ static void gen_tlbsync(DisasContext *ctx) > >>>>>>>> #if defined(CONFIG_USER_ONLY) > >>>>>>>> gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); > >>>>>>>> #else > >>>>>>>> - if (unlikely(ctx->pr)) { > >>>>>>>> + if (unlikely(ctx->pr || !ctx->hv)) { > >>>>>>>> gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); > >>>>>>>> return; > >>>>>>>> } > >>>>>>>> @@ -4898,7 +4898,7 @@ static void gen_slbia(DisasContext *ctx) > >>>>>>>> #if defined(CONFIG_USER_ONLY) > >>>>>>>> gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); > >>>>>>>> #else > >>>>>>>> - if (unlikely(ctx->pr)) { > >>>>>>>> + if (unlikely(ctx->pr || !ctx->hv)) { > >>>>>>>> gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); > >>>>>>>> return; > >>>>>>>> } > >>>>>>> > >>>>>>> Unfortunately this patch breaks qemu-system-ppc for both g3beige = and > >>>>>>> mac99 under TCG causing a freeze in OpenBIOS when starting > >>>>>>> qemu-system-ppc with no parameters. > >>>>>> > >>>>>> Bother, sorry. > >>>>>> > >>>>>> I think this is because I applied this without the patch that trea= ts > >>>>>> machines with no hypervisor mode (e.g. Apples) as always being in > >>>>>> hypervisor mode. > >>>>> > >>>>> No problem, I can cope for a couple of days or so. > >>>> > >>>> C=E9dric, > >>>> > >>>> Not sure if you've seen this thread, but one of the HV-mode patches > >>>> caused a regression on Mac. I think it's because I didn't include t= he > >>>> other patch which treats Apple-mode PPCs as always having HV=3D1. > >>> > >>> I missed that as I didn't put myself in Cc :/=20 > >>> =20 > >>>> Can you make sending your updated version of that patch a priority, > >>>> even if the rest of the batch of HV patches isn't ready yet. > >>> > >>> sure. I will/should today or tomorrow. I suppose we want these patche= s : > >>> > >>> [05/12] ppc: Fix hreg_store_msr() so that non-HV mode cannot alter M= SR:HV > >>> http://patchwork.ozlabs.org/patch/618083/ > >>> > >>> [07/12] ppc: Better figure out if processor has HV mode=09 > >>> http://patchwork.ozlabs.org/patch/618089/ > >>> > >>> > >>> Mark, > >>> > >>> I tried to boot a darwinppc-602.iso with : > >>> > >>> qemu-system-ppc -M g3beige -cdrom darwinx86-602.iso -boot d > >>> > >>> but I get a : > >>> > >>> "No valid state has been set by load or ..." > >>> > >>> or we don't need to go further ? may be I need a newer FW. > >> > >> Hmmm that looks like you've got an x86 ISO there which is why > >> OpenBIOS/PPC fails to execute the bootloader. The image I use for > >> testing can be found here: > >> https://opensource.apple.com/static/iso/darwinppc-602.cdr.gz (simply > >> gunzip and then rename to .iso). > >=20 > > Got it. much better with ppc :) ppc is not that omnipotent. >=20 > :) >=20 > >>> Could you try the two patches above please ? They apply on top of Dav= e's > >>> ppc-for-2.7-20160531 and seem to have a good behavior with the small = test > >>> I could do. > >> > >> I'll try and take a look tomorrow, however in the meantime see if the > >> above image enables you to replicate the issue locally. > >=20 > >=20 > > so, on top of ppc-for-2.7-20160531, with your fix for : > >=20 > > ppc: Use split I/D mmu modes to avoid flushes on interrupts >=20 > Unfortunately this isn't really a fix: the whole point of splitting the > MMU modes is to be able to avoid these expensive cache flushes in the > first place. Yeah, the "fix" makes the I/D split patch basically worthless. > Then again it could be that this is exposing an existing > bug elsewhere... I strongly suspect that's the case, we just need to work out what. >=20 > > and these two patches : > >=20 > > [05/12] ppc: Fix hreg_store_msr() so that non-HV mode cannot alter MS= R:HV > > http://patchwork.ozlabs.org/patch/618083/ > >=20 > > [07/12] ppc: Better figure out if processor has HV mode=09 > > http://patchwork.ozlabs.org/patch/618089/ > >=20 > > The darwin cd boots correctly up to : > >=20 > > ... > > The following devices are available for installation : > >=20 > > and then loops on something. But I don't get a kernel panic anymore. >=20 > Yes, that effectively matches what I see here - glad that you are now > able to reproduce this. >=20 >=20 > ATB, >=20 > Mark. >=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 --pd495SECmvzXpBRb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXUS3JAAoJEGw4ysog2bOSvt0QAMV2fHetegW2siWzHIN60djU aN5DeyWIc5H78m4NLRcf9eC5++P+Kn/T93Kbs6FnvpTk5ze3ZZuahI+EkHcXgRwk Q4pgtUInaDnstXYuGPia6bOM+XO/yoDkdZg5Vq3HuMVCN89r6dkhF4qpmRjb8Lsi 489vlbWfXd22OlSVXfMSWTRwS2bDrb0zvWwf2iO3gNQ3vYBUybPlorkZUet+696u ZcJc8W/l1Zs4ZDUIzPul/brboFI2yF8pZ0SZEaaxOoRHUQ4XEgwvbhAtdorFf4Lf 633isrHXf8hUD+w6KBH46ePqC/ALQb8s5u5uE5noXJPyvmot0EE3Et8iQj/r+V/V 9xX1EtxLTJvhVBOAA8ZdMcuu1iEAhriffatZbaq9TVpggp4JfOHh2xe5sA5duYHr hdyBfZIIBYR+fOKLHSFMDaigYbdzHWe6PaXOc9okvad9L+v/8liR8VBiZS7IEw9U 38kaS4skpMciA4gFJITjXPd6vSZyd82i8XP+KqjJ5l9EGZQJ0+LZ1hVG6+U40B45 ERMYVcwxNG+8xU8iRZg60tUQg0EkV71A2VwK6dLUV91QI6cxyOhyKU58yKFg5VPJ Ys9p2ahzoj+oaxbHJivpXZmdNCyos8E9vCE8ML6Uxp66pxjcq2QTbsx+Z0OgvHmW Yf3DCcVtMLDWOdHaxXqN =BCcl -----END PGP SIGNATURE----- --pd495SECmvzXpBRb--