Re: [PATCH v5 8/8] hw/vfio: all vfio files can now be common files
Pierrick Bouvier <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
On 8/17/2026 11:18 PM, Andreas Grapentin wrote: > On Mar 18 26, Pierrick Bouvier wrote: >> -specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) >> +system_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) > > Apologies for digging out this old thread, but parts of the vfio code > need linux/kvm.h, which includes asm/kvm.h. Consequently it can only be > fully architecture agnostic based on the assumption that KVM will only > ever be able to support one guest architecture which must be the same as > the host architecture. > > On s390x, we are currently working on a KVM change that breaks this > assumption: > https://lore.kernel.org/all/[email protected]/ > > We are in the process of working out what changes this would require on > the qemu side, and will send a patch series soon for discussion, but > we've noticed that this patch series in particular was a breaking change > for us when moving to v11.1. > > Fortunately, this series also extracted the architecture dependent code > in VFIO into the kvm-helpers.c file, so for us the most obvious solution > would be to keep kvm-helpers.c in specific_ss, while the rest of vfio > can go to system_ss. Would that be acceptable? > Thanks for asking. It would be better to keep it as system_ss, since bringing back specific_ss will break the single-binary compilation. It should not be needed to rely on target config within the C file directly. At least, we didn't meet any situation where it was. That said, there is nothing in CI (yet) that prevent such regression, but I would appreciate if you could keep it as it is for now. If you need to filter a specific function per config (host/target/whatever), the right way is to isolate this in a new file, and condition inclusion from build system instead. system_ss.add_all(when: 'CONFIG_X', if_true: [newfile.c]) Also, you can add associated stubs for other configs in stub_ss. stub_ss.add(files('newfile-stubs.c')) I don't know the details of the series you sent (and too big for me to take a look now), but if you have a precise question on a specific patch, feel free to reach out to me by email. > Thanks, > Andreas > Regards, Pierrick