From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxEgF-0002z1-CE for qemu-devel@nongnu.org; Tue, 14 Feb 2012 04:28:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxEgA-0003VD-Jf for qemu-devel@nongnu.org; Tue, 14 Feb 2012 04:28:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxEgA-0003Ua-CA for qemu-devel@nongnu.org; Tue, 14 Feb 2012 04:28:06 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1E9S5cJ002940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Feb 2012 04:28:05 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1E9S3dw012955 for ; Tue, 14 Feb 2012 04:28:05 -0500 From: Avi Kivity Date: Tue, 14 Feb 2012 11:27:40 +0200 Message-Id: <1329211670-11548-11-git-send-email-avi@redhat.com> In-Reply-To: <1329211670-11548-1-git-send-email-avi@redhat.com> References: <1329211670-11548-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 10/20] memory: fix RAM subpages in newly initialized pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org If the first subpage installed in a page is RAM, then we install it as a full page, instead of a subpage. Fix by not special casing RAM. The issue dates to commit db7b5426a4b4242, which introduced subpages. Signed-off-by: Avi Kivity --- exec.c | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/exec.c b/exec.c index 0756919..5d0afdb 100644 --- a/exec.c +++ b/exec.c @@ -2660,22 +2660,20 @@ void cpu_register_physical_memory_log(MemoryRegionSection *section, *p = section_index; } } else { - MemoryRegion *mr = section->mr; + target_phys_addr_t start_addr2, end_addr2; + int need_subpage = 0; + p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1); *p = section_index; - if (!(memory_region_is_ram(mr) || mr->rom_device)) { - target_phys_addr_t start_addr2, end_addr2; - int need_subpage = 0; - CHECK_SUBPAGE(addr, start_addr, start_addr2, end_addr, - end_addr2, need_subpage); + CHECK_SUBPAGE(addr, start_addr, start_addr2, end_addr, + end_addr2, need_subpage); - if (need_subpage) { - subpage = subpage_init((addr & TARGET_PAGE_MASK), - p, phys_section_unassigned); - subpage_register(subpage, start_addr2, end_addr2, - section_index); - } + if (need_subpage) { + subpage = subpage_init((addr & TARGET_PAGE_MASK), + p, phys_section_unassigned); + subpage_register(subpage, start_addr2, end_addr2, + section_index); } } addr += TARGET_PAGE_SIZE; -- 1.7.9