Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upHVM PCI passthrough not working with devices with option/expansion ROM #2386
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
esheltone
Oct 21, 2016
The error message is being generated in pci_register_io_region() in tools/qemu-xen-traditional/hw/pci.c, which is being called by pt_register_regions() in pci-passthrough.c:
pci_register_io_region((PCIDevice *)assigned_device, PCI_ROM_SLOT,
pci_dev->rom_size, PCI_ADDRESS_SPACE_MEM_PREFETCH,
pt_iomem_map);
The bad value for pci_dev->rom_size seems to be set in pci_generic_fill_info() in stubdom/pciutils-x86_64/lib/generic.c:
u32 u = pci_read_long(d, reg);
if (u != 0xffffffff)
{
d->rom_base_addr = u;
if (flags & PCI_FILL_SIZES)
{
u32 size;
pci_write_long(d, reg, ~0);
d->rom_size = pci_read_long(d, reg);
pci_write_long(d, reg, u);
}
}
esheltone
commented
Oct 21, 2016
|
The error message is being generated in pci_register_io_region() in tools/qemu-xen-traditional/hw/pci.c, which is being called by pt_register_regions() in pci-passthrough.c:
The bad value for pci_dev->rom_size seems to be set in pci_generic_fill_info() in stubdom/pciutils-x86_64/lib/generic.c:
|
andrewdavidwong
added
bug
C: core
labels
Oct 21, 2016
andrewdavidwong
added this to the Release 3.2 milestone
Oct 21, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Oct 25, 2016
Member
(does QEMU access PCI config space directly, or is Xen providing this information?).
Through xen-pciback/pcifront.
Some possible solutions?
- find and fix the bug in qemu-traditional
-1
- modify the relevant code (whether QEMU or Xen) to ignore expansion/option ROMs entirely. I believe expansion/option ROMs will not work anyway with the ROMBios used by qemu-traditional, so maybe just drop them.
This may be an option.
- move to qemu-upstream. I believe this is not an issue with qemu-upstream, but I need to double-check. Obviously, there are a lot of challenges in making this happen.
@HW42 is working on this, based on your patches sent to xen-devel a
while ago: https://github.com/HW42/qubes-vmm-xen-stubdom-linux.
Actually, if you have some time, we could use some help ;)
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Through xen-pciback/pcifront.
-1
This may be an option.
@HW42 is working on this, based on your patches sent to xen-devel a Best Regards, |
andrewdavidwong
added
the
help wanted
label
Oct 27, 2016
marmarek
modified the milestones:
Release 3.2,
Release 3.2 updates
Nov 19, 2016
marmarek
closed this
in
marmarek/old-qubes-vmm-xen@31a3a3d
Jan 8, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Jan 8, 2017
Automated announcement from builder-github
The package xen-4.6.3-25.fc25 has been pushed to the r3.2 testing repository for the Fedora fc25 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r3.2-current-testing
qubesos-bot
commented
Jan 8, 2017
|
Automated announcement from builder-github The package
|
qubesos-bot
added
the
r3.2-fc25-cur-test
label
Jan 8, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Jan 8, 2017
Automated announcement from builder-github
The package xen-4.6.3-25.fc23 has been pushed to the r3.2 testing repository for dom0.
To test this update, please install it with the following command:
sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing
qubesos-bot
commented
Jan 8, 2017
|
Automated announcement from builder-github The package
|
qubesos-bot
added
the
r3.2-dom0-cur-test
label
Jan 8, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Jan 8, 2017
Automated announcement from builder-github
The package xen-4.6.3-25.fc23 has been pushed to the r3.2 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r3.2-current-testing
qubesos-bot
commented
Jan 8, 2017
|
Automated announcement from builder-github The package
|
qubesos-bot
added
the
r3.2-fc23-cur-test
label
Jan 8, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Jan 8, 2017
Automated announcement from builder-github
The package xen-4.6.3-25.fc24 has been pushed to the r3.2 testing repository for the Fedora fc24 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r3.2-current-testing
qubesos-bot
commented
Jan 8, 2017
|
Automated announcement from builder-github The package
|
qubesos-bot
added
the
r3.2-fc24-cur-test
label
Jan 8, 2017
added a commit
to marmarek/old-qubes-vmm-xen
that referenced
this issue
Jan 9, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Feb 20, 2017
Automated announcement from builder-github
The package xen-4.6.4-25.fc23 has been pushed to the r3.2 stable repository for the Fedora fc23 template.
To install this update, please use the standard update command:
sudo yum update
qubesos-bot
commented
Feb 20, 2017
|
Automated announcement from builder-github The package
|
qubesos-bot
added
r3.2-fc23-stable
and removed
r3.2-fc23-cur-test
labels
Feb 20, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Feb 20, 2017
Automated announcement from builder-github
The package xen-4.6.4-25.fc24 has been pushed to the r3.2 stable repository for the Fedora fc24 template.
To install this update, please use the standard update command:
sudo yum update
qubesos-bot
commented
Feb 20, 2017
|
Automated announcement from builder-github The package
|
qubesos-bot
added
r3.2-fc24-stable
and removed
r3.2-fc24-cur-test
labels
Feb 20, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Feb 20, 2017
Automated announcement from builder-github
The package xen-4.6.4-25.fc25 has been pushed to the r3.2 stable repository for the Fedora fc25 template.
To install this update, please use the standard update command:
sudo yum update
qubesos-bot
commented
Feb 20, 2017
|
Automated announcement from builder-github The package
|
qubesos-bot
added
r3.2-fc25-stable
and removed
r3.2-fc25-cur-test
labels
Feb 20, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qubesos-bot
Feb 20, 2017
Automated announcement from builder-github
The package xen-4.6.4-25.fc23 has been pushed to the r3.2 stable repository for dom0.
To install this update, please use the standard update command:
sudo qubes-dom0-update
Or update dom0 via Qubes Manager.
qubesos-bot
commented
Feb 20, 2017
|
Automated announcement from builder-github The package
Or update dom0 via Qubes Manager. |
esheltone commentedOct 20, 2016
Related issue: #1659
Tested on Qubes R3.2 using xen-4.6.3-21 package fixing above issue.
Qubes fails to start HVM appvms to with a PCI device with an option ROM has been assigned. In general, this seems to apply to most PCI/PCIE network adapters and many (or most) PCI/PCIE storage adapters. In my case, I encountered the same problem with two PCIE network adapters that each had an option ROM.
Here is output from 'sudo lspci -v' for the network adapter being passed through:
Here is part of the output from 'sudo lspci -xxx':
The expansion ROM base address is at 0x30.
With that device (05:00.0) assigned to an HVM domain 'hvmdomain', 'qvm-start hvmdomain' sits for a while with "--> Loading the VM (type = HVM)..." and eventually fails out.
/var/log/xen/console/guest-hvm-hvmdomain-dm.log includes:
From there it is clear that QEMU has exited due to the above error (from looking at 'xl list' while it hangs, it is clear that Xen fails to realize that QEMU has errored out, which is a separate issue). As a result, the appvm never really gets started.
It looks like the issue is connected with the device's expansion ROM, as the "size" indicated in the QEMU error message (0xdf080000) is actually the address for the device's expansion ROM. I have not tracked down how the address and size for the BAR ended up getting mixed up (does QEMU access PCI config space directly, or is Xen providing this information?).
Some possible solutions?