[PATCH v4 0/8] hw/vfio: single-binary

Pierrick Bouvier posted 8 patches 1 week, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260317194241.869568-1-pierrick.bouvier@linaro.org
Maintainers: Tony Krowiak <akrowiak@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Jason Herne <jjherne@linux.ibm.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Paolo Bonzini <pbonzini@redhat.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Christian Borntraeger <borntraeger@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>
There is a newer version of this series
meson.build                  |   2 +-
hw/vfio/kvm-spapr.h          |  12 +++
hw/vfio/pci.h                |   2 +
target/s390x/kvm/kvm_s390x.h |   2 +-
hw/vfio/ap.c                 |  11 +-
hw/vfio/ccw.c                |   9 --
hw/vfio/helpers.c            | 172 -------------------------------
hw/vfio/igd-stubs.c          |  20 ++++
hw/vfio/kvm-helpers.c        | 192 +++++++++++++++++++++++++++++++++++
hw/vfio/kvm-spapr.c          |  47 +++++++++
hw/vfio/kvm-stubs.c          |  34 +++++++
hw/vfio/listener.c           |   4 -
hw/vfio/pci-quirks.c         |   5 -
hw/vfio/pci.c                |  39 ++-----
hw/vfio/spapr.c              |  30 +-----
hw/vfio/meson.build          |   6 +-
16 files changed, 329 insertions(+), 258 deletions(-)
create mode 100644 hw/vfio/kvm-spapr.h
create mode 100644 hw/vfio/igd-stubs.c
create mode 100644 hw/vfio/kvm-helpers.c
create mode 100644 hw/vfio/kvm-spapr.c
create mode 100644 hw/vfio/kvm-stubs.c
[PATCH v4 0/8] hw/vfio: single-binary
Posted by Pierrick Bouvier 1 week, 2 days ago
This series makes changes to hw/vfio to compile files only once.
Changes are pretty straightforward and are mostly extraction of kvm/other config
specific functions to proper files.
This is the last hw/* subsystem that needs to be changed for single-binary.

v4
--

- rewrite commit description for "hw/vfio: eradicate CONFIG_IOMMU from sources"

v2 (sent as v3)
---------------

- use global stub_ss (fix some missing dependencies in this case)
- move kvm_enabled() guard check on function calls
- s/Vfio spapr kvm/VFIO sPAPR KVM/

Pierrick Bouvier (8):
  hw/vfio/listener.c: remove CONFIG_KVM
  hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
  hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
  hw/vfio: eradicate CONFIG_IOMMU from sources
  hw/vfio/pci.c: eradicate CONFIG_KVM
  hw/vfio/ap.c: use full path for target specific header
  hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to
    hw/vfio/kvm-spapr.c
  hw/vfio: all vfio files can now be common files

 meson.build                  |   2 +-
 hw/vfio/kvm-spapr.h          |  12 +++
 hw/vfio/pci.h                |   2 +
 target/s390x/kvm/kvm_s390x.h |   2 +-
 hw/vfio/ap.c                 |  11 +-
 hw/vfio/ccw.c                |   9 --
 hw/vfio/helpers.c            | 172 -------------------------------
 hw/vfio/igd-stubs.c          |  20 ++++
 hw/vfio/kvm-helpers.c        | 192 +++++++++++++++++++++++++++++++++++
 hw/vfio/kvm-spapr.c          |  47 +++++++++
 hw/vfio/kvm-stubs.c          |  34 +++++++
 hw/vfio/listener.c           |   4 -
 hw/vfio/pci-quirks.c         |   5 -
 hw/vfio/pci.c                |  39 ++-----
 hw/vfio/spapr.c              |  30 +-----
 hw/vfio/meson.build          |   6 +-
 16 files changed, 329 insertions(+), 258 deletions(-)
 create mode 100644 hw/vfio/kvm-spapr.h
 create mode 100644 hw/vfio/igd-stubs.c
 create mode 100644 hw/vfio/kvm-helpers.c
 create mode 100644 hw/vfio/kvm-spapr.c
 create mode 100644 hw/vfio/kvm-stubs.c

-- 
2.47.3
Re: [PATCH v4 0/8] hw/vfio: single-binary
Posted by Pierrick Bouvier 1 week, 1 day ago
On 3/17/26 12:42 PM, Pierrick Bouvier wrote:
> This series makes changes to hw/vfio to compile files only once.
> Changes are pretty straightforward and are mostly extraction of kvm/other config
> specific functions to proper files.
> This is the last hw/* subsystem that needs to be changed for single-binary.
> 
> v4
> --
> 
> - rewrite commit description for "hw/vfio: eradicate CONFIG_IOMMU from sources"
> 
> v2 (sent as v3)
> ---------------
> 
> - use global stub_ss (fix some missing dependencies in this case)
> - move kvm_enabled() guard check on function calls
> - s/Vfio spapr kvm/VFIO sPAPR KVM/
> 
> Pierrick Bouvier (8):
>    hw/vfio/listener.c: remove CONFIG_KVM
>    hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
>    hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
>    hw/vfio: eradicate CONFIG_IOMMU from sources
>    hw/vfio/pci.c: eradicate CONFIG_KVM
>    hw/vfio/ap.c: use full path for target specific header
>    hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to
>      hw/vfio/kvm-spapr.c
>    hw/vfio: all vfio files can now be common files
> 
>   meson.build                  |   2 +-
>   hw/vfio/kvm-spapr.h          |  12 +++
>   hw/vfio/pci.h                |   2 +
>   target/s390x/kvm/kvm_s390x.h |   2 +-
>   hw/vfio/ap.c                 |  11 +-
>   hw/vfio/ccw.c                |   9 --
>   hw/vfio/helpers.c            | 172 -------------------------------
>   hw/vfio/igd-stubs.c          |  20 ++++
>   hw/vfio/kvm-helpers.c        | 192 +++++++++++++++++++++++++++++++++++
>   hw/vfio/kvm-spapr.c          |  47 +++++++++
>   hw/vfio/kvm-stubs.c          |  34 +++++++
>   hw/vfio/listener.c           |   4 -
>   hw/vfio/pci-quirks.c         |   5 -
>   hw/vfio/pci.c                |  39 ++-----
>   hw/vfio/spapr.c              |  30 +-----
>   hw/vfio/meson.build          |   6 +-
>   16 files changed, 329 insertions(+), 258 deletions(-)
>   create mode 100644 hw/vfio/kvm-spapr.h
>   create mode 100644 hw/vfio/igd-stubs.c
>   create mode 100644 hw/vfio/kvm-helpers.c
>   create mode 100644 hw/vfio/kvm-spapr.c
>   create mode 100644 hw/vfio/kvm-stubs.c
> 

Sent v5, with commit description fix and rebase on top of master:
https://lore.kernel.org/qemu-devel/20260318174733.1717643-1-pierrick.bouvier@linaro.org/T/#t

@Cédric, this should give you a clean series to apply when the tree will 
reopen.

Thanks,
Pierrick

Re: [PATCH v4 0/8] hw/vfio: single-binary
Posted by Philippe Mathieu-Daudé 1 week, 1 day ago
On 17/3/26 20:42, Pierrick Bouvier wrote:

> Pierrick Bouvier (8):
>    hw/vfio/listener.c: remove CONFIG_KVM
>    hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
>    hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
>    hw/vfio: eradicate CONFIG_IOMMU from sources
>    hw/vfio/pci.c: eradicate CONFIG_KVM
>    hw/vfio/ap.c: use full path for target specific header
>    hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to
>      hw/vfio/kvm-spapr.c
>    hw/vfio: all vfio files can now be common files

Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH v4 0/8] hw/vfio: single-binary
Posted by Pierrick Bouvier 1 week, 1 day ago
On 3/17/26 10:57 PM, Philippe Mathieu-Daudé wrote:
> On 17/3/26 20:42, Pierrick Bouvier wrote:
> 
>> Pierrick Bouvier (8):
>>     hw/vfio/listener.c: remove CONFIG_KVM
>>     hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
>>     hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
>>     hw/vfio: eradicate CONFIG_IOMMU from sources
>>     hw/vfio/pci.c: eradicate CONFIG_KVM
>>     hw/vfio/ap.c: use full path for target specific header
>>     hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to
>>       hw/vfio/kvm-spapr.c
>>     hw/vfio: all vfio files can now be common files
> 
> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 

For some reason, b4 trailers does not apply this. I added it manually on 
latest patch of series.

Regards,
Pierrick

Re: [PATCH v4 0/8] hw/vfio: single-binary
Posted by Philippe Mathieu-Daudé 1 week ago
On 18/3/26 18:48, Pierrick Bouvier wrote:
> On 3/17/26 10:57 PM, Philippe Mathieu-Daudé wrote:
>> On 17/3/26 20:42, Pierrick Bouvier wrote:
>>
>>> Pierrick Bouvier (8):
>>>     hw/vfio/listener.c: remove CONFIG_KVM
>>>     hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
>>>     hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
>>>     hw/vfio: eradicate CONFIG_IOMMU from sources
>>>     hw/vfio/pci.c: eradicate CONFIG_KVM
>>>     hw/vfio/ap.c: use full path for target specific header
>>>     hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to
>>>       hw/vfio/kvm-spapr.c
>>>     hw/vfio: all vfio files can now be common files
>>
>> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
> 
> For some reason, b4 trailers does not apply this. I added it manually on 
> latest patch of series.

Sorry for the inconvenience.

Maybe I should have prefixed with "Series:"?

Also there is the '-t' option:

   -t, --apply-cover-trailers
      Apply trailers sent to the cover letter to all patches

> Regards,
> Pierrick


Re: [PATCH v4 0/8] hw/vfio: single-binary
Posted by Pierrick Bouvier 1 week ago
On 3/19/26 12:39 AM, Philippe Mathieu-Daudé wrote:
> On 18/3/26 18:48, Pierrick Bouvier wrote:
>> On 3/17/26 10:57 PM, Philippe Mathieu-Daudé wrote:
>>> On 17/3/26 20:42, Pierrick Bouvier wrote:
>>>
>>>> Pierrick Bouvier (8):
>>>>      hw/vfio/listener.c: remove CONFIG_KVM
>>>>      hw/vfio/helpers.c: extract kvm helpers in kvm-helpers.c
>>>>      hw/vfio/pci-quirks.c: remove CONFIG_VFIO_IGD
>>>>      hw/vfio: eradicate CONFIG_IOMMU from sources
>>>>      hw/vfio/pci.c: eradicate CONFIG_KVM
>>>>      hw/vfio/ap.c: use full path for target specific header
>>>>      hw/vfio/spapr.c: extract vfio_spapr_kvm_attach_tce to
>>>>        hw/vfio/kvm-spapr.c
>>>>      hw/vfio: all vfio files can now be common files
>>>
>>> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>>
>>
>> For some reason, b4 trailers does not apply this. I added it manually on
>> latest patch of series.
> 
> Sorry for the inconvenience.
> 
> Maybe I should have prefixed with "Series:"?
> 
> Also there is the '-t' option:
> 
>     -t, --apply-cover-trailers
>        Apply trailers sent to the cover letter to all patches
>

Unfortunately, this is available only with b4 shazam, and not b4 
trailers that I use.

>> Regards,
>> Pierrick
>