Red Hat Bugzilla – Bug 510805
PCI FLR support needed for secure device assignment to KVM guests
Last modified: 2009-09-03 09:52:30 EDT
Description of problem:
KVM guests can be given control of PCI devices via
the device assignment support in qemu-kvm, KVM & VT-d in the kernel.
VT-d provides security by isolating device DMA to only
be directed to guest memory, while the guest owns the device.
But prior to the guest gaining control of the device,
and after the guest is shutdown and the device is assumed
to be owned by the host, the PCI(e) device may still
be DMA-ing to memory under a couple of conditions:
(a) driver error, crashing the guest, but leaving the device
DMA-ing to memory.
(b) guest is 'destroyed' by controlling host, but a
clean (driver) shutdown of the device is not implemented.
Once the memory associated with the guest is given back
to the host, the still (badly) running DMA engine could
corrupt host memory, and cause a host crash.
PCI FLR provides a standard method for hosts to
reset a PCI device ensuring it is in a quiesced
state. This ensures errors and/or sudden guest
shutdowns with PCI devices assigned to the guests
don't cause an ensuing host crash.
Version-Release number of selected component (if applicable):
Only in device error cases, or
sudden guest shutdowns that don't invoke assigned device
driver shutdowns (that are 100% complete),
or badly written/behaving guest drivers (that don't
shutdown their device DMA and/or interrupts).
Steps to Reproduce:
Repeatable, secure addition and removal of PCI devices
to KVM guests.
Another patch to KVM is needed to invoke the pci_reset_function()
during device assignment and de-assignment.
The support is provided via 5 patches that are in upstream linux:
PCI: add support for function level reset
PCI: Fix disable IRQ 0 in pci_reset_function()
PCI: refactor pci_reset_function()
PCI: add PCI Advanced Feature Capability defines
PCI: Extend pci_reset_function() to support PCI Advanced Features
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
You can download this test kernel from http://people.redhat.com/dzickus/el5
Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so. However feel free
to provide a comment indicating that this fix has been verified.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.