All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Fabiano Rosas <farosas@linux.ibm.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	<qemu-devel@nongnu.org>
Cc: danielhb413@gmail.com, openbios@openbios.org,
	qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
Subject: Re: [RFC PATCH 0/2] QEMU/openbios: PPC Software TLB support in the G4 family
Date: Fri, 7 Jan 2022 09:19:21 +0100	[thread overview]
Message-ID: <0dbc9805-e08b-2190-8c1b-2a9e4081c02e@kaod.org> (raw)
In-Reply-To: <874k7vq8ug.fsf@linux.ibm.com>

On 11/29/21 16:28, Fabiano Rosas wrote:
> Cédric Le Goater <clg@kaod.org> writes:
> 
>>>> Right. If we're doing this to say "I can boot a kernel with a 7450 cpu in QEMU" but
>>>> the implementation is different from real hardware, then I'm not sure what the real
>>>> value is. That effectively leaves option b) if someone is willing to do the work, or
>>>> as you say to simply remove the code from QEMU.
>>>
>>> Yeah, that is a good point. Although the software TLB is well contained,
>>> so we could certainly document that our 7450s don't have that feature
>>> and call it a day. Does QEMU have any policy on how much of a machine is
>>> required to be implemented?
>>>
>>> I am more inclined to apply c) for now as I said, just to have some code
>>> running on the CPU and maybe document in a gitlab issue that we're
>>> lacking the runtime switch and eventually implement that. It's not like
>>> this is high traffic code anyway. It has been broken for 10+ years.
>>>
>>> That said, if Cédric and Daniel see more value in moving the 7450s to
>>> the POWERPC_MMU_32B I won't oppose.
>>
>> I am in favor of dropping unused code in QEMU and keeping the CPUs for
>> which we have support in Linux using the POWERPC_MMU_32B in QEMU and the
>> openbios patch. If we need SoftTLB support for the 74x CPUs in QEMU, we
>> can always dig in the history.
> 
> Ack. I'll send a v2.
> 
>>
>> We can give FreeBSB a try also since they had support for the G4 :
>>
>>     https://people.freebsd.org/~arved/stuff/minimac
>>
>>
>> With the openbios patch, Linux boots fine under 7450, 7455, 7447 CPUs.
>>
>> Under 7448, it drops in xmon with a :
>>    
>> kernel tried to execute exec-protected page (c07fdd98) - exploit attempt? (uid: 0)
>> BUG: Unable to handle kernel instruction fetch
>> Faulting instruction address: 0xc07fdd98
>> Vector: 400 (Instruction Access) at [f1019d30]
>>       pc: c07fdd98: __do_softirq+0x0/0x2f0
>>       lr: c00516a4: irq_exit+0xbc/0xf8
>>       sp: f1019df0
>>      msr: 10001032
>>     current = 0xc0d00000
>>       pid   = 1, comm = swapper
> 
> I see two possible issues:
> 
> 1) The 7448 is configured as a 7400 in QEMU (cpu-models.c), so it will
> behave differently from the 7450s. The user manual seems to indicate it
> is closer to a 7445 than a 7400. We need to double check what is correct.
> 
> 2) OpenBIOS already has support for the 7448 PVR without my patch, but
> given that no other cpu of the 7450 family is supported, I'd say this is
> accidental. The mask that OpenBIOS uses for e600/MPC86xx is:
> 
>          .iu_version = 0x80040000,
>          .name = "PowerPC,MPC86xx",
> 
> And the verification:
> 
>      iu_version = mfpvr() & 0xffff0000;
> 
>      for (i = 0; i < sizeof(ppc_defs) / sizeof(struct cpudef); i++) {
>          if (iu_version == ppc_defs[i].iu_version)
>              return &ppc_defs[i];
>      }
>      printk("Unknown cpu (pvr %x), freezing!\n", iu_version);
> 
> But QEMU says the PVRs are as follows:
> 
>      CPU_POWERPC_e600               = 0x80040010,
> #define CPU_POWERPC_MPC8610          CPU_POWERPC_e600
> #define CPU_POWERPC_MPC8641          CPU_POWERPC_e600
> #define CPU_POWERPC_MPC8641D         CPU_POWERPC_e600
> 
>      CPU_POWERPC_7448_v10           = 0x80040100,
>      CPU_POWERPC_7448_v11           = 0x80040101,
>      CPU_POWERPC_7448_v20           = 0x80040200,
>      CPU_POWERPC_7448_v21           = 0x80040201,
> 
> So by applying the mask, OpenBIOS is matching both 0x80040100 and
>   0x80040010 when it looks like it only wants to match the latter.

Hello,

a quick status on how QEMU has evolved regarding this topic.

We have merged :

   a09410ed1fb8 ("target/ppc: Remove the software TLB model of 7450 CPUs")

and switched MMU model to POWERPC_MMU_32B in :

   1da666cd8e79 ("target/ppc: Disable software TLB for the 7450 family")

With the two patches of this series, we can boot the latest linux on all
7450 CPUs. With an extra small fix on the CPU table, 7448 boots.

  
Thanks,

C.


  reply	other threads:[~2022-01-07  8:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 13:44 [RFC PATCH 0/2] QEMU/openbios: PPC Software TLB support in the G4 family Fabiano Rosas
2021-11-19 13:44 ` [RFC PATCH 1/2] ppc: Add support for MPC7450 software TLB miss interrupts Fabiano Rosas
2021-11-19 13:44 ` [RFC PATCH 2/2] ppc: Add PVRs for the MPC7450 family Fabiano Rosas
2021-11-24 22:00 ` [RFC PATCH 0/2] QEMU/openbios: PPC Software TLB support in the G4 family Fabiano Rosas
2021-11-25  0:45   ` BALATON Zoltan
2021-11-25  8:11     ` Cédric Le Goater
2021-11-25 14:03       ` BALATON Zoltan
2021-11-25 14:28         ` Cédric Le Goater
2021-11-25  9:38     ` [OpenBIOS] " Segher Boessenkool
2021-11-26  8:34       ` Cédric Le Goater
2021-11-26 10:37         ` Segher Boessenkool
2021-11-26 12:13           ` Fabiano Rosas
2021-11-26 12:45             ` Cédric Le Goater
2021-11-26 13:02               ` Fabiano Rosas
2021-11-26 12:43     ` Fabiano Rosas
2021-11-26 14:46       ` BALATON Zoltan
2021-11-26  8:01   ` Mark Cave-Ayland
2021-11-26  8:40     ` Cédric Le Goater
2021-11-26  8:56       ` Mark Cave-Ayland
2021-11-26 12:31         ` Fabiano Rosas
2021-11-26 13:53           ` Cédric Le Goater
2021-11-26 15:02             ` BALATON Zoltan
2021-11-29 15:28             ` Fabiano Rosas
2022-01-07  8:19               ` Cédric Le Goater [this message]
2022-01-07 13:19                 ` Fabiano Rosas
2022-01-07 13:51                   ` Cédric Le Goater
2022-01-07 23:19                     ` [OpenBIOS] " Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0dbc9805-e08b-2190-8c1b-2a9e4081c02e@kaod.org \
    --to=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=farosas@linux.ibm.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=openbios@openbios.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.