[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] hw/arm/sbsa-ref: bump default memory size to 2GB
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 1/1] hw/arm/sbsa-ref: bump default memory size to 2GB |
Date: |
Wed, 4 Dec 2024 21:50:56 +0100 |
User-agent: |
Mozilla Thunderbird |
On 4/12/24 13:17, Leif Lindholm wrote:
On 2024-12-02 10:53, Marcin Juszkiewicz wrote:
W dniu 26.11.2024 o 14:14, Peter Maydell pisze:
On Tue, 26 Nov 2024 at 08:49, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> 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.
Reasonable change, but isn't it also a bug in the RMM that it
grabs 1GB of RAM regardless of how much RAM the machine
actually has?
I think that the goal is "get it working" first and then optimize.
I agree on a different platform this could feel quite hacky, but in
reality even 2GB falls within "ridiculously low for an SBSA platform".
If we're worried about overhead for CI jobs that do not require the
feature, we could always conditionalize it on RME being enabled. But I'd
be happy to wait and see.
I'd rather do that, since it is as simple as:
-- >8 --
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);
---
$ ./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
$ ./qemu-system-aarch64 -M sbsa-ref -m 2G -cpu max,x-rme=on
// OK