From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq4tz-00008y-V4 for qemu-devel@nongnu.org; Wed, 25 Jan 2012 10:36:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rq4tq-00078r-B9 for qemu-devel@nongnu.org; Wed, 25 Jan 2012 10:36:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq4tq-00078Z-1R for qemu-devel@nongnu.org; Wed, 25 Jan 2012 10:36:38 -0500 Date: Wed, 25 Jan 2012 17:38:05 +0200 From: "Michael S. Tsirkin" Message-ID: <20120125153415.GA10267@redhat.com> References: <4F1F971B.4020309@endace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F1F971B.4020309@endace.com> Subject: Re: [Qemu-devel] [RFC/PATCH] Fix guest OS panic when 64bit BAR is present List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Korolev Cc: sfd@endace.com, Kevin O'Connor , "qemu-devel@nongnu.org" On Wed, Jan 25, 2012 at 06:46:03PM +1300, Alexey Korolev wrote: > Hi, > In this post > http://lists.gnu.org/archive/html/qemu-devel/2011-12/msg03171.html I've > mentioned about the issues when 64Bit PCI BAR is present and 32bit > address range is selected for it. > The issue affects all recent qemu releases and all > old and recent guest Linux kernel versions. > For testing, I applied the following patch to qemu, converting msix bar to 64 bit. Guest did not seem to crash. I booted Fedora Live CD 32 bit guest on a 32 bit host to level 3 without crash, and verified that the BAR is a 64 bit one, and that I got assigned an address at fe000000. command line I used: qemu-system-x86_64 -bios /scm/seabios/out/bios.bin -snapshot -drive file=qemu-images/f15-test.qcow2,if=none,id=diskid,cache=unsafe -device virtio-blk-pci,drive=diskid -net user -net nic,model=ne2k_pci -cdrom Fedora-15-i686-Live-LXDE.iso At boot prompt type tab and add '3' to kernel command line to have guest boot into a fast text console instead of a graphical one which is very slow. diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 2ac87ea..5271394 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -711,7 +711,8 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev) memory_region_init(&proxy->msix_bar, "virtio-msix", 4096); if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors, &proxy->msix_bar, 1, 0)) { - pci_register_bar(&proxy->pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, + pci_register_bar(&proxy->pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY | + PCI_BASE_ADDRESS_MEM_TYPE_64, &proxy->msix_bar); } else vdev->nvectors = 0;