Patchwork [v2,Qemu-ppc,1/1] PPC: e500: correct params->ram_size with ram_size

login
register
mail settings
Submitter Tiejun Chen
Date May 2, 2013, 1:22 a.m.
Message ID <1367457779-4062-1-git-send-email-tiejun.chen@windriver.com>
Download mbox | patch
Permalink /patch/240868/
State New
Headers show

Comments

Tiejun Chen - May 2, 2013, 1:22 a.m.
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>
---
v2: 

eliminate that original comment in v1.

 hw/ppc/e500.c |    1 +
 1 file changed, 1 insertion(+)
Alexander Graf - May 2, 2013, 11:17 a.m.
On 02.05.2013, at 03:22, Tiejun Chen wrote:

> 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>

Thanks, applied to ppc-next.

Alex

> ---
> v2: 
> 
> eliminate that original comment in v1.
> 
> hw/ppc/e500.c |    1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index c1bdb6b..3978f84 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -523,6 +523,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);
> -- 
> 1.7.9.5
>

Patch

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index c1bdb6b..3978f84 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -523,6 +523,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);