qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 02/15] accel/whpx: Simplify #ifdef'ry


From: Richard Henderson
Subject: Re: [RFC PATCH 02/15] accel/whpx: Simplify #ifdef'ry
Date: Wed, 26 May 2021 11:45:33 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 5/17/21 4:55 AM, Philippe Mathieu-Daudé wrote:
whpx_apic_in_platform() is called from:

- pic_irq_request() in hw/i386/x86.c
- cpu_thread_is_idle() softmmu/cpus.c
- apic_get_class() in target/i386/cpu-sysemu.c

whpx_enabled() is called from:

- cpu_report_tpr_access() in target/i386/helper.c

By converting macros to a function, we can remove the
NEED_CPU_H dependency and build softmmu/cpus.c once
for all targets.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
  include/sysemu/whpx.h       | 15 +--------------
  accel/stubs/whpx-stub.c     | 21 +++++++++++++++++++++
  target/i386/whpx/whpx-all.c |  2 +-
  MAINTAINERS                 |  1 +
  accel/stubs/meson.build     |  1 +
  5 files changed, 25 insertions(+), 15 deletions(-)
  create mode 100644 accel/stubs/whpx-stub.c

diff --git a/include/sysemu/whpx.h b/include/sysemu/whpx.h
index 2889fa2278b..b32f46f9ebf 100644
--- a/include/sysemu/whpx.h
+++ b/include/sysemu/whpx.h
@@ -13,20 +13,7 @@
  #ifndef QEMU_WHPX_H
  #define QEMU_WHPX_H
-#ifdef NEED_CPU_H
-
-#ifdef CONFIG_WHPX
-
-int whpx_enabled(void);
+bool whpx_enabled(void);
  bool whpx_apic_in_platform(void);
-#else /* CONFIG_WHPX */
-
-#define whpx_enabled() (0)
-#define whpx_apic_in_platform() (0)

I think the loss of whpx_enabled as false is unfortunate. I'd like to see this file mirror sysemu/kvm.h with CONFIG_WHPX_IS_POSSIBLE.

As I mentioned vs patch 1, whpx_apic_in_platform would be handled via AccelOpsClass with whatever hook we come up with for cpu_thread_is_idle.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]