From: David Gibson <david@gibson.dropbear.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
Aravinda Prasad <aravinda@linux.vnet.ibm.com>,
benh@au1.ibm.com, mahesh@linux.vnet.ibm.com,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org, paulus@samba.org,
sam.bobroff@au1.ibm.com
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v5 1/6] ppc: spapr: Register and handle HCALL to receive updated RTAS region
Date: Wed, 4 Oct 2017 16:55:25 +1100 [thread overview]
Message-ID: <20171004055525.GT3260@umbus.fritz.box> (raw)
In-Reply-To: <8fa746ca-302f-b2bf-ee05-a4b0b4f2fcbb@ozlabs.ru>
[-- Attachment #1: Type: text/plain, Size: 4648 bytes --]
On Wed, Oct 04, 2017 at 02:32:11PM +1100, Alexey Kardashevskiy wrote:
> On 03/10/17 20:12, Alexey Kardashevskiy wrote:
> > On 03/10/17 17:07, David Gibson wrote:
> >> On Mon, Oct 02, 2017 at 02:02:19PM +1100, Alexey Kardashevskiy wrote:
> >>> On 29/09/17 21:52, Nikunj A Dadhania wrote:
> >>>> David Gibson <david@gibson.dropbear.id.au> writes:
> >>>>
> >>>>> On Thu, Sep 28, 2017 at 04:07:38PM +0530, Aravinda Prasad wrote:
> >>>>>> Receive updates from SLOF about the updated rtas-base.
> >>>>>> A separate patch for SLOF [1] (commit f9a60de3) adds
> >>>>>> functionality to invoke a private HCALL whenever OS
> >>>>>> issues instantiate-rtas with a new rtas-base.
> >>>>>>
> >>>>>> This is required as QEMU needs to know the updated rtas-base
> >>>>>> as it allocates error reporting structure in RTAS space upon
> >>>>>> a machine check exception.
> >>>>>>
> >>>>>> [1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-August/120386.html
> >>>>>>
> >>>>>> Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
> >>>>>> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> >>>>>
> >>>>> Ao I acked this earlier, but I've now realized there might be some
> >>>>> connection between this and discussions taking place elsewhere about
> >>>>> qemu not knowing what SLOF does with the device tree.
> >>>>>
> >>>>> At what point will SLOF call the UPDATE_RTAS hcall? I'm guessing at
> >>>>> the time of instantiate-rtas, is that right?
> >>>>
> >>>> The call happens from
> >>>> arch/powerpc/kernel/prom_init.c:prom_instantiate_rtas() and after that
> >>>> linux kernel makes two entries in the DT
> >>>>
> >>>> ....
> >>>> if (call_prom_ret("call-method", 3, 2, &entry,
> >>>> ADDR("instantiate-rtas"),
> >>>> rtas_inst, base) != 0
> >>>> || entry == 0) {
> >>>> prom_printf(" failed\n");
> >>>> return;
> >>>> }
> >>>> prom_printf(" done\n");
> >>>>
> >>>> reserve_mem(base, size);
> >>>>
> >>>> val = cpu_to_be32(base);
> >>>> prom_setprop(rtas_node, "/rtas", "linux,rtas-base",
> >>>> &val, sizeof(val));
> >>>> val = cpu_to_be32(entry);
> >>>> prom_setprop(rtas_node, "/rtas", "linux,rtas-entry",
> >>>> &val, sizeof(val));
> >>>> ....
> >>>>
> >>>> Quiesce is called after this.
> >>>>
> >>>>> Does SLOF put the RTAS blob address in its internal device tree, or
> >>>>> does it only pass it to the guest via the return parameters from
> >>>>> instantiate-rtas?
> >>>>
> >>>> Entry was made to the DT by linux kernel prom_init code, will this be
> >>>> visible to QEMU?
> >>>
> >>> With my recent SLOF FDT patch - yes:
> >>>
> >>> aik@fstn1-p1:~$ grep rtas dbg.dts
> >>> rtas {
> >>> linux,rtas-entry = <0x2fff0000>;
> >>> linux,rtas-base = <0x2fff0000>;
> >>> [...]
> >>
> >> Ah.. except.. isn't that relying on the kernel putting the RTAS
> >> address into the device tree before it calls quiesce and kills SLOF?
> >>
> >> The SLOF image is bundled in with qemu, so it's ok for us to rely on
> >> its behaviour up to a point. It's not really ok for us to rely on the
> >> kernel's behaviour here, unless that behaviour is mandated by PAPR,
> >> which this isn't.
> >
> > Fair point.
> >
> >> So, I think we either need to have *SLOF* update the device tree with
> >> that address at instantiate-rtas time,
> >
> > I can do that, in a separate patch.
>
>
> One comment though - if I create the properties in SLOF, I have to name
> them different, like rtas-entry/rtas-base or slof,rtas-entry/slof,rtas-base
> to avoid colliding with the ones create by the guest kernel.
That's fine. I don't know if the kernel will error if the properties
are already there or just overwrite them, but using new names might be
safer.
> So what do I name them? And do we need 2 copies of the same thing,
Need, no, but if having 2 copies is the simpler approach that's fine.
> do we
> ever expect rtas-entry!=rtas-base? The guest can potentially get them
> different (under powervm) but not with SLOF.
More to the point, qemu doesn't actually need to know the entry point
for the fwnmi stuff, only the base address.
>
>
> >
> >> or we'll need to resurrect
> >> Aravinda's original UPDATE_RTAS hcall.
>
>
>
--
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:[~2017-10-04 6:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 10:37 [Qemu-devel] [PATCH v5 0/6] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests Aravinda Prasad
2017-09-28 10:37 ` [Qemu-devel] [PATCH v5 1/6] ppc: spapr: Register and handle HCALL to receive updated RTAS region Aravinda Prasad
2017-09-29 6:17 ` David Gibson
2017-09-29 11:52 ` [Qemu-devel] [Qemu-ppc] " Nikunj A Dadhania
2017-10-02 3:02 ` Alexey Kardashevskiy
2017-10-03 6:07 ` David Gibson
2017-10-03 9:12 ` Alexey Kardashevskiy
2017-10-04 3:32 ` Alexey Kardashevskiy
2017-10-04 5:55 ` David Gibson [this message]
2017-10-03 5:56 ` [Qemu-devel] " Aravinda Prasad
2017-09-28 10:37 ` [Qemu-devel] [PATCH v5 2/6] ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls Aravinda Prasad
2017-09-29 6:49 ` David Gibson
2017-10-03 5:51 ` Aravinda Prasad
2017-10-03 6:09 ` David Gibson
2017-09-28 10:38 ` [Qemu-devel] [PATCH v5 3/6] Wrapper function to wait on condition for the main loop mutex Aravinda Prasad
2017-09-28 10:38 ` [Qemu-devel] [PATCH v5 4/6] target/ppc: Handle NMI guest exit Aravinda Prasad
2017-10-04 1:29 ` David Gibson
2017-10-08 8:59 ` Aravinda Prasad
2017-10-08 23:48 ` David Gibson
2017-09-28 10:38 ` [Qemu-devel] [PATCH v5 5/6] ppc: spapr: Enable FWNMI capability Aravinda Prasad
2017-10-04 1:34 ` David Gibson
2017-10-08 8:26 ` Aravinda Prasad
2017-10-08 23:43 ` David Gibson
2017-09-28 10:38 ` [Qemu-devel] [PATCH v5 6/6] migration: Block migration while handling machine check Aravinda Prasad
2017-10-04 1:39 ` David Gibson
2017-10-08 8:07 ` Aravinda Prasad
2017-09-28 10:53 ` [Qemu-devel] [PATCH v5 0/6] target-ppc/spapr: Add FWNMI support in QEMU for PowerKVM guests no-reply
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=20171004055525.GT3260@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=aravinda@linux.vnet.ibm.com \
--cc=benh@au1.ibm.com \
--cc=mahesh@linux.vnet.ibm.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sam.bobroff@au1.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).