dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v10 0/5] PCI: VF resizable BAR
@ 2025-07-02  9:35 Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 1/5] PCI/IOV: Restore VF resizable BAR state after reset Michał Winiarski
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Michał Winiarski @ 2025-07-02  9:35 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel
  Cc: intel-xe, dri-devel, Christian König,
	Krzysztof Wilczyński, Ilpo Järvinen, Rodrigo Vivi,
	Michal Wajdeczko, Lucas De Marchi, Thomas Hellström,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Matt Roper, Michał Winiarski

Hi,

The series is now reviewed, and it looks like there's no further
feedback.
To limit it to PCI subsystem, I removed the last patch in the series, as
it contained changes in drm/xe driver (it can still be found in v9 for
reference, and I expect that this single patch will go through DRM tree
anyways).

v9 can be found here:
https://lore.kernel.org/linux-pci/20250527120637.665506-1-michal.winiarski@intel.com/

For regular BAR, drivers can use pci_resize_resource to resize it to the
desired size provided that it is supported by the hardware, which the
driver can query using pci_rebar_get_possible_sizes.
This series expands the API to work with IOV BAR as well.
It also adds the additional API for drivers to change the VF BAR size
without resizing the entire underlying reservation (within the original
resource boundary).

Thanks,
-Michał

v9 -> v10:
- Remove last patch with drm/xe changes

v8 -> v9:
- Use u64 as do_div() dividend (LKP)
- Introduce a helper to access cached vf_rebar_cap (LKP)

v7 -> v8:
- Update variable ordering and missing includes (Ilpo)

v6 -> v7:
- Eliminate the loop in pci_iov_vf_bar_get_sizes() (Ilpo)
- Use helper variable for indexes (Ilpo)
- Kerneldoc formatting (Ilpo)
- Refer to latest PCI spec (Ilpo)
- Commit message wording (Ilpo)

v5 -> v6:
- Rebased on latest pci/next
- Cache the VF resizable BAR capability position to avoid multiple
  lookups (Ilpo)
- Use pci_resource_n helper (Ilpo)

v4 -> v5:
- Rename pci_resource_to/from_iov helpers and add WARN if called without
  CONFIG_PCI_IOV (Ilpo)
- Reword kerneldoc for pci_iov_vf_bar_get_sizes (Bjorn)
- Reword commit message for VF BAR size check, extract the additional
  size check to separate conditional (Bjorn)

v3 -> v4:
- Change the approach to extending the BAR (Christian)
- Tidy the commit messages, use 80 line limit where necessary (Bjorn)
- Add kerneldocs to exported functions (Bjorn)
- Add pci_resource_to_iov() / pci_resource_from_iov() helpers (Ilpo)
- Use FIELD_GET(), tidy whitespace (Ilpo)

v2 -> v3:
- Extract introducing pci_resource_is_iov to separate commit and
  use it elsewhere in PCI subsystem (Christian)
- Extract restoring VF rebar state to separate commit (Christian)
- Reorganize memory decoding check (Christian)
- Don't use dev_WARN (Ilpo)
- Fix build without CONFIG_PCI_IOV (CI)

v1 -> v2:
- Add pci_iov_resource_extend() and usage in Xe driver
- Reduce the number of ifdefs (Christian)
- Drop patch 2/2 from v1 (Christian)
- Add a helper to avoid upsetting static analysis tools (Krzysztof)

Michał Winiarski (5):
  PCI/IOV: Restore VF resizable BAR state after reset
  PCI: Add a helper to convert between VF BAR number and IOV resource
  PCI: Allow IOV resources to be resized in pci_resize_resource()
  PCI/IOV: Check that VF BAR fits within the reservation
  PCI: Allow drivers to control VF BAR size

 drivers/pci/iov.c             | 153 +++++++++++++++++++++++++++++++---
 drivers/pci/pci.c             |   8 +-
 drivers/pci/pci.h             |  39 +++++++++
 drivers/pci/setup-bus.c       |   3 +-
 drivers/pci/setup-res.c       |  35 ++++++--
 include/linux/pci.h           |   6 ++
 include/uapi/linux/pci_regs.h |   9 ++
 7 files changed, 235 insertions(+), 18 deletions(-)

-- 
2.49.0


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

* [PATCH v10 1/5] PCI/IOV: Restore VF resizable BAR state after reset
  2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
