From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5J0M-0008RB-4A for qemu-devel@nongnu.org; Wed, 07 Mar 2012 10:42:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5Izw-00013S-LS for qemu-devel@nongnu.org; Wed, 07 Mar 2012 10:42:17 -0500 Message-ID: <4F5781BD.8000505@suse.de> Date: Wed, 07 Mar 2012 16:41:49 +0100 From: Alexander Graf MIME-Version: 1.0 References: <4F524946.1050001@freebsd.org> <4F525DF5.2010403@suse.de> In-Reply-To: <4F525DF5.2010403@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] PPC: Fix large page support in TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: David Gibson , qemu-ppc , Nathan Whitehorn , QEMU Developers On 03/03/2012 07:07 PM, Andreas F=E4rber wrote: > Am 03.03.2012 17:39, schrieb 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. Instead of creating a fake PTE, >> just update the real address at the end. >> >> Signed-off-by: Nathan Whitehorn > cc'ing Alex and qemu-ppc. David? Could you please ack? Alex > /-F > >> --- >> target-ppc/helper.c | 11 +++++------ >> 1 files changed, 5 insertions(+), 6 deletions(-) >> >> diff --git a/target-ppc/helper.c b/target-ppc/helper.c >> index 928fbcf..0f5ad2e 100644 >> --- a/target-ppc/helper.c >> +++ b/target-ppc/helper.c >> @@ -597,12 +597,6 @@ static inline int _find_pte(CPUState *env, >> mmu_ctx_t *ctx, >> int is_64b, int h, >> pte1 =3D ldq_phys(env->htab_base + pteg_off + (i * 1= 6) + 8); >> } >> >> - /* We have a TLB that saves 4K pages, so let's >> - * split a huge page to 4k chunks */ >> - if (target_page_bits !=3D TARGET_PAGE_BITS) >> - pte1 |=3D (ctx->eaddr& (( 1<< target_page_bits ) - = 1)) >> -& TARGET_PAGE_MASK; >> - >> r =3D pte64_check(ctx, pte0, pte1, h, rw, type); >> LOG_MMU("Load pte from " TARGET_FMT_lx " =3D> " TARGET_= FMT_lx >> "" >> TARGET_FMT_lx " %d %d %d " TARGET_FMT_lx "\n", >> @@ -678,6 +672,11 @@ static inline int _find_pte(CPUState *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 !=3D TARGET_PAGE_BITS) >> + ctx->raddr |=3D (ctx->eaddr& (( 1<< target_page_bits ) - 1)) >> +& TARGET_PAGE_MASK; >> return ret; >> } >> >> --=20 >> 1.7.9