From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: qemu-xen-dir + PCI passthrough = BOOM Date: Fri, 10 Jan 2014 11:35:44 -0500 Message-ID: <20140110163544.GA21692@phenom.dumpdata.com> References: <20131206153503.GS10855@perard.uk.xensource.com> <20131206160018.GC4419@zion.uk.xensource.com> <20131206160310.GD4419@zion.uk.xensource.com> <20131216150816.GA14122@phenom.dumpdata.com> <20131218144823.GB6081@perard.uk.xensource.com> <20140108194451.GA15956@phenom.dumpdata.com> <20140109145624.GD1696@perard.uk.xensource.com> <20140110032845.GA3660@konrad-lan.dumpdata.com> <20140110151914.GF1696@perard.uk.xensource.com> <24225189.20140110170544@eikelenboom.it> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W1f3t-0003pU-DD for xen-devel@lists.xenproject.org; Fri, 10 Jan 2014 16:35:57 +0000 Content-Disposition: inline In-Reply-To: <24225189.20140110170544@eikelenboom.it> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Sander Eikelenboom Cc: Anthony PERARD , xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, donald.d.dugger@intel.com List-Id: xen-devel@lists.xenproject.org > >> (d1) [2014-01-10 03:20:29] Running option rom at ca00:0003 > >> > >> (d1) [2014-01-10 03:20:47] Booting from DVD/CD... > >> (d1) [2014-01-10 03:20:47] Booting from 0000:7c00 > >> .. > >> and I did see the PXE boot menu in my guest - so even > >> better! > > > Perfect, look like it is the fix for PCI passthrough. > > Hi Konrad, > > Are you sure it's the rom of the NIC, and not the iPXE rom from the emulated device that > gets run ? Yes. I double checked that the MAC address that was given an DHCP address was indeed for the physical hardware. And it was. > > With this patch and VGA devices it still points to another rom for me. > (it looks like it is pointing to the rom of the device with a BDF just one lower than the passed through one) That all sounds to me like a bug in QEMU which constructs the 'world'. Then 'hvmloader' and the kernel ingest this to create their view of what the PCI configuration/slots/etc should look like. They use 'inb' and 'outb' instructions on the 0xcf8/0xcfc port. Perhaps the 'vga=none' is having an hard time dealing with 'no-VGA-but-wait-there is-and-PT-VGA'? Just to make sure I am not forgetting a crucial fact - if you don't have vga=none, does the lspci output look sane? > > Do you by any chance know if there is a difference in how lspci and the linux kernel scan / list pci devices ? > (for example one by reading acpi tables .. the other one by real probing .. ?) The kernel and hvmloader all use the 'inb' and 'outb' to figure out what the PCI space looks like. 'lspci' uses /sysfs. Thought if you use '-xxxx' I think it also does 'inb' and 'outb'. So it all seems to point to QEMU. > > -- > Sander > > > >> I have not yet done the GPU - this issue was preventing me from using > >> qemu-xen as it would always blow up before SeaBIOS was in the picture. > >> > >> If you would like to put 'Reported-and-Tested-by: Konrad Rzeszutek Wilk > >> ' please do. > > > Will do. > > >> Thank you! > >> > > >> > > >> > diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c > >> > index 6dd7a68..2bbdb6d 100644 > >> > --- a/hw/xen/xen_pt.c > >> > +++ b/hw/xen/xen_pt.c > >> > @@ -440,8 +440,8 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s) > >> > > >> > s->bases[PCI_ROM_SLOT].access.maddr = d->rom.base_addr; > >> > > >> > - memory_region_init_rom_device(&s->rom, OBJECT(s), NULL, NULL, > >> > - "xen-pci-pt-rom", d->rom.size); > >> > + memory_region_init_io(&s->rom, OBJECT(s), &ops, &s->dev, > >> > + "xen-pci-pt-rom", d->rom.size); > >> > pci_register_bar(&s->dev, PCI_ROM_SLOT, PCI_BASE_ADDRESS_MEM_PREFETCH, > >> > &s->rom); > >> > > >> > > >> > -- > >> > Anthony PERARD > >