@ 2025-07-02  9:35 ` Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 2/5] PCI: Add a helper to convert between VF BAR number and IOV resource Michał Winiarski
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michał Winiarski @ 2025-07-02  9:35 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel
  Cc: intel-xe, dri-devel, Christian König,
	Krzysztof Wilczyński, Ilpo Järvinen, Rodrigo Vivi,
	Michal Wajdeczko, Lucas De Marchi, Thomas Hellström,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Matt Roper, Michał Winiarski

Similar to regular resizable BAR, VF BAR can also be resized, e.g. by
the system firmware or the PCI subsystem itself.

The capability layout is the same as PCI_EXT_CAP_ID_REBAR.

Add the capability ID and restore it as a part of IOV state.

See PCIe r6.2, sec 7.8.7.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 drivers/pci/iov.c             | 30 +++++++++++++++++++++++++++++-
 drivers/pci/pci.h             | 12 ++++++++++++
 include/uapi/linux/pci_regs.h |  9 +++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 10693b5d7eb66..10ccef8afe145 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -7,6 +7,7 @@
  * Copyright (C) 2009 Intel Corporation, Yu Zhao <yu.zhao@intel.com>
  */
 
+#include <linux/bitfield.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/export.h>
@@ -850,6 +851,7 @@ static int sriov_init(struct pci_dev *dev, int pos)
 	pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
 	if (pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END)
 		iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
+	iov->vf_rebar_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_VF_REBAR);
 
 	if (pdev)
 		iov->dev = pci_dev_get(pdev);
@@ -888,6 +890,30 @@ static void sriov_release(struct pci_dev *dev)
 	dev->sriov = NULL;
 }
 
+static void sriov_restore_vf_rebar_state(struct pci_dev *dev)
+{
+	unsigned int pos, nbars, i;
+	u32 ctrl;
+
+	pos = pci_iov_vf_rebar_cap(dev);
+	if (!pos)
+		return;
+
+	pci_read_config_dword(dev, pos + PCI_VF_REBAR_CTRL, &ctrl);
+	nbars = FIELD_GET(PCI_VF_REBAR_CTRL_NBAR_MASK, ctrl);
+
+	for (i = 0; i < nbars; i++, pos += 8) {
+		int bar_idx, size;
+
+		pci_read_config_dword(dev, pos + PCI_VF_REBAR_CTRL, &ctrl);
+		bar_idx = FIELD_GET(PCI_VF_REBAR_CTRL_BAR_IDX, ctrl);
+		size = pci_rebar_bytes_to_size(dev->sriov->barsz[bar_idx]);
+		ctrl &= ~PCI_VF_REBAR_CTRL_BAR_SIZE;
+		ctrl |= FIELD_PREP(PCI_VF_REBAR_CTRL_BAR_SIZE, size);
+		pci_write_config_dword(dev, pos + PCI_VF_REBAR_CTRL, ctrl);
+	}
+}
+
 static void sriov_restore_state(struct pci_dev *dev)
 {
 	int i;
@@ -1047,8 +1073,10 @@ resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
  */
 void pci_restore_iov_state(struct pci_dev *dev)
 {
-	if (dev->is_physfn)
+	if (dev->is_physfn) {
+		sriov_restore_vf_rebar_state(dev);
 		sriov_restore_state(dev);
+	}
 }
 
 /**
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index adabf59bae40e..3bd507583c3fa 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -494,6 +494,7 @@ struct pci_sriov {
 	u16		subsystem_vendor; /* VF subsystem vendor */
 	u16		subsystem_device; /* VF subsystem device */
 	resource_size_t	barsz[PCI_SRIOV_NUM_BARS];	/* VF BAR size */
+	u16		vf_rebar_cap;	/* VF Resizable BAR capability offset */
 	bool		drivers_autoprobe; /* Auto probing of VFs by driver */
 };
 
@@ -718,6 +719,13 @@ void pci_iov_update_resource(struct pci_dev *dev, int resno);
 resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
 void pci_restore_iov_state(struct pci_dev *dev);
 int pci_iov_bus_range(struct pci_bus *bus);
+static inline u16 pci_iov_vf_rebar_cap(struct pci_dev *dev)
+{
+	if (!dev->is_physfn)
+		return 0;
+
+	return dev->sriov->vf_rebar_cap;
+}
 static inline bool pci_resource_is_iov(int resno)
 {
 	return resno >= PCI_IOV_RESOURCES && resno <= PCI_IOV_RESOURCE_END;
@@ -742,6 +750,10 @@ static inline int pci_iov_bus_range(struct pci_bus *bus)
 {
 	return 0;
 }
+static inline u16 pci_iov_vf_rebar_cap(struct pci_dev *dev)
+{
+	return 0;
+}
 static inline bool pci_resource_is_iov(int resno)
 {
 	return false;
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index a3a3e942dedff..f5b17745de607 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -745,6 +745,7 @@
 #define PCI_EXT_CAP_ID_L1SS	0x1E	/* L1 PM Substates */
 #define PCI_EXT_CAP_ID_PTM	0x1F	/* Precision Time Measurement */
 #define PCI_EXT_CAP_ID_DVSEC	0x23	/* Designated Vendor-Specific */
+#define PCI_EXT_CAP_ID_VF_REBAR 0x24	/* VF Resizable BAR */
 #define PCI_EXT_CAP_ID_DLF	0x25	/* Data Link Feature */
 #define PCI_EXT_CAP_ID_PL_16GT	0x26	/* Physical Layer 16.0 GT/s */
 #define PCI_EXT_CAP_ID_NPEM	0x29	/* Native PCIe Enclosure Management */
@@ -1141,6 +1142,14 @@
 #define PCI_DVSEC_HEADER2		0x8 /* Designated Vendor-Specific Header2 */
 #define  PCI_DVSEC_HEADER2_ID(x)		((x) & 0xffff)
 
+/* VF Resizable BARs, same layout as PCI_REBAR */
+#define PCI_VF_REBAR_CAP	PCI_REBAR_CAP
+#define  PCI_VF_REBAR_CAP_SIZES		PCI_REBAR_CAP_SIZES
+#define PCI_VF_REBAR_CTRL	PCI_REBAR_CTRL
+#define  PCI_VF_REBAR_CTRL_BAR_IDX	PCI_REBAR_CTRL_BAR_IDX
+#define  PCI_VF_REBAR_CTRL_NBAR_MASK	PCI_REBAR_CTRL_NBAR_MASK
+#define  PCI_VF_REBAR_CTRL_BAR_SIZE	PCI_REBAR_CTRL_BAR_SIZE
+
 /* Data Link Feature */
 #define PCI_DLF_CAP		0x04	/* Capabilities Register */
 #define  PCI_DLF_EXCHANGE_ENABLE	0x80000000  /* Data Link Feature Exchange Enable */
-- 
2.49.0


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

* [PATCH v10 2/5] PCI: Add a helper to convert between VF BAR number and IOV resource
  2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 1/5] PCI/IOV: Restore VF resizable BAR state after reset Michał Winiarski
@ 2025-07-02  9:35 ` Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource() Michał Winiarski
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michał Winiarski @ 2025-07-02  9:35 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel
  Cc: intel-xe, dri-devel, Christian König,
	Krzysztof Wilczyński, Ilpo Järvinen, Rodrigo Vivi,
	Michal Wajdeczko, Lucas De Marchi, Thomas Hellström,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Matt Roper, Michał Winiarski

