|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH] phys_page_find_alloc: Use correct initial region_offset. |
Date: | Thu, 15 Dec 2011 12:11:04 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 |
On 12/13/2011 04:52 AM, address@hidden wrote:
From: Alex Rozenman<address@hidden> This fixes a common bug with initial region_offset value. Usually, the pages are re-assigned afterwards, so the bug has a very small effect on regular QEMU use flows. Signed-off-by: Alex Rozenman<address@hidden>
Applied. Thanks. Regards, Anthony Liguori
--- exec.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/exec.c b/exec.c index d8b2180..14628d9 100644 --- a/exec.c +++ b/exec.c @@ -418,6 +418,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; @@ -427,7 +428,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; } }
[Prev in Thread] | Current Thread | [Next in Thread] |