xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/11] PCI devices passthrough on Arm, part 3
@ 2021-09-23 12:54 Oleksandr Andrushchenko
  2021-09-23 12:54 ` [PATCH v2 01/11] vpci: Make vpci registers removal a dedicated function Oleksandr Andrushchenko
                   ` (10 more replies)
  0 siblings, 11 replies; 44+ messages in thread
From: Oleksandr Andrushchenko @ 2021-09-23 12:54 UTC (permalink / raw)
  To: xen-devel
  Cc: julien, sstabellini, oleksandr_tyshchenko, volodymyr_babchuk,
	Artem_Mygaiev, roger.pau, jbeulich, bertrand.marquis,
	rahul.singh, Oleksandr Andrushchenko

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 also adds support for virtual PCI bus topology for guests:
 - We emulate a single host bridge for the guest, so segment is always 0.
 - The implementation is limited to 32 devices which are allowed on
   a single PCI bus.
 - The virtual bus number is set to 0, so virtual devices are seen
   as embedded endpoints behind the root complex.

The series was also tested on x86 PVH Dom0 and doesn't break it.

Thank you,
Oleksandr

Oleksandr Andrushchenko (11):
  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: Emulate PCI_COMMAND register for guests
  vpci/header: Reset the command register when adding devices
  vpci: Add initial support for virtual PCI bus topology
  xen/arm: Translate virtual PCI bus topology for guests

 xen/arch/arm/domain.c         |   1 +
 xen/arch/arm/vpci.c           |  87 ++++++-
 xen/arch/arm/vpci.h           |   3 +
 xen/common/domain.c           |   1 +
 xen/drivers/Kconfig           |   4 +
 xen/drivers/passthrough/pci.c |  91 ++++++++
 xen/drivers/vpci/header.c     | 412 +++++++++++++++++++++++++++-------
 xen/drivers/vpci/vpci.c       |  48 +++-
 xen/include/asm-arm/pci.h     |   1 +
 xen/include/xen/pci.h         |  19 ++
 xen/include/xen/sched.h       |   8 +
 xen/include/xen/vpci.h        |  34 ++-
 12 files changed, 617 insertions(+), 92 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2021-09-29 14:16 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 12:54 [PATCH v2 00/11] PCI devices passthrough on Arm, part 3 Oleksandr Andrushchenko
2021-09-23 12:54 ` [PATCH v2 01/11] vpci: Make vpci registers removal a dedicated function Oleksandr Andrushchenko
2021-09-28 11:15   ` Michal Orzel
2021-09-23 12:54 ` [PATCH v2 02/11] vpci: Add hooks for PCI device assign/de-assign Oleksandr Andrushchenko
2021-09-29  9:35   ` Michal Orzel
2021-09-23 12:54 ` [PATCH v2 03/11] vpci/header: Move register assignments from init_bars Oleksandr Andrushchenko
2021-09-23 12:54 ` [PATCH v2 04/11] vpci/header: Add and remove register handlers dynamically Oleksandr Andrushchenko
2021-09-23 12:54 ` [PATCH v2 05/11] vpci/header: Implement guest BAR register handlers Oleksandr Andrushchenko
2021-09-29  9:27   ` Michal Orzel
2021-09-23 12:54 ` [PATCH v2 06/11] vpci/header: Handle p2m range sets per BAR Oleksandr Andrushchenko
2021-09-23 12:54 ` [PATCH v2 07/11] vpci/header: program p2m with guest BAR view Oleksandr Andrushchenko
2021-09-29  8:13   ` Michal Orzel
2021-09-29  8:16     ` Jan Beulich
2021-09-29  8:24       ` Oleksandr Andrushchenko
2021-09-29  8:36         ` Jan Beulich
2021-09-29  8:58           ` Oleksandr Andrushchenko
2021-09-29  8:16     ` Oleksandr Andrushchenko
2021-09-23 12:54 ` [PATCH v2 08/11] vpci/header: Emulate PCI_COMMAND register for guests Oleksandr Andrushchenko
2021-09-28  7:34   ` Michal Orzel
2021-09-23 12:54 ` [PATCH v2 09/11] vpci/header: Reset the command register when adding devices Oleksandr Andrushchenko
2021-09-28  7:38   ` Michal Orzel
2021-09-23 12:55 ` [PATCH v2 10/11] vpci: Add initial support for virtual PCI bus topology Oleksandr Andrushchenko
2021-09-28  7:48   ` Michal Orzel
2021-09-28  7:59     ` Jan Beulich
2021-09-28  8:17       ` Michal Orzel
2021-09-28 12:58         ` Oleksandr Andrushchenko
2021-09-29  9:03           ` Oleksandr Andrushchenko
2021-09-29  9:09             ` Jan Beulich
2021-09-29 11:56               ` Oleksandr Andrushchenko
2021-09-29 12:54                 ` Jan Beulich
2021-09-29 13:16                   ` Oleksandr Andrushchenko
2021-09-29 13:23                     ` Jan Beulich
2021-09-29 13:49                       ` Oleksandr Andrushchenko
2021-09-29 14:07                         ` Jan Beulich
2021-09-29 14:16                           ` Oleksandr Andrushchenko
2021-09-23 12:55 ` [PATCH v2 11/11] xen/arm: Translate virtual PCI bus topology for guests Oleksandr Andrushchenko
2021-09-27 11:31   ` Jan Beulich
2021-09-27 12:08     ` Oleksandr Andrushchenko
2021-09-27 13:34       ` Jan Beulich
2021-09-27 13:43         ` Oleksandr Andrushchenko
2021-09-27 13:51           ` Jan Beulich
2021-09-27 14:04             ` Oleksandr Andrushchenko
2021-09-27 14:16               ` Jan Beulich
2021-09-27 14:20                 ` Oleksandr Andrushchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).