There are multiple places where conversions between IOV resources and
corresponding VF BAR numbers are done.

Extract the logic to pci_resource_num_from_vf_bar() and
pci_resource_num_to_vf_bar() helpers.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/pci/iov.c       | 26 ++++++++++++++++----------
 drivers/pci/pci.h       | 18 ++++++++++++++++++
 drivers/pci/setup-bus.c |  3 ++-
 3 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 10ccef8afe145..bdac078045525 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -151,7 +151,7 @@ resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno)
 	if (!dev->is_physfn)
 		return 0;
 
-	return dev->sriov->barsz[resno - PCI_IOV_RESOURCES];
+	return dev->sriov->barsz[pci_resource_num_to_vf_bar(resno)];
 }
 
 static void pci_read_vf_config_common(struct pci_dev *virtfn)
@@ -342,12 +342,14 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id)
 	virtfn->multifunction = 0;
 
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
-		res = &dev->resource[i + PCI_IOV_RESOURCES];
+		int idx = pci_resource_num_from_vf_bar(i);
+
+		res = &dev->resource[idx];
 		if (!res->parent)
 			continue;
 		virtfn->resource[i].name = pci_name(virtfn);
 		virtfn->resource[i].flags = res->flags;
-		size = pci_iov_resource_size(dev, i + PCI_IOV_RESOURCES);
+		size = pci_iov_resource_size(dev, idx);
 		resource_set_range(&virtfn->resource[i],
 				   res->start + size * id, size);
 		rc = request_resource(res, &virtfn->resource[i]);
@@ -644,8 +646,10 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
 
 	nres = 0;
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
-		bars |= (1 << (i + PCI_IOV_RESOURCES));
-		res = &dev->resource[i + PCI_IOV_RESOURCES];
+		int idx = pci_resource_num_from_vf_bar(i);
+
+		bars |= (1 << idx);
+		res = &dev->resource[idx];
 		if (res->parent)
 			nres++;
 	}
@@ -811,8 +815,10 @@ static int sriov_init(struct pci_dev *dev, int pos)
 
 	nres = 0;
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
-		res = &dev->resource[i + PCI_IOV_RESOURCES];
-		res_name = pci_resource_name(dev, i + PCI_IOV_RESOURCES);
+		int idx = pci_resource_num_from_vf_bar(i);
+
+		res = &dev->resource[idx];
+		res_name = pci_resource_name(dev, idx);
 
 		/*
 		 * If it is already FIXED, don't change it, something
@@ -871,7 +877,7 @@ static int sriov_init(struct pci_dev *dev, int pos)
 	dev->is_physfn = 0;
 failed:
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
-		res = &dev->resource[i + PCI_IOV_RESOURCES];
+		res = &dev->resource[pci_resource_num_from_vf_bar(i)];
 		res->flags = 0;
 	}
 
@@ -933,7 +939,7 @@ static void sriov_restore_state(struct pci_dev *dev)
 	pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, ctrl);
 
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++)
-		pci_update_resource(dev, i + PCI_IOV_RESOURCES);
+		pci_update_resource(dev, pci_resource_num_from_vf_bar(i));
 
 	pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz);
 	pci_iov_set_numvfs(dev, iov->num_VFs);
@@ -999,7 +1005,7 @@ void pci_iov_update_resource(struct pci_dev *dev, int resno)
 {
 	struct pci_sriov *iov = dev->is_physfn ? dev->sriov : NULL;
 	struct resource *res = pci_resource_n(dev, resno);
-	int vf_bar = resno - PCI_IOV_RESOURCES;
+	int vf_bar = pci_resource_num_to_vf_bar(resno);
 	struct pci_bus_region region;
 	u16 cmd;
 	u32 new;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 3bd507583c3fa..6f6db4afcc200 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -730,6 +730,14 @@ static inline bool pci_resource_is_iov(int resno)
 {
 	return resno >= PCI_IOV_RESOURCES && resno <= PCI_IOV_RESOURCE_END;
 }
+static inline int pci_resource_num_from_vf_bar(int resno)
+{
+	return resno + PCI_IOV_RESOURCES;
+}
+static inline int pci_resource_num_to_vf_bar(int resno)
+{
+	return resno - PCI_IOV_RESOURCES;
+}
 extern const struct attribute_group sriov_pf_dev_attr_group;
 extern const struct attribute_group sriov_vf_dev_attr_group;
 #else
@@ -758,6 +766,16 @@ static inline bool pci_resource_is_iov(int resno)
 {
 	return false;
 }
+static inline int pci_resource_num_from_vf_bar(int resno)
+{
+	WARN_ON_ONCE(1);
+	return -ENODEV;
+}
+static inline int pci_resource_num_to_vf_bar(int resno)
+{
+	WARN_ON_ONCE(1);
+	return -ENODEV;
+}
 #endif /* CONFIG_PCI_IOV */
 
 #ifdef CONFIG_PCIE_TPH
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 07c3d021a47ec..7853ac6999e2c 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1888,7 +1888,8 @@ static int iov_resources_unassigned(struct pci_dev *dev, void *data)
 	bool *unassigned = data;
 
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
-		struct resource *r = &dev->resource[i + PCI_IOV_RESOURCES];
+		int idx = pci_resource_num_from_vf_bar(i);
+		struct resource *r = &dev->resource[idx];
 		struct pci_bus_region region;
 
 		/* Not assigned or rejected by kernel? */
