On 1/4/25 16:42, Tomita Moeko wrote:
> In commit 1a2623b5c9e7 ("vfio/igd: add macro for declaring mirrored
> registers"), I introduced a macro to handle mirrored registers in igd
> bar0. However, using the existing VFIOConfigMirrorQuirk should be a
> better approach I think after going through the vfio code.
>
> This patch set introduces a new header file, pci-quirks.h, to hold
> generic quirk declarations, and extends VFIOConfigMirrorQuirk to
> support offsets in PCI config space. This eliminates the need for
> the previously introduced macro.
>
> Changelog:
> v2:
> * Removed 'const Property' change, it was a mistake in rebasing.
> * Removed unnecessary initializing config_offset explicitly.
> * Separated GGC and BDSM mirror into 2 quirks.
> Link: https://lore.kernel.org/all/20241231151953.59992-1-tomitamoeko@gmail.com/
>
> Tomita Moeko (3):
> vfio/pci: declare generic quirks in a new header file
> vfio/pci: introduce config_offset field in VFIOConfigMirrorQuirk
> vfio/igd: use VFIOConfigMirrorQuirk for mirrored registers
>
> hw/vfio/igd.c | 125 +++++++++++--------------------------------
> hw/vfio/pci-quirks.c | 57 +++-----------------
> hw/vfio/pci-quirks.h | 72 +++++++++++++++++++++++++
> 3 files changed, 109 insertions(+), 145 deletions(-)
> create mode 100644 hw/vfio/pci-quirks.h
>
Applied to vfio-next.
Thanks,
C.