From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbFlu-00065I-Iy for qemu-devel@nongnu.org; Thu, 15 Dec 2011 13:11:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbFlt-0007Au-C9 for qemu-devel@nongnu.org; Thu, 15 Dec 2011 13:11:10 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:49911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbFlt-0007Aq-2e for qemu-devel@nongnu.org; Thu, 15 Dec 2011 13:11:09 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Dec 2011 13:11:08 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBFIB5jq211690 for ; Thu, 15 Dec 2011 13:11:05 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBFIB5WM011885 for ; Thu, 15 Dec 2011 16:11:05 -0200 Message-ID: <4EEA3838.3080701@us.ibm.com> Date: Thu, 15 Dec 2011 12:11:04 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1323773528-30485-1-git-send-email-Alex_Rozenman@mentor.com> In-Reply-To: <1323773528-30485-1-git-send-email-Alex_Rozenman@mentor.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] phys_page_find_alloc: Use correct initial region_offset. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex_Rozenman@mentor.com Cc: qemu-devel@nongnu.org On 12/13/2011 04:52 AM, Alex_Rozenman@mentor.com wrote: > From: Alex Rozenman > > 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 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; > } > } >