[PATCH v2 0/3] vfio/igd: VFIOConfigMirrorQuirk for igd mirrored registers

Tomita Moeko posted 3 patches 2 months, 3 weeks ago
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
[PATCH v2 0/3] vfio/igd: VFIOConfigMirrorQuirk for igd mirrored registers
Posted by Tomita Moeko 2 months, 3 weeks ago
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

-- 
2.45.2
Re: [PATCH v2 0/3] vfio/igd: VFIOConfigMirrorQuirk for igd mirrored registers
Posted by Cédric Le Goater 2 months, 2 weeks ago
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.
Re: [PATCH v2 0/3] vfio/igd: VFIOConfigMirrorQuirk for igd mirrored registers
Posted by Alex Williamson 2 months, 2 weeks ago
On Sat,  4 Jan 2025 23:42:15 +0800
Tomita Moeko <tomitamoeko@gmail.com> 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
> 

Reviewed-by: Alex Williamson <alex.williamson@redhat.com>