All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log
@ 2020-03-16  1:18 Alexey Kardashevskiy
  2020-03-16  2:22 ` David Gibson
  2020-03-16 16:10 ` Greg Kurz
  0 siblings, 2 replies; 4+ messages in thread
From: Alexey Kardashevskiy @ 2020-03-16  1:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, qemu-ppc, Nicholas Piggin, David Gibson

At the moment SLOF reserves space for RTAS and instantiates the RTAS blob
which is 20 bytes binary blob calling an hypercall. The rest of the RTAS
area is a log which SLOF has no idea about but QEMU does.

This moves RTAS sizing to QEMU and this overrides the size from SLOF.
The only remaining problem is that SLOF copies the number of bytes it
reserved (2KB for now) so QEMU needs to reserve at least this much;
SLOF will be fixed separately to check that rtas-size from QEMU is
enough for those 20 bytes the H_RTAS hcall.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 include/hw/ppc/spapr.h | 1 +
 hw/ppc/spapr.c         | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 2015e37ac5c8..35b489a54929 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -736,6 +736,7 @@ void spapr_load_rtas(SpaprMachineState *spapr, void *fdt, hwaddr addr);
 #define SPAPR_IS_PCI_LIOBN(liobn)   (!!((liobn) & 0x80000000))
 #define SPAPR_PCI_DMA_WINDOW_NUM(liobn) ((liobn) & 0xff)
 
+#define RTAS_SIZE               2048
 #define RTAS_ERROR_LOG_MAX      2048
 
 /* Offset from rtas-base where error log is placed */
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 64bc8b83e91e..d3db3ec56e9c 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -967,6 +967,7 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
     _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
                      maxdomains, sizeof(maxdomains)));
 
+    _FDT(fdt_setprop_cell(fdt, rtas, "rtas-size", RTAS_SIZE));
     _FDT(fdt_setprop_cell(fdt, rtas, "rtas-error-log-max",
                           RTAS_ERROR_LOG_MAX));
     _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate",
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log
  2020-03-16  1:18 [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log Alexey Kardashevskiy
@ 2020-03-16  2:22 ` David Gibson
  2020-03-16 16:10 ` Greg Kurz
  1 sibling, 0 replies; 4+ messages in thread
From: David Gibson @ 2020-03-16  2:22 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-ppc, qemu-devel, Nicholas Piggin

[-- Attachment #1: Type: text/plain, Size: 2178 bytes --]

On Mon, Mar 16, 2020 at 12:18:41PM +1100, Alexey Kardashevskiy wrote:
> At the moment SLOF reserves space for RTAS and instantiates the RTAS blob
> which is 20 bytes binary blob calling an hypercall. The rest of the RTAS
> area is a log which SLOF has no idea about but QEMU does.
> 
> This moves RTAS sizing to QEMU and this overrides the size from SLOF.
> The only remaining problem is that SLOF copies the number of bytes it
> reserved (2KB for now) so QEMU needs to reserve at least this much;
> SLOF will be fixed separately to check that rtas-size from QEMU is
> enough for those 20 bytes the H_RTAS hcall.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Applied to ppc-for-5.0, thanks.

> ---
>  include/hw/ppc/spapr.h | 1 +
>  hw/ppc/spapr.c         | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> index 2015e37ac5c8..35b489a54929 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -736,6 +736,7 @@ void spapr_load_rtas(SpaprMachineState *spapr, void *fdt, hwaddr addr);
>  #define SPAPR_IS_PCI_LIOBN(liobn)   (!!((liobn) & 0x80000000))
>  #define SPAPR_PCI_DMA_WINDOW_NUM(liobn) ((liobn) & 0xff)
>  
> +#define RTAS_SIZE               2048
>  #define RTAS_ERROR_LOG_MAX      2048
>  
>  /* Offset from rtas-base where error log is placed */
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 64bc8b83e91e..d3db3ec56e9c 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -967,6 +967,7 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
>      _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
>                       maxdomains, sizeof(maxdomains)));
>  
> +    _FDT(fdt_setprop_cell(fdt, rtas, "rtas-size", RTAS_SIZE));
>      _FDT(fdt_setprop_cell(fdt, rtas, "rtas-error-log-max",
>                            RTAS_ERROR_LOG_MAX));
>      _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate",

