Received: from eggs.gnu.org ([208.118.235.92]:41267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S89a2-0003eW-Jc for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S89Zd-0002QF-41 for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:14:54 -0400 From: Alexander Graf Date: Thu, 15 Mar 2012 13:14:16 +0100 Message-Id: <1331813662-15141-11-git-send-email-agraf@suse.de> In-Reply-To: <1331813662-15141-1-git-send-email-agraf@suse.de> References: <1331813662-15141-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 10/16] PPC: Fix large page support in TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel qemu-devel Cc: blauwirbel@gmail.com, qemu-ppc@nongnu.org, Nathan Whitehorn , aurelien@aurel32.net From: Nathan Whitehorn Fix large page support in TCG. The old code would overwrite the large page table entry with the fake 4 KB one generated here whenever the ref/change bits were updated, causing it to point to the wrong area of memory. Signed-off-by: Nathan Whitehorn Acked-by: David Gibson [agraf: fix whitespace, braces] Signed-off-by: Alexander Graf --- target-ppc/helper.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target-ppc/helper.c b/target-ppc/helper.c index bd711b6..39dcc27 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -591,12 +591,6 @@ static inline int _find_pte(CPUPPCState *env, mmu_ctx_t *ctx, int is_64b, int h, pte1 = ldq_phys(env->htab_base + pteg_off + (i * 16) + 8); } - /* We have a TLB that saves 4K pages, so let's - * split a huge page to 4k chunks */ - if (target_page_bits != TARGET_PAGE_BITS) - pte1 |= (ctx->eaddr & (( 1 << target_page_bits ) - 1)) - & TARGET_PAGE_MASK; - r = pte64_check(ctx, pte0, pte1, h, rw, type); LOG_MMU("Load pte from " TARGET_FMT_lx " => " TARGET_FMT_lx " " TARGET_FMT_lx " %d %d %d " TARGET_FMT_lx "\n", @@ -672,6 +666,12 @@ static inline int _find_pte(CPUPPCState *env, mmu_ctx_t *ctx, int is_64b, int h, } } + /* We have a TLB that saves 4K pages, so let's + * split a huge page to 4k chunks */ + if (target_page_bits != TARGET_PAGE_BITS) { + ctx->raddr |= (ctx->eaddr & ((1 << target_page_bits) - 1)) + & TARGET_PAGE_MASK; + } return ret; } -- 1.6.0.2