qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] accel/stubs: Build HAX/KVM/XEN stubs once
@ 2023-04-05 16:13 Philippe Mathieu-Daudé
  2023-04-05 16:13 ` [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub Philippe Mathieu-Daudé
  2023-04-05 16:13 ` [PATCH 2/2] accel/stubs: Build HAX/KVM/XEN stubs once Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-04-05 16:13 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Paolo Bonzini, Alex Bennée, kvm, Philippe Mathieu-Daudé

TCG stubs could become target agnostic but
I'm leaving that for later.

Based-on: <20230405160454.97436-1-philmd@linaro.org>

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(-)

-- 
2.38.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub
  2023-04-05 16:13 [PATCH 0/2] accel/stubs: Build HAX/KVM/XEN stubs once Philippe Mathieu-Daudé
@ 2023-04-05 16:13 ` Philippe Mathieu-Daudé
  2023-04-08  0:16   ` Richard Henderson
  2023-04-05 16:13 ` [PATCH 2/2] accel/stubs: Build HAX/KVM/XEN stubs once Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-04-05 16:13 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Paolo Bonzini, Alex Bennée, kvm, 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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/stubs/kvm-stub.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
index 235dc661bc..c0e2df3fbf 100644
--- a/accel/stubs/kvm-stub.c
+++ b/accel/stubs/kvm-stub.c
@@ -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)
 {
 }
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] accel/stubs: Build HAX/KVM/XEN stubs once
  2023-04-05 16:13 [PATCH 0/2] accel/stubs: Build HAX/KVM/XEN stubs once Philippe Mathieu-Daudé
  2023-04-05 16:13 ` [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub Philippe Mathieu-Daudé
@ 2023-04-05 16:13 ` Philippe Mathieu-Daudé
  2023-04-08  0:20   ` Richard Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-04-05 16:13 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel
  Cc: Paolo Bonzini, Alex Bennée, kvm, Philippe Mathieu-Daudé

These stub files don't require any target-specific bit.
(TCG stubs do, so this file is left in specific_ss[]).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/stubs/meson.build | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build
index 0249b9258f..a67f21a964 100644
--- a/accel/stubs/meson.build
+++ b/accel/stubs/meson.build
@@ -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)
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub
  2023-04-05 16:13 ` [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub Philippe Mathieu-Daudé
@ 2023-04-08  0:16   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2023-04-08  0:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Thomas Huth, qemu-devel
  Cc: Paolo Bonzini, Alex Bennée, kvm

On 4/5/23 09:13, Philippe Mathieu-Daudé wrote:
> 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.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] accel/stubs: Build HAX/KVM/XEN stubs once
  2023-04-05 16:13 ` [PATCH 2/2] accel/stubs: Build HAX/KVM/XEN stubs once Philippe Mathieu-Daudé
@ 2023-04-08  0:20   ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2023-04-08  0:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Thomas Huth, qemu-devel
  Cc: Paolo Bonzini, Alex Bennée, kvm

On 4/5/23 09:13, Philippe Mathieu-Daudé wrote:
> +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~


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-08  0:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-05 16:13 [PATCH 0/2] accel/stubs: Build HAX/KVM/XEN stubs once Philippe Mathieu-Daudé
2023-04-05 16:13 ` [PATCH 1/2] accel/stubs: Remove kvm_flush_coalesced_mmio_buffer() stub Philippe Mathieu-Daudé
2023-04-08  0:16   ` Richard Henderson
2023-04-05 16:13 ` [PATCH 2/2] accel/stubs: Build HAX/KVM/XEN stubs once Philippe Mathieu-Daudé
2023-04-08  0:20   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).