-- 
2.49.0


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

* [PATCH v10 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource()
  2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 1/5] PCI/IOV: Restore VF resizable BAR state after reset Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 2/5] PCI: Add a helper to convert between VF BAR number and IOV resource Michał Winiarski
@ 2025-07-02  9:35 ` Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 4/5] PCI/IOV: Check that VF BAR fits within the reservation Michał Winiarski
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michał Winiarski @ 2025-07-02  9:35 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel
  Cc: intel-xe, dri-devel, Christian König,
	Krzysztof Wilczyński, Ilpo Järvinen, Rodrigo Vivi,
	Michal Wajdeczko, Lucas De Marchi, Thomas Hellström,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Matt Roper, Michał Winiarski

Similar to regular resizable BAR, VF BAR can also be resized.

The capability layout is the same as PCI_EXT_CAP_ID_REBAR, which means
we can reuse most of the implementation, the only difference being
resource size calculation (which is multiplied by total VFs) and memory
decoding (which is controlled by a separate VF MSE field in SR-IOV cap).

Extend the pci_resize_resource() function to accept IOV resources.

See PCIe r6.2, sec 7.8.7.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/pci/iov.c       | 21 +++++++++++++++++++++
 drivers/pci/pci.c       |  8 +++++++-
 drivers/pci/pci.h       |  9 +++++++++
 drivers/pci/setup-res.c | 35 ++++++++++++++++++++++++++++++-----
 4 files changed, 67 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index bdac078045525..852424cf2ae15 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -154,6 +154,27 @@ resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno)
 	return dev->sriov->barsz[pci_resource_num_to_vf_bar(resno)];
 }
 
+void pci_iov_resource_set_size(struct pci_dev *dev, int resno,
+			       resource_size_t size)
+{
+	if (!pci_resource_is_iov(resno)) {
+		pci_warn(dev, "%s is not an IOV resource\n",
+			 pci_resource_name(dev, resno));
+		return;
+	}
+
+	dev->sriov->barsz[pci_resource_num_to_vf_bar(resno)] = size;
+}
+
+bool pci_iov_is_memory_decoding_enabled(struct pci_dev *dev)
+{
+	u16 cmd;
+
+	pci_read_config_word(dev, dev->sriov->pos + PCI_SRIOV_CTRL, &cmd);
+
+	return cmd & PCI_SRIOV_CTRL_MSE;
+}
+
 static void pci_read_vf_config_common(struct pci_dev *virtfn)
 {
 	struct pci_dev *physfn = virtfn->physfn;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e9448d55113bd..55695852975b4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3752,7 +3752,13 @@ static int pci_rebar_find_pos(struct pci_dev *pdev, int bar)
 	unsigned int pos, nbars, i;
 	u32 ctrl;
 
-	pos = pdev->rebar_cap;
+	if (pci_resource_is_iov(bar)) {
+		pos = pci_iov_vf_rebar_cap(pdev);
+		bar = pci_resource_num_to_vf_bar(bar);
+	} else {
+		pos = pdev->rebar_cap;
+	}
+
 	if (!pos)
 		return -ENOTSUPP;
 
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 6f6db4afcc200..c233601532711 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -719,6 +719,9 @@ void pci_iov_update_resource(struct pci_dev *dev, int resno);
 resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
 void pci_restore_iov_state(struct pci_dev *dev);
 int pci_iov_bus_range(struct pci_bus *bus);
+void pci_iov_resource_set_size(struct pci_dev *dev, int resno,
+			       resource_size_t size);
+bool pci_iov_is_memory_decoding_enabled(struct pci_dev *dev);
 static inline u16 pci_iov_vf_rebar_cap(struct pci_dev *dev)
 {
 	if (!dev->is_physfn)
@@ -758,6 +761,12 @@ static inline int pci_iov_bus_range(struct pci_bus *bus)
 {
 	return 0;
 }
+static inline void pci_iov_resource_set_size(struct pci_dev *dev, int resno,
+					     resource_size_t size) { }
+static inline bool pci_iov_is_memory_decoding_enabled(struct pci_dev *dev)
+{
+	return false;
+}
 static inline u16 pci_iov_vf_rebar_cap(struct pci_dev *dev)
 {
 	return 0;
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index c6657cdd06f67..d2b3ed51e8804 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -423,13 +423,39 @@ void pci_release_resource(struct pci_dev *dev, int resno)
 }
 EXPORT_SYMBOL(pci_release_resource);
 
+static bool pci_resize_is_memory_decoding_enabled(struct pci_dev *dev,
+						  int resno)
+{
+	u16 cmd;
+
+	if (pci_resource_is_iov(resno))
+		return pci_iov_is_memory_decoding_enabled(dev);
+
+	pci_read_config_word(dev, PCI_COMMAND, &cmd);
+
+	return cmd & PCI_COMMAND_MEMORY;
+}
+
+static void pci_resize_resource_set_size(struct pci_dev *dev, int resno,
+					 int size)
+{
+	resource_size_t res_size = pci_rebar_size_to_bytes(size);
+	struct resource *res = pci_resource_n(dev, resno);
+
+	if (!pci_resource_is_iov(resno)) {
+		resource_set_size(res, res_size);
+	} else {
+		resource_set_size(res, res_size * pci_sriov_get_totalvfs(dev));
+		pci_iov_resource_set_size(dev, resno, res_size);
+	}
+}
+
 int pci_resize_resource(struct pci_dev *dev, int resno, int size)
 {
 	struct resource *res = pci_resource_n(dev, resno);
 	struct pci_host_bridge *host;
 	int old, ret;
 	u32 sizes;
-	u16 cmd;
 
 	/* Check if we must preserve the firmware's resource assignment */
 	host = pci_find_host_bridge(dev->bus);
@@ -440,8 +466,7 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size)
 	if (!(res->flags & IORESOURCE_UNSET))
 		return -EBUSY;
 
-	pci_read_config_word(dev, PCI_COMMAND, &cmd);
-	if (cmd & PCI_COMMAND_MEMORY)
+	if (pci_resize_is_memory_decoding_enabled(dev, resno))
 		return -EBUSY;
 
 	sizes = pci_rebar_get_possible_sizes(dev, resno);
@@ -459,7 +484,7 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size)
 	if (ret)
 		return ret;
 
-	resource_set_size(res, pci_rebar_size_to_bytes(size));
+	pci_resize_resource_set_size(dev, resno, size);
 
 	/* Check if the new config works by trying to assign everything. */
 	if (dev->bus->self) {
@@ -471,7 +496,7 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size)
 
 error_resize:
 	pci_rebar_set_size(dev, resno, old);
-	resource_set_size(res, pci_rebar_size_to_bytes(old));
+	pci_resize_resource_set_size(dev, resno, old);
 	return ret;
 }
 EXPORT_SYMBOL(pci_resize_resource);
-- 
2.49.0


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

* [PATCH v10 4/5] PCI/IOV: Check that VF BAR fits within the reservation
  2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
                   ` (2 preceding siblings ...)
  2025-07-02  9:35 ` [PATCH v10 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource() Michał Winiarski
@ 2025-07-02  9:35 ` Michał Winiarski
  2025-07-02  9:35 ` [PATCH v10 5/5] PCI: Allow drivers to control VF BAR size Michał Winiarski
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michał Winiarski @ 2025-07-02  9:35 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel
  Cc: intel-xe, dri-devel, Christian König,
	Krzysztof Wilczyński, Ilpo Järvinen, Rodrigo Vivi,
	Michal Wajdeczko, Lucas De Marchi, Thomas Hellström,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Matt Roper, Michał Winiarski

When the resource representing VF MMIO BAR reservation is created, its
size is always large enough to accommodate the BAR of all SR-IOV Virtual
Functions that can potentially be created (total VFs). If for whatever
reason it's not possible to accommodate all VFs - the resource is not
assigned and no VFs can be created.

An upcoming change will allow VF BAR size to be modified by drivers at
a later point in time, which means that the check for resource
assignment is no longer sufficient.

Add an additional check that verifies that VF BAR for all enabled VFs
fits within the underlying reservation resource.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/pci/iov.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 852424cf2ae15..f34173c70b32a 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -668,9 +668,12 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
 	nres = 0;
 	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
 		int idx = pci_resource_num_from_vf_bar(i);
+		resource_size_t vf_bar_sz = pci_iov_resource_size(dev, idx);
 
 		bars |= (1 << idx);
 		res = &dev->resource[idx];
+		if (vf_bar_sz * nr_virtfn > resource_size(res))
+			continue;
 		if (res->parent)
 			nres++;
 	}
-- 
2.49.0


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

* [PATCH v10 5/5] PCI: Allow drivers to control VF BAR size
  2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
                   ` (3 preceding siblings ...)
  2025-07-02  9:35 ` [PATCH v10 4/5] PCI/IOV: Check that VF BAR fits within the reservation Michał Winiarski
@ 2025-07-02  9:35 ` Michał Winiarski
  2025-07-14  9:39 ` [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
  2025-07-14 20:05 ` Bjorn Helgaas
  6 siblings, 0 replies; 8+ messages in thread
