From patchwork Wed Jan 25 15:38:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 137791 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 F2AEEB6EFF for ; Thu, 26 Jan 2012 03:01:19 +1100 (EST) Received: from localhost ([::1]:44562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq4uB-00009c-NH for incoming@patchwork.ozlabs.org; Wed, 25 Jan 2012 10:36:59 -0500 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 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0PFZnk4009697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Jan 2012 10:35:49 -0500 Received: from redhat.com (vpn1-4-223.ams2.redhat.com [10.36.4.223]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id q0PFZl8T014489; Wed, 25 Jan 2012 10:35:48 -0500 Date: Wed, 25 Jan 2012 17:38:05 +0200 From: "Michael S. Tsirkin" To: Alexey Korolev Message-ID: <20120125153415.GA10267@redhat.com> References: <4F1F971B.4020309@endace.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4F1F971B.4020309@endace.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: sfd@endace.com, Kevin O'Connor , "qemu-devel@nongnu.org" Subject: Re: [Qemu-devel] [RFC/PATCH] Fix guest OS panic when 64bit BAR is present 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 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;