From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9CfH-00047c-G0 for qemu-devel@nongnu.org; Sun, 18 Mar 2012 05:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9CfF-0003id-Q9 for qemu-devel@nongnu.org; Sun, 18 Mar 2012 05:44:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9CfF-0003iN-Hi for qemu-devel@nongnu.org; Sun, 18 Mar 2012 05:44:37 -0400 Message-ID: <4F65AE7B.8010101@redhat.com> Date: Sun, 18 Mar 2012 11:44:27 +0200 From: Avi Kivity MIME-Version: 1.0 References: <4F6541FC.8080702@ilande.co.uk> In-Reply-To: <4F6541FC.8080702@ilande.co.uk> Content-Type: multipart/mixed; boundary="------------020701030807010300060206" Subject: Re: [Qemu-devel] SPARC64: immediate segfault on startup with git mastervery List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: Blue Swirl , qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------020701030807010300060206 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 03/18/2012 04:01 AM, Mark Cave-Ayland wrote: > Hi Avi/Blue, > > I've just updated to git master and found that SPARC64 is broken > again; a git bisect shows the following commit causes this: > > > commit f3705d53296d78b14f5823472ae2add16a25a0a5 > Author: Avi Kivity > Date: Thu Mar 8 16:16:34 2012 +0200 > > memory: make phys_page_find() return an unadjusted section > > We'd like to store the section index in the iotlb, so we can't > adjust it before returning. Return an unadjusted section and > instead introduce section_addr(), which does the adjustment later. > > Signed-off-by: Avi Kivity > > > The symptom is that qemu-system-sparc64 segfaults immediately on > startup (note this is with an OpenBIOS image built from SVN r1048). > I've included a couple of backtraces below: > Please try the attached patch. If it fails, can you upload bios and disk images somewhere? -- error compiling committee.c: too many arguments to function --------------020701030807010300060206 Content-Type: text/x-patch; name="0001-sparc64-trim-low-order-bits-from-TLB-entry-during-MM.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-sparc64-trim-low-order-bits-from-TLB-entry-during-MM.pa"; filename*1="tch" >>From d1429f0bef16eb850a4ccc879cdc2212b41da40c Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 18 Mar 2012 11:42:00 +0200 Subject: [PATCH] sparc64: trim low-order bits from TLB entry during MMU translation get_physical_address() returns a physical address with random low bits set, which confuses tlb_set_page(). Fix by masking the low-order bits. Signed-off-by: Avi Kivity --- target-sparc/mmu_helper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-sparc/mmu_helper.c b/target-sparc/mmu_helper.c index 11fb9f5..27f7b27 100644 --- a/target-sparc/mmu_helper.c +++ b/target-sparc/mmu_helper.c @@ -491,7 +491,7 @@ static int get_physical_address_data(CPUSPARCState *env, mmu_idx == MMU_USER_SECONDARY_IDX); if ((env->lsu & DMMU_E) == 0) { /* DMMU disabled */ - *physical = ultrasparc_truncate_physical(address); + *physical = ultrasparc_truncate_physical(address) & TARGET_PAGE_MASK; *prot = PAGE_READ | PAGE_WRITE; return 0; } @@ -610,7 +610,7 @@ static int get_physical_address_code(CPUSPARCState *env, if ((env->lsu & IMMU_E) == 0 || (env->pstate & PS_RED) != 0) { /* IMMU disabled */ - *physical = ultrasparc_truncate_physical(address); + *physical = ultrasparc_truncate_physical(address) & TARGET_PAGE_MASK; *prot = PAGE_EXEC; return 0; } -- 1.7.9 --------------020701030807010300060206--