From: Michał Winiarski @ 2025-07-02  9:35 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel
  Cc: intel-xe, dri-devel, Christian König,
	Krzysztof Wilczyński, Ilpo Järvinen, Rodrigo Vivi,
	Michal Wajdeczko, Lucas De Marchi, Thomas Hellström,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Matt Roper, Michał Winiarski

Drivers could leverage the fact that the VF BAR MMIO reservation is
created for total number of VFs supported by the device by resizing the
BAR to larger size when smaller number of VFs is enabled.

Add a pci_iov_vf_bar_set_size() function to control the size and a
pci_iov_vf_bar_get_sizes() helper to get the VF BAR sizes that will
allow up to num_vfs to be successfully enabled with the current
underlying reservation size.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/pci/iov.c   | 73 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/pci.h |  6 ++++
 2 files changed, 79 insertions(+)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index f34173c70b32a..ac4375954c947 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -8,11 +8,15 @@
  */
 
 #include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/log2.h>
 #include <linux/pci.h>
+#include <linux/sizes.h>
 #include <linux/slab.h>
 #include <linux/export.h>
 #include <linux/string.h>
 #include <linux/delay.h>
+#include <asm/div64.h>
 #include "pci.h"
 
 #define VIRTFN_ID_LEN	17	/* "virtfn%u\0" for 2^32 - 1 */
