qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] use correct initial region_offset


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH] use correct initial region_offset
Date: Sun, 6 Mar 2011 18:48:45 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Jan 27, 2011 at 01:01:01PM +0200, Alex Rozenman wrote:
> Hi,
> 
> I found a bug in phys_page_find_alloc function causing initial region_offset
> field to be set to incorrect initial value.
> Usually, the pages are re-assigned afterwards, so the bug has very small
> effect on regular QEMU users.
> We use "memory unassigned" callback and this bug causes invalid addresses
> there.
> 
> A small patch is attached. I have ssh membership on savannah. Please approve
> and/or push.
> This is my first time when I am suggesting patches to QEMU; I also would
> like to add some fixes for
> ppc440/ppc440x6 cores.
> 
> -- 
> Best regards,
> Alex Rozenman (address@hidden).

> From 8935358ddf9bf5b80c8b8ac7014b650a519a3ebf Mon Sep 17 00:00:00 2001
> From: Alex Rozenman <address@hidden>
> Date: Thu, 27 Jan 2011 12:47:57 +0200
> Subject: [PATCH] phys_page_find_alloc: use correct initial region_offset
> 
> ---
>  exec.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index db9ff55..00667d7 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -416,6 +416,7 @@ static PhysPageDesc 
> *phys_page_find_alloc(target_phys_addr_t index, int alloc)
>      pd = *lp;
>      if (pd == NULL) {
>          int i;
> +        int first_index = index & ~(L2_SIZE - 1);
>  
>          if (!alloc) {
>              return NULL;
> @@ -425,7 +426,7 @@ static PhysPageDesc 
> *phys_page_find_alloc(target_phys_addr_t index, int alloc)
>  
>          for (i = 0; i < L2_SIZE; i++) {
>              pd[i].phys_offset = IO_MEM_UNASSIGNED;
> -            pd[i].region_offset = (index + i) << TARGET_PAGE_BITS;
> +            pd[i].region_offset = (first_index + i) << TARGET_PAGE_BITS;
>          }
>      }

The patch looks correct, but it is missing a Signed-off-by: entry. Also
please provide a description in the patch itself.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]