accel/stubs: Build HAX/KVM/XEN stubs once
Subsystems (2)
cover accel/stubs: Build HAX/KVM/XEN stubs once
TCG stubs could become target agnostic but
I'm leaving that for later.
Based-on: <[email protected]>
Philippe Mathieu-Daudé (2):
accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub accel/stubs: Build HAX/KVM/XEN stubs once
accel/stubs/kvm-stub.c | 4 ---- accel/stubs/meson.build | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/2 accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub
kvm_flush_coalesced_mmio_buffer() is only called from qemu_flush_coalesced_mmio_buffer() where it is protected by a kvm_enabled() check. When KVM is not available, the call is elided, there is no need for a stub definition.
--- accel/stubs/kvm-stub.c | 4 ---- 1 file changed, 4 deletions(-)
accel/stubs/kvm-stub.c +0 -4
@@ -29,10 +29,6 @@ bool kvm_ioeventfd_any_length_allowed;bool kvm_msi_use_devid;bool kvm_direct_msi_allowed; -void kvm_flush_coalesced_mmio_buffer (void ) -{ -} -void kvm_cpu_synchronize_state (CPUState *cpu) { }
Signature · 1 line
2.38.1
Re: [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub
Quoted 4 lines · Philippe Mathieu-Daudé
kvm_flush_coalesced_mmio_buffer()is only called fromqemu_flush_coalesced_mmio_buffer()where it is protected by akvm_enabled()check. When KVM is not available, the call is elided, there is no need for a stub definition.
r~
PATCH 2/2 accel/stubs: Build HAX/KVM/XEN stubs once
In reply to Philippe Mathieu-DaudéThese stub files don't require any target-specific bit. (TCG stubs do, so this file is left in specific_ss[]).
--- accel/stubs/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
accel/stubs/meson.build +6 -4
@@ -1,7 +1,9 @@ +sysemu_stubs_specific_ss = ss.source_set() +sysemu_stubs_specific_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) +specific_ss.add_all(when: ['CONFIG_SOFTMMU'], if_true: sysemu_stubs_specific_ss) + sysemu_stubs_ss = ss.source_set() sysemu_stubs_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) -sysemu_stubs_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) sysemu_stubs_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) -sysemu_stubs_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) - -specific_ss.add_all(when: ['CONFIG_SOFTMMU'], if_true: sysemu_stubs_ss) +sysemu_stubs_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) +softmmu_ss.add_all(when: ['CONFIG_SOFTMMU'], if_true: sysemu_stubs_ss)
Signature · 1 line
2.38.1
Quoted 1 line · Philippe Mathieu-Daudé
+softmmu_ss.add_all(when: ['
CONFIG_SOFTMMU'],if_true:sysemu_stubs_ss)
This when is redundant.
You can drop sysemu_stubs_ss and add each stub file directly to softmmu_ss.
r~