Skip to contentSkip to conversation

accel/stubs: Build HAX/KVM/XEN stubs once

PATCH In review Philippe Mathieu-Daudé 2 participants 5 messages Apr 5, 2023 – Apr 8, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 235dc661bc..c0e2df3fbf 100644
@@ -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
Reviewed-by on v1 1/2
#2 lore raw

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 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.

r~

#3 lore raw

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
index 0249b9258f..a67f21a964 100644
@@ -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
#4 lore raw
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~