-- 
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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log
  2020-03-16  1:18 [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log Alexey Kardashevskiy
  2020-03-16  2:22 ` David Gibson
@ 2020-03-16 16:10 ` Greg Kurz
  2020-03-16 22:41   ` David Gibson
  1 sibling, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2020-03-16 16:10 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-ppc, qemu-devel, Nicholas Piggin, David Gibson

On Mon, 16 Mar 2020 12:18:41 +1100
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:

> At the moment SLOF reserves space for RTAS and instantiates the RTAS blob
> which is 20 bytes binary blob calling an hypercall. The rest of the RTAS
> area is a log which SLOF has no idea about but QEMU does.
> 
> This moves RTAS sizing to QEMU and this overrides the size from SLOF.
> The only remaining problem is that SLOF copies the number of bytes it
> reserved (2KB for now) so QEMU needs to reserve at least this much;
> SLOF will be fixed separately to check that rtas-size from QEMU is
> enough for those 20 bytes the H_RTAS hcall.

20 bytes >for< the H_RTAS hcall ?

Reviewed-by: Greg Kurz <groug@kaod.org>

> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  include/hw/ppc/spapr.h | 1 +
>  hw/ppc/spapr.c         | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> index 2015e37ac5c8..35b489a54929 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -736,6 +736,7 @@ void spapr_load_rtas(SpaprMachineState *spapr, void *fdt, hwaddr addr);
>  #define SPAPR_IS_PCI_LIOBN(liobn)   (!!((liobn) & 0x80000000))
>  #define SPAPR_PCI_DMA_WINDOW_NUM(liobn) ((liobn) & 0xff)
>  
> +#define RTAS_SIZE               2048
>  #define RTAS_ERROR_LOG_MAX      2048
>  
>  /* Offset from rtas-base where error log is placed */
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 64bc8b83e91e..d3db3ec56e9c 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -967,6 +967,7 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
>      _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
>                       maxdomains, sizeof(maxdomains)));
>  
> +    _FDT(fdt_setprop_cell(fdt, rtas, "rtas-size", RTAS_SIZE));
>      _FDT(fdt_setprop_cell(fdt, rtas, "rtas-error-log-max",
>                            RTAS_ERROR_LOG_MAX));
>      _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate",



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log
  2020-03-16 16:10 ` Greg Kurz
@ 2020-03-16 22:41   ` David Gibson
  0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2020-03-16 22:41 UTC (permalink / raw)
  To: Greg Kurz; +Cc: Alexey Kardashevskiy, qemu-ppc, qemu-devel, Nicholas Piggin

[-- Attachment #1: Type: text/plain, Size: 2429 bytes --]

On Mon, Mar 16, 2020 at 05:10:56PM +0100, Greg Kurz wrote:
> On Mon, 16 Mar 2020 12:18:41 +1100
> Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> 
> > At the moment SLOF reserves space for RTAS and instantiates the RTAS blob
> > which is 20 bytes binary blob calling an hypercall. The rest of the RTAS
> > area is a log which SLOF has no idea about but QEMU does.
> > 
> > This moves RTAS sizing to QEMU and this overrides the size from SLOF.
> > The only remaining problem is that SLOF copies the number of bytes it
> > reserved (2KB for now) so QEMU needs to reserve at least this much;
> > SLOF will be fixed separately to check that rtas-size from QEMU is
> > enough for those 20 bytes the H_RTAS hcall.
> 
> 20 bytes >for< the H_RTAS hcall ?

Adjusted in my tree, thanks.

> 
> Reviewed-by: Greg Kurz <groug@kaod.org>
> 
> > 
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> >  include/hw/ppc/spapr.h | 1 +
> >  hw/ppc/spapr.c         | 1 +
> >  2 files changed, 2 insertions(+)
> > 
> > diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> > index 2015e37ac5c8..35b489a54929 100644
> > --- a/include/hw/ppc/spapr.h
> > +++ b/include/hw/ppc/spapr.h
> > @@ -736,6 +736,7 @@ void spapr_load_rtas(SpaprMachineState *spapr, void *fdt, hwaddr addr);
> >  #define SPAPR_IS_PCI_LIOBN(liobn)   (!!((liobn) & 0x80000000))
> >  #define SPAPR_PCI_DMA_WINDOW_NUM(liobn) ((liobn) & 0xff)
> >  
> > +#define RTAS_SIZE               2048
> >  #define RTAS_ERROR_LOG_MAX      2048
> >  
> >  /* Offset from rtas-base where error log is placed */
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index 64bc8b83e91e..d3db3ec56e9c 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -967,6 +967,7 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
> >      _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
> >                       maxdomains, sizeof(maxdomains)));
> >  
> > +    _FDT(fdt_setprop_cell(fdt, rtas, "rtas-size", RTAS_SIZE));
> >      _FDT(fdt_setprop_cell(fdt, rtas, "rtas-error-log-max",
> >                            RTAS_ERROR_LOG_MAX));
> >      _FDT(fdt_setprop_cell(fdt, rtas, "rtas-event-scan-rate",
> 

-- 
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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-16 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16  1:18 [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log Alexey Kardashevskiy
2020-03-16  2:22 ` David Gibson
2020-03-16 16:10 ` Greg Kurz
2020-03-16 22:41   ` David Gibson

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.