Patchwork [8/9] PPC: e500: correct params->ram_size with ram_size

login
register
mail settings
Submitter Alexander Graf
Date May 6, 2013, 3:25 p.m.
Message ID <1367853917-2015-9-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/241704/
State New
Headers show

Comments

Alexander Graf - May 6, 2013, 3:25 p.m.
From: Tiejun Chen <tiejun.chen@windriver.com>

We should sync params->ram_size after we fixup memory size on
a alignment boundary. Otherwise Guest would exceed the actual
memory region.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc/e500.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 2d474e5..c9ae512 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -547,6 +547,7 @@  void ppce500_init(PPCE500Params *params)
 
     /* Fixup Memory size on a alignment boundary */
     ram_size &= ~(RAM_SIZES_ALIGN - 1);
+    params->ram_size = ram_size;
 
     /* Register Memory */
     memory_region_init_ram(ram, "mpc8544ds.ram", ram_size);