From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EYsl5-0005oZ-43 for qemu-devel@nongnu.org; Sun, 06 Nov 2005 17:13:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EYsl3-0005mS-2p for qemu-devel@nongnu.org; Sun, 06 Nov 2005 17:13:02 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EYsl2-0005mN-W1 for qemu-devel@nongnu.org; Sun, 06 Nov 2005 17:13:01 -0500 Received: from [65.74.133.11] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EYsl2-0002OA-SO for qemu-devel@nongnu.org; Sun, 06 Nov 2005 17:13:01 -0500 From: Paul Brook Date: Sun, 6 Nov 2005 22:12:54 +0000 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_o/nbDaiX0QOozjG" Message-Id: <200511062212.56104.paul@codesourcery.com> Subject: [Qemu-devel] [patch] Incorrect mask in softmmu_template.h Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --Boundary-00=_o/nbDaiX0QOozjG Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline softmmu_template.h contains hardcoded 0xfff masks. These should be ~TARGET_PAGE_MASK. The attached patch fixed this. Paul --Boundary-00=_o/nbDaiX0QOozjG Content-Type: text/x-diff; charset="us-ascii"; name="patch.qemu_softmmu_mask" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.qemu_softmmu_mask" Index: softmmu_template.h =================================================================== RCS file: /cvsroot/qemu/qemu/softmmu_template.h,v retrieving revision 1.12 diff -u -p -r1.12 softmmu_template.h --- softmmu_template.h 24 Jul 2005 12:55:09 -0000 1.12 +++ softmmu_template.h 6 Nov 2005 22:08:51 -0000 @@ -91,7 +91,7 @@ DATA_TYPE REGPARM(1) glue(glue(__ld, SUF if ((addr & (DATA_SIZE - 1)) != 0) goto do_unaligned_access; res = glue(io_read, SUFFIX)(physaddr, tlb_addr); - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { /* slow unaligned access (it spans two pages or IO) */ do_unaligned_access: retaddr = GETPC(); @@ -130,7 +130,7 @@ static DATA_TYPE glue(glue(slow_ld, SUFF if ((addr & (DATA_SIZE - 1)) != 0) goto do_unaligned_access; res = glue(io_read, SUFFIX)(physaddr, tlb_addr); - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { do_unaligned_access: /* slow unaligned access (it spans two pages) */ addr1 = addr & ~(DATA_SIZE - 1); @@ -208,7 +208,7 @@ void REGPARM(2) glue(glue(__st, SUFFIX), goto do_unaligned_access; retaddr = GETPC(); glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr); - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { do_unaligned_access: retaddr = GETPC(); glue(glue(slow_st, SUFFIX), MMUSUFFIX)(addr, val, @@ -245,7 +245,7 @@ static void glue(glue(slow_st, SUFFIX), if ((addr & (DATA_SIZE - 1)) != 0) goto do_unaligned_access; glue(io_write, SUFFIX)(physaddr, val, tlb_addr, retaddr); - } else if (((addr & 0xfff) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { + } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { do_unaligned_access: /* XXX: not efficient, but simple */ for(i = 0;i < DATA_SIZE; i++) { --Boundary-00=_o/nbDaiX0QOozjG--