All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/9] vpci: allow queueing of mapping operations
@ 2026-07-08 21:02 Stewart Hildebrand
  2026-07-08 21:02 ` [PATCH v5 1/9] vpci: move BAR mapping permissions checks Stewart Hildebrand
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Stewart Hildebrand @ 2026-07-08 21:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Stewart Hildebrand, Roger Pau Monné, Daniel P. Smith,
	Andrew Cooper, Anthony PERARD, Michal Orzel, Jan Beulich,
	Julien Grall, Stefano Stabellini

Introduce the ability to queue p2m mapping operations in vPCI. This is
pre-requisite for both vPCI SR-IOV [2] and the ability to handle BAR writes
with memory decoding enabled [1]. I thought I might wait to submit the BAR-
write-with-memory-decoding-enabled patch until the prerequisite is reviewed
acked/merged, but if you'd find it more helpful for me to submit it right away
I'd be happy to do so (I've already pushed it to the gitlab pipeline [0]).

When multiple operations are queued, there are some non-trivial complexities
with the deferred setting of bar->enabled, header->rom_enabled, and
header->bars_mapped flags. If deferred, these flags wouldn't be updated until
the p2m op queue is processing, but we need to consult them in modify_bars()
at queue time, so they wouldn't be accurate when adding multiple tasks to the
queue. In order to simplify the deferred mapping state, and in particular
avoid complexities with the bar->enabled, header->rom_enabled, and
header->bars_mapped flags, I have picked up Roger's vPCI fixes series [3]. The
overall result is now that _only_ p2m operations are deferred. PCI config
space writes, flag-setting, and everything else is handled at queuing time.

1. vpci: move BAR mapping permissions checks
2. vpci: make BAR mapping more resilient for the hardware domain
3. vpci: only check BAR validity once
4. vpci/msix: move MSI-X hole punching as a result of memory decoding enable
5. vpci: simplify handling of memory decoding and ROM enable writes
6. vpci: create mem local variables
7. vpci: split vpci_process_pending()
8. vpci: allow queueing of mapping operations
9. vpci: don't pass command value to modify_bars()

Patch 1 is code movement, and patch 2 is hardening map_range(). While these
 first 2 are not strictly pre-requisites for queued mapping, they simplify the
 subsequent prepwork.
Patches 3-5 progressively remove modify_decoding().
Patches 6-7 are non-functional changes pulled out from patch 8.
Patch 8 is the core feature: pre-requisite for SR-IOV and BAR-write-with-
 memory-decoding-enabled.
Patch 9 is cleanup I chose to put at the end for lower diffstat.

Patches 2-5 are borrowed from Roger's vPCI fixes series [3]. These patches
have gone directly from v1 to v5, but otherwise revlogs are written assuming
this is a continuation of the BAR-write-with-memory-decoding-enabled series.

v4->v5:
* don't defer anything that's not p2m related
* drop ("vpci: allow 32-bit BAR writes with memory decoding enabled") for now
  to focus on the pre-requisite patches first
* split non-functional changes

v3->v4:
* switch back to dynamically allocated queue elements

v2->v3:
* add ("vpci: Use pervcpu ranges for BAR mapping")
* rework with fixed array of map/unmap slots

v1->v2:
* new approach with queued p2m operations

RFC->v1:
* rework BAR mapping machinery to support unmap-then-map operation

[0] Pipeline: https://gitlab.com/xen-project/people/stewarthildebrand/xen/-/pipelines/2662651745

[1] BAR write with memory decoding enabled
v4: https://lore.kernel.org/xen-devel/20260406191203.97662-1-stewart.hildebrand@amd.com/T/#t
v3: https://lore.kernel.org/xen-devel/20260324030513.700217-1-stewart.hildebrand@amd.com/T/#t
v2: https://lore.kernel.org/xen-devel/20250723163744.13095-1-stewart.hildebrand@amd.com/T/#t
v1: https://lore.kernel.org/xen-devel/20250531125405.268984-1-stewart.hildebrand@amd.com/T/#t
RFC: https://lore.kernel.org/xen-devel/20250312195019.382926-1-stewart.hildebrand@amd.com/T/#t
Gitlab: https://gitlab.com/xen-project/xen/-/issues/197

[2] vPCI SR-IOV
v3: https://lore.kernel.org/xen-devel/cover.1775742115.git.mykyta_poturai@epam.com/T/#t
v2: https://lore.kernel.org/xen-devel/cover.1772806036.git.mykyta_poturai@epam.com/T/#t
v1: https://lore.kernel.org/xen-devel/cover.1753450965.git.mykyta_poturai@epam.com/T/#t
2018 v2 https://lore.kernel.org/xen-devel/20180717094830.54806-1-roger.pau@citrix.com/T/#t

[3] vPCI miscellaneous fixes
https://lore.kernel.org/xen-devel/20250814160358.95543-1-roger.pau@citrix.com/T/#t


 xen/common/domain.c        |   5 +
 xen/drivers/vpci/header.c  | 443 +++++++++++++++++++++----------------
 xen/drivers/vpci/private.h |   1 +
 xen/drivers/vpci/vpci.c    |  17 +-
 xen/include/xen/vpci.h     |  15 +-
 5 files changed, 279 insertions(+), 202 deletions(-)


base-commit: 03851197a7b2cd58851b9ec2293bdf4a68c47b66
-- 
2.54.0



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

end of thread, other threads:[~2026-07-23 20:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 21:02 [PATCH v5 0/9] vpci: allow queueing of mapping operations Stewart Hildebrand
2026-07-08 21:02 ` [PATCH v5 1/9] vpci: move BAR mapping permissions checks Stewart Hildebrand
2026-07-23 14:44   ` Jan Beulich
2026-07-23 14:57     ` Roger Pau Monné
2026-07-23 15:06       ` Jan Beulich
2026-07-23 20:09       ` Daniel P. Smith
2026-07-08 21:02 ` [PATCH v5 2/9] vpci: make BAR mapping more resilient for the hardware domain Stewart Hildebrand
2026-07-23 14:55   ` Jan Beulich
2026-07-08 21:02 ` [PATCH v5 3/9] vpci: only check BAR validity once Stewart Hildebrand
2026-07-23 15:46   ` Jan Beulich
2026-07-08 21:02 ` [PATCH v5 4/9] vpci/msix: move MSI-X hole punching as a result of memory decoding enable Stewart Hildebrand
2026-07-23 15:59   ` Jan Beulich
2026-07-08 21:02 ` [PATCH v5 5/9] vpci: simplify handling of memory decoding and ROM enable writes Stewart Hildebrand
2026-07-08 21:02 ` [PATCH v5 6/9] vpci: create mem local variables Stewart Hildebrand
2026-07-08 21:02 ` [PATCH v5 7/9] vpci: split vpci_process_pending() Stewart Hildebrand
2026-07-08 21:02 ` [PATCH v5 8/9] vpci: allow queueing of mapping operations Stewart Hildebrand
2026-07-08 21:02 ` [PATCH v5 9/9] vpci: don't pass command value to modify_bars() Stewart Hildebrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.