From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Hi, all!
This patch series is focusing on vPCI and adds support for non-identity
PCI BAR mappings which is required while passing through a PCI device to
a guest. The highlights are:
- Add relevant vpci register handlers when assigning PCI device to a domain
and remove those when de-assigning. This allows having different
handlers for different domains, e.g. hwdom and other guests.
- Emulate guest BAR register values based on physical BAR values.
This allows creating a guest view of the registers and emulates
size and properties probe as it is done during PCI device enumeration by
the guest.
- Instead of handling a single range set, that contains all the memory
regions of all the BARs and ROM, have them per BAR.
- Take into account guest's BAR view and program its p2m accordingly:
gfn is guest's view of the BAR and mfn is the physical BAR value as set
up by the host bridge in the hardware domain.
This way hardware doamin sees physical BAR values and guest sees
emulated ones.
The series was also tested on x86 PVH Dom0 and doesn't break it.
Thank you,
Oleksandr
Oleksandr Andrushchenko (8):
vpci: Make vpci registers removal a dedicated function
vpci: Add hooks for PCI device assign/de-assign
vpci/header: Move register assignments from init_bars
vpci/header: Add and remove register handlers dynamically
vpci/header: Implement guest BAR register handlers
vpci/header: Handle p2m range sets per BAR
vpci/header: program p2m with guest BAR view
vpci/header: Reset the command register when adding devices
Rahul Singh (1):
vpci/header: Use pdev's domain instead of vCPU
xen/drivers/passthrough/pci.c | 9 +
xen/drivers/vpci/header.c | 431 +++++++++++++++++++++++++++-------
xen/drivers/vpci/vpci.c | 28 ++-
xen/include/xen/pci_regs.h | 1 +
xen/include/xen/vpci.h | 28 ++-
5 files changed, 413 insertions(+), 84 deletions(-)
--
2.25.1