* [dora][PATCH] Qemu:Arm:versatilepb: Add memory size checking
@ 2013-11-21 19:35 Mark Hatle
2013-11-21 19:38 ` Saul Wold
0 siblings, 1 reply; 2+ messages in thread
From: Mark Hatle @ 2013-11-21 19:35 UTC (permalink / raw)
To: openembedded-core
From: Jiang Lu <lu.jiang@windriver.com>
The machine can not work with memory over 256M, so add a checking
at startup. If the memory size exceed 256M, just stop emulation then
throw out warning about memory limitation.
Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
---
...-Arm-versatilepb-Add-memory-size-checking.patch | 34 ++++++++++++++++++++++
meta/recipes-devtools/qemu/qemu_1.5.0.bb | 1 +
2 files changed, 35 insertions(+)
create mode 100644 meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
diff --git a/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch b/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
new file mode 100644
index 0000000..ef1090b
--- /dev/null
+++ b/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
@@ -0,0 +1,34 @@
+From 896fa02c24347e6e9259812cfda187b1d6ca6199 Mon Sep 17 00:00:00 2001
+From: Jiang Lu <lu.jiang@windriver.com>
+Date: Wed, 13 Nov 2013 10:38:08 +0800
+Subject: [PATCH] Qemu:Arm:versatilepb: Add memory size checking
+
+The machine can not work with memory over 256M, so add a checking
+at startup. If the memory size exceed 256M, just stop emulation then
+throw out warning about memory limitation.
+
+Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
+---
+ hw/arm/versatilepb.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
+index 753757e..0906377 100644
+--- a/hw/arm/versatilepb.c
++++ b/hw/arm/versatilepb.c
+@@ -193,6 +193,12 @@ static void versatile_init(QEMUMachineInitArgs *args, int board_id)
+ fprintf(stderr, "Unable to find CPU definition\n");
+ exit(1);
+ }
++ if (ram_size > (256 << 20)) {
++ fprintf(stderr,
++ "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
++ ((unsigned int)ram_size / (1 << 20)));
++ exit(1);
++ }
+ memory_region_init_ram(ram, "versatile.ram", args->ram_size);
+ vmstate_register_ram_global(ram);
+ /* ??? RAM should repeat to fill physical memory space. */
+--
+1.7.1
+
diff --git a/meta/recipes-devtools/qemu/qemu_1.5.0.bb b/meta/recipes-devtools/qemu/qemu_1.5.0.bb
index 06c2cdb..f8c60e8 100644
--- a/meta/recipes-devtools/qemu/qemu_1.5.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_1.5.0.bb
@@ -7,6 +7,7 @@ SRC_URI += "file://fdt_header.patch \
file://target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch \
file://target-ppc_fix_bit_extraction.patch \
file://fxrstorssefix.patch \
+ file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
"
SRC_URI_prepend = "http://wiki.qemu.org/download/qemu-${PV}.tar.bz2"
--
1.8.1.2.545.g2f19ada
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [dora][PATCH] Qemu:Arm:versatilepb: Add memory size checking
2013-11-21 19:35 [dora][PATCH] Qemu:Arm:versatilepb: Add memory size checking Mark Hatle
@ 2013-11-21 19:38 ` Saul Wold
0 siblings, 0 replies; 2+ messages in thread
From: Saul Wold @ 2013-11-21 19:38 UTC (permalink / raw)
To: Mark Hatle, openembedded-core
On 11/21/2013 11:35 AM, Mark Hatle wrote:
> From: Jiang Lu <lu.jiang@windriver.com>
>
> The machine can not work with memory over 256M, so add a checking
> at startup. If the memory size exceed 256M, just stop emulation then
> throw out warning about memory limitation.
>
> Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
> ---
> ...-Arm-versatilepb-Add-memory-size-checking.patch | 34 ++++++++++++++++++++++
> meta/recipes-devtools/qemu/qemu_1.5.0.bb | 1 +
> 2 files changed, 35 insertions(+)
> create mode 100644 meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
>
> diff --git a/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch b/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
> new file mode 100644
> index 0000000..ef1090b
> --- /dev/null
> +++ b/meta/recipes-devtools/qemu/files/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
> @@ -0,0 +1,34 @@
> +From 896fa02c24347e6e9259812cfda187b1d6ca6199 Mon Sep 17 00:00:00 2001
> +From: Jiang Lu <lu.jiang@windriver.com>
> +Date: Wed, 13 Nov 2013 10:38:08 +0800
> +Subject: [PATCH] Qemu:Arm:versatilepb: Add memory size checking
> +
> +The machine can not work with memory over 256M, so add a checking
> +at startup. If the memory size exceed 256M, just stop emulation then
> +throw out warning about memory limitation.
> +
No Upstream-Status: tag
Sau!
> +Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
> +---
> + hw/arm/versatilepb.c | 6 ++++++
> + 1 files changed, 6 insertions(+), 0 deletions(-)
> +
> +diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
> +index 753757e..0906377 100644
> +--- a/hw/arm/versatilepb.c
> ++++ b/hw/arm/versatilepb.c
> +@@ -193,6 +193,12 @@ static void versatile_init(QEMUMachineInitArgs *args, int board_id)
> + fprintf(stderr, "Unable to find CPU definition\n");
> + exit(1);
> + }
> ++ if (ram_size > (256 << 20)) {
> ++ fprintf(stderr,
> ++ "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
> ++ ((unsigned int)ram_size / (1 << 20)));
> ++ exit(1);
> ++ }
> + memory_region_init_ram(ram, "versatile.ram", args->ram_size);
> + vmstate_register_ram_global(ram);
> + /* ??? RAM should repeat to fill physical memory space. */
> +--
> +1.7.1
> +
> diff --git a/meta/recipes-devtools/qemu/qemu_1.5.0.bb b/meta/recipes-devtools/qemu/qemu_1.5.0.bb
> index 06c2cdb..f8c60e8 100644
> --- a/meta/recipes-devtools/qemu/qemu_1.5.0.bb
> +++ b/meta/recipes-devtools/qemu/qemu_1.5.0.bb
> @@ -7,6 +7,7 @@ SRC_URI += "file://fdt_header.patch \
> file://target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch \
> file://target-ppc_fix_bit_extraction.patch \
> file://fxrstorssefix.patch \
> + file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
> "
>
> SRC_URI_prepend = "http://wiki.qemu.org/download/qemu-${PV}.tar.bz2"
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-21 19:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21 19:35 [dora][PATCH] Qemu:Arm:versatilepb: Add memory size checking Mark Hatle
2013-11-21 19:38 ` Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox