mbox series

[v2,0/2] Use setup ROM as fallback for ROM bar

Message ID 20250102185013.15082-1-Yunxiang.Li@amd.com (mailing list archive)
Headers show
Series Use setup ROM as fallback for ROM bar | expand

Message

Yunxiang Li Jan. 2, 2025, 6:50 p.m. UTC
On some servers the upstream bridge does not have enough address window
for the ROM bar, currently this will result in the vdev not having a ROM
bar and this causes issues if ROM content is needed by the guest driver.

On x86 the device's ROM may be passed via setup data to pdev->rom, so it
can be used as a fallback. However, it can't be exposed transparently as
a PCI resource like the shadow ROM, because it is not aligned to power
of two boundaries. So special handling need to be added in vfio to make
use of this data just like in the GPU drivers.

Yunxiang Li (2):
  vfio/pci: Remove shadow ROM specific code paths
  vfio/pci: Expose setup ROM at ROM bar when needed

 drivers/vfio/pci/vfio_pci_config.c |  8 +++---
 drivers/vfio/pci/vfio_pci_core.c   | 40 ++++++++++++++----------------
 drivers/vfio/pci/vfio_pci_rdwr.c   | 25 ++++++++++++-------
 3 files changed, 38 insertions(+), 35 deletions(-)

Comments

Alex Williamson Jan. 6, 2025, 4:28 p.m. UTC | #1
On Thu, 2 Jan 2025 13:50:11 -0500
Yunxiang Li <Yunxiang.Li@amd.com> wrote:

> On some servers the upstream bridge does not have enough address window
> for the ROM bar, currently this will result in the vdev not having a ROM
> bar and this causes issues if ROM content is needed by the guest driver.
> 
> On x86 the device's ROM may be passed via setup data to pdev->rom, so it
> can be used as a fallback. However, it can't be exposed transparently as
> a PCI resource like the shadow ROM, because it is not aligned to power
> of two boundaries. So special handling need to be added in vfio to make
> use of this data just like in the GPU drivers.
> 
> Yunxiang Li (2):
>   vfio/pci: Remove shadow ROM specific code paths
>   vfio/pci: Expose setup ROM at ROM bar when needed
> 
>  drivers/vfio/pci/vfio_pci_config.c |  8 +++---
>  drivers/vfio/pci/vfio_pci_core.c   | 40 ++++++++++++++----------------
>  drivers/vfio/pci/vfio_pci_rdwr.c   | 25 ++++++++++++-------
>  3 files changed, 38 insertions(+), 35 deletions(-)
> 

Applied to vfio next branch for v6.14.  Thanks,

Alex