[PATCH v2 4/5] hw/loongarch: Set minimium memory size as 256M

Bibo Mao posted 5 patches 9 months ago
Maintainers: Song Gao <gaosong@loongson.cn>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
[PATCH v2 4/5] hw/loongarch: Set minimium memory size as 256M
Posted by Bibo Mao 9 months ago
The minimum memory size for LoongArch UEFI bios is 256M, also some
test cases such as migration and qos use 256M memory by default.

Here set minimum memory size for Loongarch VirtMachine with 256M rather
than 1G, so that test cases with 256M memory can pass to run.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 hw/loongarch/virt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index f37f642ede..1dadb8e299 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -864,8 +864,8 @@ static void virt_init(MachineState *machine)
         cpu_model = LOONGARCH_CPU_TYPE_NAME("la464");
     }
 
-    if (ram_size < 1 * GiB) {
-        error_report("ram_size must be greater than 1G.");
+    if (ram_size < 256 * MiB) {
+        error_report("ram_size must be greater than 256M.");
         exit(1);
     }
     create_fdt(vms);
-- 
2.39.3
Re: [PATCH v2 4/5] hw/loongarch: Set minimium memory size as 256M
Posted by gaosong 8 months, 3 weeks ago

在 2024/2/27 10:30, Bibo Mao 写道:
> The minimum memory size for LoongArch UEFI bios is 256M, also some
> test cases such as migration and qos use 256M memory by default.
> 
> Here set minimum memory size for Loongarch VirtMachine with 256M rather
> than 1G, so that test cases with 256M memory can pass to run.
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>   hw/loongarch/virt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
Reviewed-by: Song Gao <gaosong@loongson.cn>

Thanks.
Song Gao
> diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
> index f37f642ede..1dadb8e299 100644
> --- a/hw/loongarch/virt.c
> +++ b/hw/loongarch/virt.c
> @@ -864,8 +864,8 @@ static void virt_init(MachineState *machine)
>           cpu_model = LOONGARCH_CPU_TYPE_NAME("la464");
>       }
>   
> -    if (ram_size < 1 * GiB) {
> -        error_report("ram_size must be greater than 1G.");
> +    if (ram_size < 256 * MiB) {
> +        error_report("ram_size must be greater than 256M.");
>           exit(1);
>       }
>       create_fdt(vms);
>