From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxyLc-0000Ig-2P for qemu-devel@nongnu.org; Mon, 29 Aug 2011 05:41:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QxyLb-0006Dc-7E for qemu-devel@nongnu.org; Mon, 29 Aug 2011 05:41:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QxyLa-0006DS-UZ for qemu-devel@nongnu.org; Mon, 29 Aug 2011 05:41:39 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7T9fcdn018865 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Aug 2011 05:41:38 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7T90AO1031005 for ; Mon, 29 Aug 2011 05:00:11 -0400 From: Avi Kivity Date: Mon, 29 Aug 2011 12:00:08 +0300 Message-Id: <1314608408-23079-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH] memory: fix rom_device I/O mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org When adding a rom_device in I/O mode, we incorrectly masked off the low bits, resulting in a pure RAM map. Fix my masking off the high bits and IO_MEM_ROMD, yielding a pure I/O map. Signed-off-by: Avi Kivity --- memory.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/memory.c b/memory.c index 1491a39..eb31fa8 100644 --- a/memory.c +++ b/memory.c @@ -304,7 +304,7 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr) } if (!fr->readable) { - phys_offset &= TARGET_PAGE_MASK; + phys_offset &= ~TARGET_PAGE_MASK & ~IO_MEM_ROMD; } cpu_register_physical_memory_log(fr->addr.start, -- 1.7.6.1