From patchwork Sat Oct 1 16:50:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin O'Connor X-Patchwork-Id: 117275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4271BB6F69 for ; Sun, 2 Oct 2011 03:51:01 +1100 (EST) Received: from localhost ([::1]:32839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RA2m9-0001JG-Fr for incoming@patchwork.ozlabs.org; Sat, 01 Oct 2011 12:50:57 -0400 Received: from eggs.gnu.org ([140.186.70.92]:32794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RA2m4-0001J9-Ae for qemu-devel@nongnu.org; Sat, 01 Oct 2011 12:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RA2lz-0002TB-Tr for qemu-devel@nongnu.org; Sat, 01 Oct 2011 12:50:52 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:37118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RA2lz-0002T4-RX for qemu-devel@nongnu.org; Sat, 01 Oct 2011 12:50:47 -0400 Received: by vws17 with SMTP id 17so2379261vws.4 for ; Sat, 01 Oct 2011 09:50:46 -0700 (PDT) Received: by 10.52.23.17 with SMTP id i17mr12739808vdf.353.1317487846563; Sat, 01 Oct 2011 09:50:46 -0700 (PDT) Received: from localhost (207-172-165-101.c3-0.avec-ubr1.nyr-avec.ny.cable.rcn.com. [207.172.165.101]) by mx.google.com with ESMTPS id bi11sm8336696vdb.13.2011.10.01.09.50.44 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 01 Oct 2011 09:50:45 -0700 (PDT) Date: Sat, 1 Oct 2011 12:50:43 -0400 From: Kevin O'Connor To: "Daniel P. Berrange" , "Richard W.M. Jones" Message-ID: <20111001165043.GA16833@morn.localdomain> References: <20110922114510.GA31504@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110922114510.GA31504@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.45 Cc: seabios@seabios.org, qemu-devel , Gerd Hoffmann Subject: Re: [Qemu-devel] Hang when using 9p mounts after last Seabios update 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 Thu, Sep 22, 2011 at 12:45:11PM +0100, Daniel P. Berrange wrote: > On 0.14, 0.15 releaes, this all works just fine. On current GIT master, > the guest OS will hang during boot. [...] > To reproduce this you will need my custom initrd for mounting 9p filesystems > as the root FS. You can get that here: > > http://berrange.com/~dan/qemu-serial-hang-demo.tar.gz Thanks for the detailed report. I've confirmed the issue and tracked it down. The current SeaBIOS code gets confused during alignment checking if there are no prefmem regions found. The patch below should fix the issue. Richard, can you also check to see if this seabios patch fixes your issue? -Kevin Author: Kevin O'Connor Date: Sat Oct 1 12:35:32 2011 -0400 Fix alignment bug in pci_bios_init_root_regions(). If there are no memory allocations for a given type then the "max" bar size is zero. However, ALIGN_DOWN does not handle an alignment of zero properly. Catch and handle the zero case. Signed-off-by: Kevin O'Connor diff --git a/src/pciinit.c b/src/pciinit.c index a857da0..0d8758e 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -536,7 +536,7 @@ static void pci_bios_init_bus_bases(struct pci_bus *bus) } } -#define ROOT_BASE(top, sum, align) ALIGN_DOWN((top)-(sum),(align)) +#define ROOT_BASE(top, sum, max) ALIGN_DOWN((top)-(sum),(max) ?: 1) static int pci_bios_init_root_regions(u32 start, u32 end) {