#
84cfc756 |
| 26-May-2016 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160526.1' into staging
VFIO updates 2016-05-26
- Infrastructure and quirks to support IGD assignment (Alex Williamson) - Fixes to
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160526.1' into staging
VFIO updates 2016-05-26
- Infrastructure and quirks to support IGD assignment (Alex Williamson) - Fixes to 128bit handling, IOMMU replay, IOMMU translation sanity checking (Alexey Kardashevskiy)
# gpg: Signature made Thu 26 May 2016 18:50:29 BST using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
* remotes/awilliam/tags/vfio-update-20160526.1: vfio: Check that IOMMU MR translates to system address space memory: Fix IOMMU replay base address vfio: Fix 128 bit handling when deleting region vfio/pci: Add IGD documentation vfio/pci: Add a separate option for IGD OpRegion support vfio/pci: Intel graphics legacy mode assignment vfio/pci: Setup BAR quirks after capabilities probing vfio/pci: Consolidate VGA setup vfio/pci: Fix return of vfio_populate_vga() vfio: Create device specific region info helper vfio: Enable sparse mmap capability
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
6ced0bba |
| 26-May-2016 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Add a separate option for IGD OpRegion support
The IGD OpRegion is enabled automatically when running in legacy mode, but it can sometimes be useful in universal passthrough mode as well.
vfio/pci: Add a separate option for IGD OpRegion support
The IGD OpRegion is enabled automatically when running in legacy mode, but it can sometimes be useful in universal passthrough mode as well. Without an OpRegion, output spigots don't work, and even though Intel doesn't officially support physical outputs in UPT mode, it's a useful feature. Note that if an OpRegion is enabled but a monitor is not connected, some graphics features will be disabled in the guest versus a headless system without an OpRegion, where they would work.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
c4c45e94 |
| 26-May-2016 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Intel graphics legacy mode assignment
Enable quirks to support SandyBridge and newer IGD devices as primary VM graphics. This requires new vfio-pci device specific regions added in kernel
vfio/pci: Intel graphics legacy mode assignment
Enable quirks to support SandyBridge and newer IGD devices as primary VM graphics. This requires new vfio-pci device specific regions added in kernel v4.6 to expose the IGD OpRegion, the shadow ROM, and config space access to the PCI host bridge and LPC/ISA bridge. VM firmware support, SeaBIOS only so far, is also required for reserving memory regions for IGD specific use. In order to enable this mode, IGD must be assigned to the VM at PCI bus address 00:02.0, it must have a ROM, it must be able to enable VGA, it must have or be able to create on its own an LPC/ISA bridge of the proper type at PCI bus address 00:1f.0 (sorry, not compatible with Q35 yet), and it must have the above noted vfio-pci kernel features and BIOS. The intention is that to enable this mode, a user simply needs to assign 00:02.0 from the host to 00:02.0 in the VM:
-device vfio-pci,host=0000:00:02.0,bus=pci.0,addr=02.0
and everything either happens automatically or it doesn't. In the case that it doesn't, we leave error reports, but assume the device will operate in universal passthrough mode (UPT), which doesn't require any of this, but has a much more narrow window of supported devices, supported use cases, and supported guest drivers.
When using IGD in this mode, the VM firmware is required to reserve some VM RAM for the OpRegion (on the order or several 4k pages) and stolen memory for the GTT (up to 8MB for the latest GPUs). An additional option, x-igd-gms allows the user to specify some amount of additional memory (value is number of 32MB chunks up to 512MB) that is pre-allocated for graphics use. TBH, I don't know of anything that requires this or makes use of this memory, which is why we don't allocate any by default, but the specification suggests this is not actually a valid combination, so the option exists as a workaround. Please report if it's actually necessary in some environment.
See code comments for further discussion about the actual operation of the quirks necessary to assign these devices.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
6dcea614 |
| 14-Mar-2016 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160311.0' into staging
VFIO updates 2016-03-11
- Allow devices to be specified via sysfs path (Alex Williamson) - vfio region hel
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160311.0' into staging
VFIO updates 2016-03-11
- Allow devices to be specified via sysfs path (Alex Williamson) - vfio region helpers and generalization for future device specific regions (Alex Williamson) - Automatic ROM device ID and checksum fixup (Alex Williamson) - Split VGA setup to allow enabling VGA from quirks (Alex Williamson) - Remove fixed string limit for ROM MemoryRegion name (Neo Jia) - MAINTAINERS update (Thomas Huth)
# gpg: Signature made Fri 11 Mar 2016 15:55:31 GMT using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
* remotes/awilliam/tags/vfio-update-20160311.0: MAINTAINERS: Add entry for the include/hw/vfio/ folder vfio/pci: replace fixed string limit by g_strdup_printf vfio/pci: Split out VGA setup vfio/pci: Fixup PCI option ROMs vfio/pci: Convert all MemoryRegion to dynamic alloc and consistent functions vfio: Generalize region support vfio: Wrap VFIO_DEVICE_GET_REGION_INFO vfio: Add sysfsdev property for pci & platform
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
2d82f8a3 |
| 10-Mar-2016 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Convert all MemoryRegion to dynamic alloc and consistent functions
Match common vfio code with setup, exit, and finalize functions for BAR, quirk, and VGA management. VGA is also changed
vfio/pci: Convert all MemoryRegion to dynamic alloc and consistent functions
Match common vfio code with setup, exit, and finalize functions for BAR, quirk, and VGA management. VGA is also changed to dynamic allocation to match the other MemoryRegions.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
db0da029 |
| 10-Mar-2016 |
Alex Williamson <alex.williamson@redhat.com> |
vfio: Generalize region support
Both platform and PCI vfio drivers create a "slow", I/O memory region with one or more mmap memory regions overlayed when supported by the device. Generalize this to
vfio: Generalize region support
Both platform and PCI vfio drivers create a "slow", I/O memory region with one or more mmap memory regions overlayed when supported by the device. Generalize this to a set of common helpers in the core that pulls the region info from vfio, fills the region data, configures slow mapping, and adds helpers for comleting the mmap, enable/disable, and teardown. This can be immediately used by the PCI MSI-X code, which needs to mmap around the MSI-X vector table.
This also changes VFIORegion.mem to be dynamically allocated because otherwise we don't know how the caller has allocated VFIORegion and therefore don't know whether to unreference it to destroy the MemoryRegion or not.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
c6eacb1a |
| 26-Jan-2016 |
Peter Maydell <peter.maydell@linaro.org> |
hw/vfio: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-o
hw/vfio: Clean up includes
Clean up includes so that osdep.h is included first and headers which it implies are not included manually.
This commit was created with scripts/clean-includes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-22-git-send-email-peter.maydell@linaro.org
show more ...
|
#
1cf81ea2 |
| 21-Jan-2016 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160119.0' into staging
VFIO updates 2016-01-19
- Performance fix for devices with poorly placed MSI-X PBA regions - Quirk fix for
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160119.0' into staging
VFIO updates 2016-01-19
- Performance fix for devices with poorly placed MSI-X PBA regions - Quirk fix for hosts with broken MMCONFIG access
# gpg: Signature made Tue 19 Jan 2016 19:00:21 GMT using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
* remotes/awilliam/tags/vfio-update-20160119.0: vfio/pci: Lazy PBA emulation vfio/pci-quirks: Only quirk to size of PCI config space
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
f5793fd9 |
| 19-Jan-2016 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci-quirks: Only quirk to size of PCI config space
For quirks that support the full PCIe extended config space, limit the quirk to only the size of config space available through vfio. This al
vfio/pci-quirks: Only quirk to size of PCI config space
For quirks that support the full PCIe extended config space, limit the quirk to only the size of config space available through vfio. This allows host systems with broken MMCONFIG regions to still make use of these quirks without generating bad address faults trying to access beyond the end of config space exposed through vfio. This may expose direct access to the mirror of extended config space, only trapping the sub-range of standard config space, but allowing this makes the quirk, and thus the device, functional. We expect that only device specific accesses make use of the mirror, not general extended PCI capability accesses, so any virtualization in this space is likely unnecessary anyway, and the device is still IOMMU isolated, so it should only be able to hurt itself through any bogus configurations enabled by this space.
Link: https://www.redhat.com/archives/vfio-users/2015-November/msg00192.html Reported-by: Ronnie Swanink <ronnie@ronnieswanink.nl> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
d93ae5b6 |
| 10-Nov-2015 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20151110.0' into staging
VFIO updates 2015-11-10
- Make Windows happy with vfio-pci devices exposed on conventional PCI buses on
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20151110.0' into staging
VFIO updates 2015-11-10
- Make Windows happy with vfio-pci devices exposed on conventional PCI buses on q35 by hiding PCIe capability (Alex Williamson) - Convert to g_new() where appropriate (Markus Armbruster)
# gpg: Signature made Tue 10 Nov 2015 19:46:41 GMT using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
* remotes/awilliam/tags/vfio-update-20151110.0: vfio: Use g_new() & friends where that makes obvious sense vfio/pci: Hide device PCIe capability on non-express buses for PCIe VMs
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
bdd81add |
| 10-Nov-2015 |
Markus Armbruster <armbru@redhat.com> |
vfio: Use g_new() & friends where that makes obvious sense
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t.
vfio: Use g_new() & friends where that makes obvious sense
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors.
This commit only touches allocations with size arguments of the form sizeof(T). Same Coccinelle semantic patch as in commit b45c03f.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
8bfbbb4b |
| 25-Sep-2015 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150925.0' into staging
VFIO updates 2015-09-25
- Remove use of g_malloc0_n for glib2.22 compat
# gpg: Signature made Fri 25 Sep 2
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150925.0' into staging
VFIO updates 2015-09-25
- Remove use of g_malloc0_n for glib2.22 compat
# gpg: Signature made Fri 25 Sep 2015 17:58:04 BST using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
* remotes/awilliam/tags/vfio-update-20150925.0: vfio/pci: Remove use of g_malloc0_n() from quirks
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
9d146b2e |
| 24-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Remove use of g_malloc0_n() from quirks
For compatibility with glib 2.22.
Reported-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
#
fefa4b12 |
| 23-Sep-2015 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150923.0' into staging
VFIO updates 2015-09-23
- Tracing improvements to use common prefixes for functional areas - Quirks overha
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150923.0' into staging
VFIO updates 2015-09-23
- Tracing improvements to use common prefixes for functional areas - Quirks overhaul: - Split PCI quirks to separate file - Make them understandable and more extensible - Improve use of MemoryRegions and eliminate use of target pagesize - Eliminate build-time debugging, everything migrated to runtime opts
# gpg: Signature made Wed 23 Sep 2015 21:09:05 BST using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
* remotes/awilliam/tags/vfio-update-20150923.0: vfio/pci: Add emulated PCI IDs vfio/pci: Cache vendor and device ID vfio/pci: Move AMD device specific reset to quirks vfio/pci: Remove old config window and mirror quirks vfio/pci: Config mirror quirk vfio/pci: Config window quirks vfio/pci: Rework RTL8168 quirk vfio/pci: Cleanup Nvidia 0x3d0 quirk vfio/pci: Cleanup ATI 0x3c3 quirk vfio/pci: Foundation for new quirk structure vfio/pci: Cleanup ROM blacklist quirk vfio/pci: Split quirks to a separate file vfio/pci: Extract PCI structures to a separate header vfio: Change polarity of our no-mmap option vfio/pci: Make interrupt bypass runtime configurable vfio/pci: Rename MSI/X functions for easier tracing vfio/pci: Rename INTx functions for easier tracing vfio/pci: Cleanup vfio_early_setup_msix() error path vfio/pci: Cleanup RTL8168 quirk and tracing
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
89dcccc5 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Add emulated PCI IDs
Specifying an emulated PCI vendor/device ID can be useful for testing various quirk paths, even though the behavior and functionality of the device with bogus IDs is f
vfio/pci: Add emulated PCI IDs
Specifying an emulated PCI vendor/device ID can be useful for testing various quirk paths, even though the behavior and functionality of the device with bogus IDs is fully unsupportable. We need to use a uint32_t for the vendor/device IDs, even though the registers themselves are only 16-bit in order to be able to determine whether the value is valid and user set.
The same support is added for subsystem vendor/device ID, though these have the possibility of being useful and supported for more than a testing tool. An emulated platform might want to impose their own subsystem IDs or at least hide the physical subsystem ID. Windows guests will often reinstall drivers due to a change in subsystem IDs, something that VM users may want to avoid. Of course careful attention would be required to ensure that guest drivers do not rely on the subsystem ID as a basis for device driver quirks.
All of these options are added using the standard experimental option prefix and should not be considered stable.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
ff635e37 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Cache vendor and device ID
Simplify access to commonly referenced PCI vendor and device ID by caching it on the VFIOPCIDevice struct.
Signed-off-by: Alex Williamson <alex.williamson@redha
vfio/pci: Cache vendor and device ID
Simplify access to commonly referenced PCI vendor and device ID by caching it on the VFIOPCIDevice struct.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
c9c50009 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Move AMD device specific reset to quirks
This is just another quirk, for reset rather than affecting memory regions. Move it to our new quirks file.
Signed-off-by: Alex Williamson <alex.
vfio/pci: Move AMD device specific reset to quirks
This is just another quirk, for reset rather than affecting memory regions. Move it to our new quirks file.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
958d5534 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Remove old config window and mirror quirks
These are now unused.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
#
0d38fb1c |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Config mirror quirk
Re-implement our mirror quirk using the new infrastructure.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
#
0e54f24a |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Config window quirks
Config windows make use of an address register and a data register. In VGA cards, these are often used to provide real mode code in the BIOS an easy way to access MMIO
vfio/pci: Config window quirks
Config windows make use of an address register and a data register. In VGA cards, these are often used to provide real mode code in the BIOS an easy way to access MMIO registers since the window often resides in an I/O port register. When the MMIO register has a mirror of PCI config space, we need to trap those accesses and redirect them to emulated config space.
The previous version of this functionality made use of a single MemoryRegion and single match address. This version uses separate MemoryRegions for each of the address and data registers and allows for multiple match addresses. This is useful for Nvidia cards which have two ranges which index into PCI config space.
The previous implementation is left for the follow-on patch for a more reviewable diff.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
954258a5 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Rework RTL8168 quirk
Another rework of this quirk, this time to update to the new quirk structure. We can handle the address and data registers with separate MemoryRegions and a quirk spe
vfio/pci: Rework RTL8168 quirk
Another rework of this quirk, this time to update to the new quirk structure. We can handle the address and data registers with separate MemoryRegions and a quirk specific data structure, making the code much more understandable.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
6029a424 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Cleanup Nvidia 0x3d0 quirk
The Nvidia 0x3d0 quirk makes use of a two separate registers and gives us our first chance to make use of separate memory regions for each to simplify the code a
vfio/pci: Cleanup Nvidia 0x3d0 quirk
The Nvidia 0x3d0 quirk makes use of a two separate registers and gives us our first chance to make use of separate memory regions for each to simplify the code a bit.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
b946d286 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Cleanup ATI 0x3c3 quirk
This is an easy quirk that really doesn't need a data structure if its own. We can pass vdev as the opaque data and access to the MemoryRegion isn't required.
Sig
vfio/pci: Cleanup ATI 0x3c3 quirk
This is an easy quirk that really doesn't need a data structure if its own. We can pass vdev as the opaque data and access to the MemoryRegion isn't required.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
8c4f2348 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Foundation for new quirk structure
VFIOQuirk hosts a single memory region and a fixed set of data fields that try to handle all the quirk cases, but end up making those that don't exactly
vfio/pci: Foundation for new quirk structure
VFIOQuirk hosts a single memory region and a fixed set of data fields that try to handle all the quirk cases, but end up making those that don't exactly match really confusing. This patch introduces a struct intended to provide more flexibility and simpler code. VFIOQuirk is stripped to its basics, an opaque data pointer for quirk specific data and a pointer to an array of MemoryRegions with a counter. This still allows us to have common teardown routines, but adds much greater flexibility to support multiple memory regions and quirk specific data structures that are easier to maintain. The existing VFIOQuirk is transformed into VFIOLegacyQuirk, which further patches will eliminate entirely.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|
#
056dfcb6 |
| 23-Sep-2015 |
Alex Williamson <alex.williamson@redhat.com> |
vfio/pci: Cleanup ROM blacklist quirk
Create a vendor:device ID helper that we'll also use as we rework the rest of the quirks. Re-reading the config entries, even if we get more blacklist entries,
vfio/pci: Cleanup ROM blacklist quirk
Create a vendor:device ID helper that we'll also use as we rework the rest of the quirks. Re-reading the config entries, even if we get more blacklist entries, is trivial overhead and only incurred during device setup. There's no need to typedef the blacklist structure, it's a static private data type used once. The elements get bumped up to uint32_t to avoid future maintenance issues if PCI_ANY_ID gets used for a blacklist entry (avoiding an actual hardware match). Our test loop is also crying out to be simplified as a for loop.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
show more ...
|