qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC/PATCH] Fix guest OS panic when 64bit BAR is presen


From: Alex Williamson
Subject: Re: [Qemu-devel] [RFC/PATCH] Fix guest OS panic when 64bit BAR is present
Date: Wed, 25 Jan 2012 11:59:21 -0700

On Wed, 2012-01-25 at 17:38 +0200, Michael S. Tsirkin wrote:
> 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;
> 

I was also able to add MEM64 BARs to device assignment pretty trivially
and it seems to work, guest sees 64bit BARs for an 82576 VF, programs it
to an fexxxxxx address and it works.

Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]