@@ -1313,3 +1317,72 @@ int pci_sriov_configure_simple(struct pci_dev *dev, int nr_virtfn)
 	return nr_virtfn;
 }
 EXPORT_SYMBOL_GPL(pci_sriov_configure_simple);
+
+/**
+ * pci_iov_vf_bar_set_size - set a new size for a VF BAR
+ * @dev: the PCI device
+ * @resno: the resource number
+ * @size: new size as defined in the spec (0=1MB, 31=128TB)
+ *
+ * Set the new size of a VF BAR that supports VF resizable BAR capability.
+ * Unlike pci_resize_resource(), this does not cause the resource that
+ * reserves the MMIO space (originally up to total_VFs) to be resized, which
+ * means that following calls to pci_enable_sriov() can fail if the resources
+ * no longer fit.
+ *
+ * Return: 0 on success, or negative on failure.
+ */
+int pci_iov_vf_bar_set_size(struct pci_dev *dev, int resno, int size)
+{
+	u32 sizes;
+	int ret;
+
+	if (!pci_resource_is_iov(resno))
+		return -EINVAL;
+
+	if (pci_iov_is_memory_decoding_enabled(dev))
+		return -EBUSY;
+
+	sizes = pci_rebar_get_possible_sizes(dev, resno);
+	if (!sizes)
+		return -ENOTSUPP;
+
+	if (!(sizes & BIT(size)))
+		return -EINVAL;
+
+	ret = pci_rebar_set_size(dev, resno, size);
+	if (ret)
+		return ret;
+
+	pci_iov_resource_set_size(dev, resno, pci_rebar_size_to_bytes(size));
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(pci_iov_vf_bar_set_size);
+
+/**
+ * pci_iov_vf_bar_get_sizes - get VF BAR sizes allowing to create up to num_vfs
+ * @dev: the PCI device
+ * @resno: the resource number
+ * @num_vfs: number of VFs
+ *
+ * Get the sizes of a VF resizable BAR that can accommodate @num_vfs within
+ * the currently assigned size of the resource @resno.
+ *
+ * Return: A bitmask of sizes in format defined in the spec (bit 0=1MB,
+ * bit 31=128TB).
+ */
+u32 pci_iov_vf_bar_get_sizes(struct pci_dev *dev, int resno, int num_vfs)
+{
+	u64 vf_len = pci_resource_len(dev, resno);
+	u32 sizes;
+
+	if (!num_vfs)
+		return 0;
+
+	do_div(vf_len, num_vfs);
+	sizes = (roundup_pow_of_two(vf_len + 1) - 1) >> ilog2(SZ_1M);
+
+	return sizes & pci_rebar_get_possible_sizes(dev, resno);
+}
+EXPORT_SYMBOL_GPL(pci_iov_vf_bar_get_sizes);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 05e68f35f3923..28f06045ab200 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2438,6 +2438,8 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
 int pci_sriov_get_totalvfs(struct pci_dev *dev);
 int pci_sriov_configure_simple(struct pci_dev *dev, int nr_virtfn);
 resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno);
+int pci_iov_vf_bar_set_size(struct pci_dev *dev, int resno, int size);
+u32 pci_iov_vf_bar_get_sizes(struct pci_dev *dev, int resno, int num_vfs);
 void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool probe);
 
 /* Arch may override these (weak) */
@@ -2490,6 +2492,10 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
 #define pci_sriov_configure_simple	NULL
 static inline resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno)
 { return 0; }
+static inline int pci_iov_vf_bar_set_size(struct pci_dev *dev, int resno, int size)
+{ return -ENODEV; }
+static inline u32 pci_iov_vf_bar_get_sizes(struct pci_dev *dev, int resno, int num_vfs)
+{ return 0; }
 static inline void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool probe) { }
 #endif
 
-- 
2.49.0


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

* Re: [PATCH v10 0/5] PCI: VF resizable BAR
  2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
                   ` (4 preceding siblings ...)
  2025-07-02  9:35 ` [PATCH v10 5/5] PCI: Allow drivers to control VF BAR size Michał Winiarski
