accel: Remove system-mode stubs from user-mode builds
Subsystems (2)
cover accel: Remove system-mode stubs from user-mode builds
It is pointless to build/link these stubs into user-mode binaries.
Philippe Mathieu-Daudé (3):
accel: Only include TCG stubs in user-mode only builds accel/stubs: Restrict system-mode emulation stubs accel/stubs: Simplify kvm-stub.c
accel/stubs/kvm-stub.c | 5 ----- accel/meson.build | 10 ++++++---- accel/stubs/meson.build | 12 ++++++++---- 3 files changed, 14 insertions(+), 13 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/3 accel: Only include TCG stubs in user-mode only builds
We only require TCG stubs in user-mode emulation. Do not build stubs restricted to system-mode emulation in a user-mode only build.
--- accel/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
accel/meson.build +6 -4
@@ -1,10 +1,12 @@ softmmu_ss.add(files('accel.c')) -subdir('qtest') -subdir('kvm') subdir('tcg') -subdir('xen') -subdir('stubs') +if have_system + subdir('qtest') + subdir('kvm') + subdir('xen') + subdir('stubs') +endif dummy_ss = ss.source_set() dummy_ss.add(files(
Signature · 1 line
2.26.2
Re: [PATCH 1/3] accel: Only include TCG stubs in user-mode only builds
Quoted 21 lines · Philippe Mathieu-Daudé
We only require TCG stubs in user-mode emulation. Do not build stubs restricted to system-mode emulation in a user-mode only build.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)accel/meson.build +0
-3@@ -1,10 +1,12 @@ softmmu_ss.add(files('accel.c')) -subdir('qtest') -subdir('kvm') subdir('tcg') -subdir('xen')
accel/meson.build line 12
Quoted 10 lines
accel/meson.build +6
-1-subdir('stubs') +if have_system + subdir('qtest') + subdir('kvm') + subdir('xen') + subdir('stubs') +endif dummy_ss = ss.source_set() dummy_ss.add(files(
Ciao Philippe,
I thought that the pattern used by Paolo was, recurse always, and put the check inside the recursed dir meson.build . Paolo did you indeed intend meson use this way?
Ciao,
Claudio
Paolo Bonzini
maintainerRe: [PATCH 1/3] accel: Only include TCG stubs in user-mode only builds
Quoted 5 lines · Claudio Fontana
Ciao Philippe,
I thought that the pattern used by Paolo was, recurse always, and put the check inside the recursed dir meson.build . Paolo did you indeed intend meson use this way?
Generally yeah, I preferred to recurse always. In this specific case, however, an even bigger qualm with the patch is that the patch content does not match the commit message.
I also don't understand why it's useful, because patch 2 makes everything conditional on CONFIG_SOFTMMU.
Paolo
PATCH 2/3 accel/stubs: Restrict system-mode emulation stubs
In reply to Philippe Mathieu-DaudéThis system-mode emulation stubs are not require in user-mode binaries. Restrict them to system-mode binaries.
--- accel/stubs/meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
accel/stubs/meson.build +8 -4
@@ -1,4 +1,8 @@ -specific_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) -specific_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) -specific_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) -specific_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) +accel_stubs_ss = ss.source_set() + +accel_stubs_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) +accel_stubs_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) +accel_stubs_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +accel_stubs_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) + +specific_ss.add_all(when: ['CONFIG_SOFTMMU'], if_true: accel_stubs_ss)
Signature · 1 line
2.26.2
Re: [PATCH 2/3] accel/stubs: Restrict system-mode emulation stubs
Quoted 1 line · Philippe Mathieu-Daudé
This system-mode emulation stubs are not require
nit: s,require,required,
Quoted 26 lines
in user-mode binaries. Restrict them to system-mode binaries.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/stubs/meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)accel/stubs/meson.build +8
-4@@ -1,4 +1,8 @@ -specific_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) -specific_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) -specific_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) -specific_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) +accel_stubs_ss = ss.source_set() + +accel_stubs_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) +accel_stubs_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) +accel_stubs_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +accel_stubs_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) + +specific_ss.add_all(when: ['CONFIG_SOFTMMU'], if_true: accel_stubs_ss)
PATCH 3/3 accel/stubs: Simplify kvm-stub.c
In reply to Philippe Mathieu-DaudéNow than kvm-stub.c is only built on system-mode emulation, we can simplify its #ifdef'ry.
--- accel/stubs/kvm-stub.c | 5 ----- 1 file changed, 5 deletions(-)
accel/stubs/kvm-stub.c +0 -5
@@ -13,10 +13,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "sysemu/kvm.h" - -#ifndef CONFIG_USER_ONLY #include "hw/pci/msi.h" -#endif KVMState *kvm_state;bool kvm_kernel_irqchip;
@@ -91,7 +88,6 @@ int kvm_memcrypt_encrypt_data(uint8_t *ptr, uint64_t len)return 1 ; } -#ifndef CONFIG_USER_ONLY int kvm_irqchip_add_msi_route (KVMState *s,int vector,PCIDevice *dev) {return -ENOSYS ;
@@ -158,4 +154,3 @@ bool kvm_arm_supports_user_irq(void) {return false; } -#endif
Signature · 1 line
2.26.2
Paolo Bonzini
maintainerQuoted 7 lines · Philippe Mathieu-Daudé
It is pointless to build/link these stubs into user-mode binaries.
Philippe Mathieu-Daudé (3):
accel: Only include TCG stubs in user-mode only builds accel/stubs: Restrict system-mode emulation stubs accel/stubs: Simplifykvm-stub.c
Quoted 5 lines
accel/stubs/kvm-stub.c | 5 ----- accel/meson.build | 10 ++++++---- accel/stubs/meson.build | 12 ++++++++---- 3 files changed, 14 insertions(+), 13 deletions(-)
The series makes sense. It probably also shows that it makes sense to have a "specific_softmmu_ss" sourceset in meson.build. Let's review Alex Bennée's patches and then get back to this one.
Paolo