spapr/rtas: Reserve space for RTAS blob and log
PATCH 1/1 spapr/rtas: Reserve space for RTAS blob and log
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.
--- include/hw/ppc/spapr.h | 1 + hw/ppc/spapr.c | 1 + 2 files changed, 2 insertions(+)
include/hw/ppc/spapr.h +1 -0
@@ -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 */
hw/ppc/spapr.c +1 -0
@@ -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",
Signature · 1 line
2.17.1
David Gibson
AppliedQuoted 11 lines · Alexey Kardashevskiy
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_RTAShcall.Signed-off-by Alexey Kardashevskiy <[email protected]>
Applied to ppc-for-5.0, thanks.
Quoted 29 lines
--- include/hw/ppc/spapr.h | 1 + hw/ppc/spapr.c | 1 + 2 files changed, 2 insertions(+)include/hw/ppc/spapr.h +1
-0@@ -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 */ hw/ppc/spapr.c +1
-0@@ -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",
Signature · 4 lines
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
Quoted 9 lines · On Mon, 16 Mar 2020 12:18:41 +1100 Alexey Kardashevskiy <[email protected]> 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_RTAShcall.
20 bytes >for< the H_RTAS hcall ?
Quoted 31 lines
Signed-off-by Alexey Kardashevskiy <[email protected]>--- include/hw/ppc/spapr.h | 1 + hw/ppc/spapr.c | 1 + 2 files changed, 2 insertions(+)include/hw/ppc/spapr.h +1
-0@@ -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 */ hw/ppc/spapr.c +1
-0@@ -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",
Quoted 7 lines · Greg Kurz
Quoted 4 lines · On Mon, 16 Mar 2020 12:18:41 +1100 Alexey Kardashevskiy <[email protected]> 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.
Quoted 7 lines
Quoted 5 lines
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_RTAShcall.20 bytes >for< the
H_RTAShcall ?
Adjusted in my tree, thanks.
Quoted 35 lines
Reviewed-by Greg Kurz <[email protected]>Quoted 31 lines
Signed-off-by Alexey Kardashevskiy <[email protected]>--- include/hw/ppc/spapr.h | 1 + hw/ppc/spapr.c | 1 + 2 files changed, 2 insertions(+)include/hw/ppc/spapr.h +1
-0@@ -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 */ hw/ppc/spapr.c +1
-0@@ -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",
Signature · 4 lines
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