Bug 510805 - PCI FLR support needed for secure device assignment to KVM guests
PCI FLR support needed for secure device assignment to KVM guests
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: Don Dutile
Red Hat Kernel QE team
Depends On:
Blocks: 510806 512913
  Show dependency treegraph
Reported: 2009-07-10 17:01 EDT by Don Dutile
Modified: 2009-09-03 09:52 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-02 04:44:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Don Dutile 2009-07-10 17:01:01 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):

How reproducible:
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:
Actual results:

Expected results:
Repeatable, secure addition and removal of PCI devices
to KVM guests.

Additional info:
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
Comment 2 RHEL Product and Program Management 2009-07-12 08:43:02 EDT
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
Comment 6 Don Zickus 2009-07-21 15:37:19 EDT
in kernel-2.6.18-159.el5
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.
Comment 10 errata-xmlrpc 2009-09-02 04:44:17 EDT
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.


Note You need to log in before you can comment on or make changes to this bug.