From patchwork Sun Mar 18 09:51:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 147367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CE1A7B6FAA for ; Sun, 18 Mar 2012 20:52:19 +1100 (EST) Received: from localhost ([::1]:46343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9Cmd-0006Mp-AT for incoming@patchwork.ozlabs.org; Sun, 18 Mar 2012 05:52:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9CmW-0006MD-CX for qemu-devel@nongnu.org; Sun, 18 Mar 2012 05:52:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9CmT-0004lJ-JV for qemu-devel@nongnu.org; Sun, 18 Mar 2012 05:52:07 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:50678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9CmT-0004l7-Bq for qemu-devel@nongnu.org; Sun, 18 Mar 2012 05:52:05 -0400 Received: by iafj26 with SMTP id j26so8984390iaf.4 for ; Sun, 18 Mar 2012 02:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=w/iWi4vvBiT0WfIIVeETfGg0WMCSFx7JkVMD65TTHEM=; b=b4gDfiwTwepnsVcLJjUov/GBStdv3ZUaAmW+0SpRiSUT+otpYBvcxf+4rqfcyicRWd jLHsa6qXFhXbRefKkr+gubNY1k+4ZTnkTbgaHrQasrIgJz9tfKvjVwjAZ/kK3jRuhxvu AZWiqkuE7f5X1T3AJ9KCE8eTLW7+rFO7KvjFvZnOwYmaSRSNtdTlObfethNVxJhUvFn8 9bQ6IBqe43CGtujy4yU288PULt/0W1rslZs1aVMVXpi1X9UTFnLvP7Nsf7/9NEDb6xEN EI1piRW8jgdUTPHZ6wR4PFySwXPIuwY7ZAoXbaWOnityM4ySTn24KwJWxoIHdMJYmerg tQBg== Received: by 10.42.152.3 with SMTP id g3mr4698716icw.10.1332064323283; Sun, 18 Mar 2012 02:52:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.75.41 with HTTP; Sun, 18 Mar 2012 02:51:43 -0700 (PDT) In-Reply-To: <4F65AE7B.8010101@redhat.com> References: <4F6541FC.8080702@ilande.co.uk> <4F65AE7B.8010101@redhat.com> From: Blue Swirl Date: Sun, 18 Mar 2012 09:51:43 +0000 Message-ID: To: Avi Kivity X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.173 Cc: Mark Cave-Ayland , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] SPARC64: immediate segfault on startup with git mastervery X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Sun, Mar 18, 2012 at 09:44, Avi Kivity wrote: > 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. I tried this approach instead, seems to work (except Sparc32, Sparc64 and PPC displays are still not refreshed correctly). The problem is that f3705d53296d78b14f5823472ae2add16a25a0a5 converted addr & mask + section.offset to section_addr(), but in some cases the offset within page was not wanted. #endif @@ -2205,14 +2205,14 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr, } if (is_ram_rom_romd(section)) { addend = (unsigned long)memory_region_get_ram_ptr(section->mr) - + section_addr(section, paddr); + + section_addr(section, paddr & TARGET_PAGE_MASK); } else { addend = 0; } if (is_ram_rom(section)) { /* Normal RAM. */ - iotlb = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK) - + section_addr(section, paddr); + iotlb = (memory_region_get_ram_addr(section->mr) + + section_addr(section, paddr)) & TARGET_PAGE_MASK; if (!section->readonly) iotlb |= phys_section_notdirty; else @@ -2225,7 +2225,7 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr, We can't use the high bits of pd for this because IO_MEM_ROMD uses these as a ram address. */ iotlb = section - phys_sections; - iotlb += section_addr(section, paddr); + iotlb += section_addr(section, paddr & TARGET_PAGE_MASK); } code_address = address; @@ -2265,7 +2265,7 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr, } else if (memory_region_is_ram(section->mr) && !cpu_physical_memory_is_dirty( section->mr->ram_addr - + section_addr(section, paddr))) { + + section_addr(section, paddr & TARGET_PAGE_MASK))) { te->addr_write = address | TLB_NOTDIRTY; } else { te->addr_write = address; > If it fails, can you upload bios and disk images somewhere? > > -- > error compiling committee.c: too many arguments to function > diff --git a/exec.c b/exec.c index 8fd50a1..ad455be 100644 --- a/exec.c +++ b/exec.c @@ -1474,8 +1474,8 @@ static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) || (section->mr->rom_device && section->mr->readable))) { return; } - ram_addr = (memory_region_get_ram_addr(section->mr) & TARGET_PAGE_MASK) - + section_addr(section, addr); + ram_addr = (memory_region_get_ram_addr(section->mr) + + section_addr(section, pc)) & TARGET_PAGE_MASK; tb_invalidate_phys_page_range(ram_addr, ram_addr + 1, 0); }