Message ID | 20241204205607.62592-1-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | [v2] hw/arm/sbsa-ref: Require at least 2 GiB of RAM when RME feature enabled | expand |
On 12/4/24 12:56, Philippe Mathieu-Daudé wrote: > We are working on adding RME support to SBSA Reference Platform. > When RME is enabled then RMM (Realm Managment Monitor) takes 1072MB of > memory for own use. Which ends with firmware panic on 1GB machine. > > Report an error so users directly start with more RAM in this case: > > $ qemu-system-aarch64 -M sbsa-ref -m 1G -cpu max,x-rme=on > qemu-system-aarch64: sbsa-ref: RME feature requires at least 2GB of RAM > > Reported-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> > Suggested-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > v1: https://lore.kernel.org/qemu-devel/20241126084928.252067-1-marcin.juszkiewicz@linaro.org/ > --- > hw/arm/sbsa-ref.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c > index e3195d54497..66751d0806c 100644 > --- a/hw/arm/sbsa-ref.c > +++ b/hw/arm/sbsa-ref.c > @@ -51,6 +51,7 @@ > #include "qapi/qmp/qlist.h" > #include "qom/object.h" > #include "target/arm/cpu-qom.h" > +#include "target/arm/cpu-features.h" > #include "target/arm/gtimer.h" > > #define RAMLIMIT_GB 8192 > @@ -795,6 +796,12 @@ static void sbsa_ref_init(MachineState *machine) > object_unref(cpuobj); > } > > + if (cpu_isar_feature(aa64_rme, ARM_CPU(qemu_get_cpu(0))) > + && machine->ram_size < 2 * GiB) { > + error_report("sbsa-ref: RME feature requires at least 2GB of RAM"); > + exit(1); > + } > + > memory_region_add_subregion(sysmem, sbsa_ref_memmap[SBSA_MEM].base, > machine->ram); > Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index e3195d54497..66751d0806c 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -51,6 +51,7 @@ #include "qapi/qmp/qlist.h" #include "qom/object.h" #include "target/arm/cpu-qom.h" +#include "target/arm/cpu-features.h" #include "target/arm/gtimer.h" #define RAMLIMIT_GB 8192 @@ -795,6 +796,12 @@ static void sbsa_ref_init(MachineState *machine) object_unref(cpuobj); } + if (cpu_isar_feature(aa64_rme, ARM_CPU(qemu_get_cpu(0))) + && machine->ram_size < 2 * GiB) { + error_report("sbsa-ref: RME feature requires at least 2GB of RAM"); + exit(1); + } + memory_region_add_subregion(sysmem, sbsa_ref_memmap[SBSA_MEM].base, machine->ram);
We are working on adding RME support to SBSA Reference Platform. When RME is enabled then RMM (Realm Managment Monitor) takes 1072MB of memory for own use. Which ends with firmware panic on 1GB machine. Report an error so users directly start with more RAM in this case: $ qemu-system-aarch64 -M sbsa-ref -m 1G -cpu max,x-rme=on qemu-system-aarch64: sbsa-ref: RME feature requires at least 2GB of RAM Reported-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Suggested-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- v1: https://lore.kernel.org/qemu-devel/20241126084928.252067-1-marcin.juszkiewicz@linaro.org/ --- hw/arm/sbsa-ref.c | 7 +++++++ 1 file changed, 7 insertions(+)