From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Nup-0000ZR-B5 for qemu-devel@nongnu.org; Thu, 02 Jun 2016 04:23:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8Nuk-0001fr-5T for qemu-devel@nongnu.org; Thu, 02 Jun 2016 04:23:43 -0400 Received: from mo7.mail-out.ovh.net ([178.32.228.7]:40301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Nuj-0001eY-SA for qemu-devel@nongnu.org; Thu, 02 Jun 2016 04:23:38 -0400 Received: from player787.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 4BD37FF9FFD for ; Thu, 2 Jun 2016 10:23:31 +0200 (CEST) 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> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <574FECED.90201@kaod.org> Date: Thu, 2 Jun 2016 10:23:09 +0200 MIME-Version: 1.0 In-Reply-To: <574FE419.8080201@ilande.co.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 , David Gibson Cc: peter.maydell@linaro.org, pbonzini@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, bharata.rao@gmail.com 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 a= nd >>>>>> 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 treat= s >>>>> 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 th= e >>> 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 patches= : >> >> [05/12] ppc: Fix hreg_store_msr() so that non-HV mode cannot alter MS= R: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. >=20 > 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). Got it. much better with ppc :) ppc is not that omnipotent. >> Could you try the two patches above please ? They apply on top of Dave= 's >> ppc-for-2.7-20160531 and seem to have a good behavior with the small t= est >> I could do. >=20 > I'll try and take a look tomorrow, however in the meantime see if the > above image enables you to replicate the issue locally. so, on top of ppc-for-2.7-20160531, with your fix for : ppc: Use split I/D mmu modes to avoid flushes on interrupts and these two patches : [05/12] ppc: Fix hreg_store_msr() so that non-HV mode cannot alter MSR:= 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/ The darwin cd boots correctly up to : ... The following devices are available for installation : and then loops on something. But I don't get a kernel panic anymore. Dave,=20 I still need to dig the !msr_pr removal. Thanks, C. > ATB, >=20 > Mark. >=20