From: David Gibson <david@gibson.dropbear.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "Cédric Le Goater" <clg@kaod.org>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
qemu-ppc@nongnu.org, "Greg Kurz" <groug@kaod.org>,
qemu-devel@nongnu.org
Subject: Re: [PATCH qemu] spapr: Force 32bit when resetting a core
Date: Mon, 10 Jan 2022 14:10:20 +1100 [thread overview]
Message-ID: <YdujnLX5eXaKmHtf@yekko> (raw)
In-Reply-To: <4bad4da5-44b6-717c-7770-609ddd5256f0@ozlabs.ru>
[-- Attachment #1: Type: text/plain, Size: 2567 bytes --]
On Mon, Jan 10, 2022 at 01:52:06PM +1100, Alexey Kardashevskiy wrote:
>
>
> On 08/01/2022 00:39, Greg Kurz wrote:
> > On Fri, 7 Jan 2022 23:19:03 +1100
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >
> > > On Fri, Jan 07, 2022 at 12:57:47PM +0100, Greg Kurz wrote:
> > > > On Fri, 7 Jan 2022 18:24:23 +1100
> > > > Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> > > >
> > > > > "PowerPC Processor binding to IEEE 1275" says in
> > > > > "8.2.1. Initial Register Values" that the initial state is defined as
> > > > > 32bit so do it for both SLOF and VOF.
> > > > >
> > > > > This should not cause behavioral change as SLOF switches to 64bit very
> > > > > early anyway.
> > > >
> > > > Only one CPU goes through SLOF. What about the other ones, including
> > > > hot plugged CPUs ?
> > >
> > > Those will be started by the start-cpu RTAS call which has its own
> > > semantics.
> > >
> >
> > Ah indeed, there's code in linux/arch/powerpc/kernel/head_64.S to switch
> > secondaries to 64bit... but then, as noted by Cedric, ppc_cpu_reset(),
> > which is called earlier sets MSR_SF but the changelog of commit 8b9f2118ca40
> > doesn't provide much details on the motivation. Any idea ?
>
> https://patchwork.kernel.org/project/qemu-devel/patch/1458121432-2855-1-git-send-email-lvivier@redhat.com/
>
> this is probably it:
>
> ===
> Reset is properly defined as an exception (0x100). For exceptions, the
> 970MP user manual for example says:
>
> 4.5 Exception Definitions
> When an exception/interrupt is taken, all bits in the MSR are set to
> ‘0’, with the following exceptions:
> • Exceptions always set MSR[SF] to ‘1’.
> ===
>
> but it looks like the above is about emulation bare metal 970 rather than
> pseries VCPU so that quote does not apply to spapr.
PAPR is rather confusing on the topic (looking at PAPR+ 2.10).
Initially it says:
"When a processor thread exits the RTAS stopped state, it must begin
execution in real mode, with the MSR in the same state as from a
system reset interrupt (except for the MSRHV bit which is on if not
running under a hypervisor and off if running under a hypervisor)"
But further down it has a table of how all the MSR bits are supposed
to be set by start-cpu, and it looks like that might not match the
0x100 conditions in some cases.
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-01-10 3:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-07 7:24 [PATCH qemu] spapr: Force 32bit when resetting a core Alexey Kardashevskiy
2022-01-07 7:45 ` Cédric Le Goater
2022-01-07 11:57 ` Greg Kurz
2022-01-07 12:19 ` David Gibson
2022-01-07 13:39 ` Greg Kurz
2022-01-10 2:52 ` Alexey Kardashevskiy
2022-01-10 3:10 ` David Gibson [this message]
2022-01-14 14:12 ` Cédric Le Goater
2022-01-15 14:21 ` Mark Cave-Ayland
2022-01-17 14:52 ` Cédric Le Goater
2022-01-18 8:30 ` Mark Cave-Ayland
2022-01-18 9:12 ` Cédric Le Goater
2022-01-19 15:10 ` Frédéric Bonnard
2022-01-15 21:48 ` BALATON Zoltan
2022-01-14 13:51 ` Cédric Le Goater
2022-01-16 16:45 ` Peter Maydell
2022-01-19 4:03 ` Alexey Kardashevskiy
2022-01-19 10:16 ` Peter Maydell
2022-01-19 11:05 ` Cédric Le Goater
2022-01-25 10:38 ` Cédric Le Goater
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=YdujnLX5eXaKmHtf@yekko \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=groug@kaod.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.