@ 2025-07-14  9:39 ` Michał Winiarski
  2025-07-14 20:05 ` Bjorn Helgaas
  6 siblings, 0 replies; 8+ messages in thread
From: Michał Winiarski @ 2025-07-14  9:39 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, linux-kernel, intel-xe, dri-devel,
	Christian König, Krzysztof Wilczyński,
	Ilpo Järvinen, Rodrigo Vivi, Michal Wajdeczko,
	Lucas De Marchi, Thomas Hellström, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Matt Roper

On Wed, Jul 02, 2025 at 11:35:17AM +0200, Michał Winiarski wrote:
> Hi,
> 
> The series is now reviewed, and it looks like there's no further
> feedback.
> To limit it to PCI subsystem, I removed the last patch in the series, as
> it contained changes in drm/xe driver (it can still be found in v9 for
> reference, and I expect that this single patch will go through DRM tree
> anyways).
> 
> v9 can be found here:
> https://lore.kernel.org/linux-pci/20250527120637.665506-1-michal.winiarski@intel.com/
> 
> For regular BAR, drivers can use pci_resize_resource to resize it to the
> desired size provided that it is supported by the hardware, which the
> driver can query using pci_rebar_get_possible_sizes.
> This series expands the API to work with IOV BAR as well.
> It also adds the additional API for drivers to change the VF BAR size
> without resizing the entire underlying reservation (within the original
> resource boundary).


Hi Bjorn,

Can you consider applying this series?
Or do you still have some comments?

Thanks,
-Michał

> 
> Thanks,
> -Michał
> 
> v9 -> v10:
> - Remove last patch with drm/xe changes
> 
> v8 -> v9:
> - Use u64 as do_div() dividend (LKP)
> - Introduce a helper to access cached vf_rebar_cap (LKP)
> 
> v7 -> v8:
> - Update variable ordering and missing includes (Ilpo)
> 
> v6 -> v7:
> - Eliminate the loop in pci_iov_vf_bar_get_sizes() (Ilpo)
> - Use helper variable for indexes (Ilpo)
> - Kerneldoc formatting (Ilpo)
> - Refer to latest PCI spec (Ilpo)
> - Commit message wording (Ilpo)
> 
> v5 -> v6:
> - Rebased on latest pci/next
> - Cache the VF resizable BAR capability position to avoid multiple
>   lookups (Ilpo)
> - Use pci_resource_n helper (Ilpo)
> 
> v4 -> v5:
> - Rename pci_resource_to/from_iov helpers and add WARN if called without
>   CONFIG_PCI_IOV (Ilpo)
> - Reword kerneldoc for pci_iov_vf_bar_get_sizes (Bjorn)
> - Reword commit message for VF BAR size check, extract the additional
>   size check to separate conditional (Bjorn)
> 
> v3 -> v4:
> - Change the approach to extending the BAR (Christian)
> - Tidy the commit messages, use 80 line limit where necessary (Bjorn)
> - Add kerneldocs to exported functions (Bjorn)
> - Add pci_resource_to_iov() / pci_resource_from_iov() helpers (Ilpo)
> - Use FIELD_GET(), tidy whitespace (Ilpo)
> 
> v2 -> v3:
> - Extract introducing pci_resource_is_iov to separate commit and
>   use it elsewhere in PCI subsystem (Christian)
> - Extract restoring VF rebar state to separate commit (Christian)
> - Reorganize memory decoding check (Christian)
> - Don't use dev_WARN (Ilpo)
> - Fix build without CONFIG_PCI_IOV (CI)
> 
> v1 -> v2:
> - Add pci_iov_resource_extend() and usage in Xe driver
> - Reduce the number of ifdefs (Christian)
> - Drop patch 2/2 from v1 (Christian)
> - Add a helper to avoid upsetting static analysis tools (Krzysztof)
> 
> Michał Winiarski (5):
>   PCI/IOV: Restore VF resizable BAR state after reset
>   PCI: Add a helper to convert between VF BAR number and IOV resource
>   PCI: Allow IOV resources to be resized in pci_resize_resource()
>   PCI/IOV: Check that VF BAR fits within the reservation
>   PCI: Allow drivers to control VF BAR size
> 
>  drivers/pci/iov.c             | 153 +++++++++++++++++++++++++++++++---
>  drivers/pci/pci.c             |   8 +-
>  drivers/pci/pci.h             |  39 +++++++++
>  drivers/pci/setup-bus.c       |   3 +-
>  drivers/pci/setup-res.c       |  35 ++++++--
>  include/linux/pci.h           |   6 ++
>  include/uapi/linux/pci_regs.h |   9 ++
>  7 files changed, 235 insertions(+), 18 deletions(-)
> 
> -- 
> 2.49.0
> 

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

