diff mbox series

[v5,81/80] mips/mips_jazz: add max ram size check

Message ID 1581347177-88501-1-git-send-email-imammedo@redhat.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Igor Mammedov Feb. 10, 2020, 3:06 p.m. UTC
error out in case user asked for more RAM than board
supports.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
CC: philmd@redhat.com
CC: hpoussin@reactos.org
CC: aleksandar.rikalo@rt-rk.com
CC: aurelien@aurel32.net
CC: amarkovic@wavecomp.com


 hw/mips/mips_jazz.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Philippe Mathieu-Daudé Feb. 10, 2020, 5:04 p.m. UTC | #1
On 2/10/20 4:06 PM, Igor Mammedov wrote:
> error out in case user asked for more RAM than board
> supports.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> CC: philmd@redhat.com
> CC: hpoussin@reactos.org
> CC: aleksandar.rikalo@rt-rk.com
> CC: aurelien@aurel32.net
> CC: amarkovic@wavecomp.com
> 
> 
>   hw/mips/mips_jazz.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index 85d49cf..32fbd10 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -164,6 +164,11 @@ static void mips_jazz_init(MachineState *machine,
>       SysBusESPState *sysbus_esp;
>       ESPState *esp;
>   
> +    if (machine->ram_size > 256 * MiB) {
> +        error_report("RAM size more than 256Mb is not supported");
> +        exit(EXIT_FAILURE);
> +    }
> +
>       /* init CPUs */
>       cpu = MIPS_CPU(cpu_create(machine->cpu_type));
>       env = &cpu->env;
> 

Thanks :)

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
diff mbox series

Patch

diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 85d49cf..32fbd10 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -164,6 +164,11 @@  static void mips_jazz_init(MachineState *machine,
     SysBusESPState *sysbus_esp;
     ESPState *esp;
 
+    if (machine->ram_size > 256 * MiB) {
+        error_report("RAM size more than 256Mb is not supported");
+        exit(EXIT_FAILURE);
+    }
+
     /* init CPUs */
     cpu = MIPS_CPU(cpu_create(machine->cpu_type));
     env = &cpu->env;