* Re: [PATCH v10 0/5] PCI: VF resizable BAR
  2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
                   ` (5 preceding siblings ...)
  2025-07-14  9:39 ` [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
@ 2025-07-14 20:05 ` Bjorn Helgaas
  6 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2025-07-14 20:05 UTC (permalink / raw)
  To: Michał Winiarski
  Cc: Bjorn Helgaas, linux-pci, linux-kernel, intel-xe, dri-devel,
	Christian König, Krzysztof Wilczyński,
	Ilpo Järvinen, Rodrigo Vivi, Michal Wajdeczko,
	Lucas De Marchi, Thomas Hellström, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Matt Roper

On Wed, Jul 02, 2025 at 11:35:17AM +0200, Michał Winiarski wrote:
> Hi,
> 
> The series is now reviewed, and it looks like there's no further
> feedback.
> To limit it to PCI subsystem, I removed the last patch in the series, as
> it contained changes in drm/xe driver (it can still be found in v9 for
> reference, and I expect that this single patch will go through DRM tree
> anyways).
> 
> v9 can be found here:
> https://lore.kernel.org/linux-pci/20250527120637.665506-1-michal.winiarski@intel.com/
> 
> For regular BAR, drivers can use pci_resize_resource to resize it to the
> desired size provided that it is supported by the hardware, which the
> driver can query using pci_rebar_get_possible_sizes.
> This series expands the API to work with IOV BAR as well.
> It also adds the additional API for drivers to change the VF BAR size
> without resizing the entire underlying reservation (within the original
> resource boundary).
> 
> Thanks,
> -Michał
> 
> v9 -> v10:
> - Remove last patch with drm/xe changes
> 
> v8 -> v9:
> - Use u64 as do_div() dividend (LKP)
> - Introduce a helper to access cached vf_rebar_cap (LKP)
> 
> v7 -> v8:
> - Update variable ordering and missing includes (Ilpo)
> 
> v6 -> v7:
> - Eliminate the loop in pci_iov_vf_bar_get_sizes() (Ilpo)
> - Use helper variable for indexes (Ilpo)
> - Kerneldoc formatting (Ilpo)
> - Refer to latest PCI spec (Ilpo)
> - Commit message wording (Ilpo)
> 
> v5 -> v6:
> - Rebased on latest pci/next
> - Cache the VF resizable BAR capability position to avoid multiple
>   lookups (Ilpo)
> - Use pci_resource_n helper (Ilpo)
> 
> v4 -> v5:
> - Rename pci_resource_to/from_iov helpers and add WARN if called without
>   CONFIG_PCI_IOV (Ilpo)
> - Reword kerneldoc for pci_iov_vf_bar_get_sizes (Bjorn)
> - Reword commit message for VF BAR size check, extract the additional
>   size check to separate conditional (Bjorn)
> 
> v3 -> v4:
> - Change the approach to extending the BAR (Christian)
> - Tidy the commit messages, use 80 line limit where necessary (Bjorn)
> - Add kerneldocs to exported functions (Bjorn)
> - Add pci_resource_to_iov() / pci_resource_from_iov() helpers (Ilpo)
> - Use FIELD_GET(), tidy whitespace (Ilpo)
> 
> v2 -> v3:
> - Extract introducing pci_resource_is_iov to separate commit and
>   use it elsewhere in PCI subsystem (Christian)
> - Extract restoring VF rebar state to separate commit (Christian)
> - Reorganize memory decoding check (Christian)
> - Don't use dev_WARN (Ilpo)
> - Fix build without CONFIG_PCI_IOV (CI)
> 
> v1 -> v2:
> - Add pci_iov_resource_extend() and usage in Xe driver
> - Reduce the number of ifdefs (Christian)
> - Drop patch 2/2 from v1 (Christian)
> - Add a helper to avoid upsetting static analysis tools (Krzysztof)
> 
> Michał Winiarski (5):
>   PCI/IOV: Restore VF resizable BAR state after reset
>   PCI: Add a helper to convert between VF BAR number and IOV resource
>   PCI: Allow IOV resources to be resized in pci_resize_resource()
>   PCI/IOV: Check that VF BAR fits within the reservation
>   PCI: Allow drivers to control VF BAR size
> 
>  drivers/pci/iov.c             | 153 +++++++++++++++++++++++++++++++---
>  drivers/pci/pci.c             |   8 +-
>  drivers/pci/pci.h             |  39 +++++++++
>  drivers/pci/setup-bus.c       |   3 +-
>  drivers/pci/setup-res.c       |  35 ++++++--
>  include/linux/pci.h           |   6 ++
>  include/uapi/linux/pci_regs.h |   9 ++
>  7 files changed, 235 insertions(+), 18 deletions(-)

Applied to pci/resources for v6.17, thanks for the reminder!

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

end of thread, other threads:[~2025-07-14 20:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02  9:35 [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
2025-07-02  9:35 ` [PATCH v10 1/5] PCI/IOV: Restore VF resizable BAR state after reset Michał Winiarski
2025-07-02  9:35 ` [PATCH v10 2/5] PCI: Add a helper to convert between VF BAR number and IOV resource Michał Winiarski
2025-07-02  9:35 ` [PATCH v10 3/5] PCI: Allow IOV resources to be resized in pci_resize_resource() Michał Winiarski
2025-07-02  9:35 ` [PATCH v10 4/5] PCI/IOV: Check that VF BAR fits within the reservation Michał Winiarski
2025-07-02  9:35 ` [PATCH v10 5/5] PCI: Allow drivers to control VF BAR size Michał Winiarski
2025-07-14  9:39 ` [PATCH v10 0/5] PCI: VF resizable BAR Michał Winiarski
2025-07-14 20:05 ` Bjorn Helgaas

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).