qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>
Subject: Re: [RFC PATCH 02/15] accel/whpx: Simplify #ifdef'ry
Date: Wed, 26 May 2021 11:45:33 -0700	[thread overview]
Message-ID: <f353037a-404d-730f-8424-70708943d55b@linaro.org> (raw)
In-Reply-To: <20210517115525.1088693-3-f4bug@amsat.org>

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	other threads:[~2021-05-26 18:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 11:55 [RFC PATCH 00/15] softmmu: Make various objects target agnostic Philippe Mathieu-Daudé
2021-05-17 11:55 ` [RFC PATCH 01/15] accel/kvm: Add more stubs Philippe Mathieu-Daudé
2021-05-26 18:35   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 02/15] accel/whpx: Simplify #ifdef'ry Philippe Mathieu-Daudé
2021-05-26 18:45   ` Richard Henderson [this message]
2021-05-17 11:55 ` [RFC PATCH 03/15] accel/hax: " Philippe Mathieu-Daudé
2021-05-26 18:49   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 04/15] accel: Only use TCG when building user-mode emulation Philippe Mathieu-Daudé
2021-05-26 18:52   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 05/15] accel/kvm: Simplify user-mode #ifdef'ry Philippe Mathieu-Daudé
2021-05-26 18:53   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 06/15] hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header Philippe Mathieu-Daudé
2021-05-26 18:53   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 07/15] softmmu/globals: Remove unused 'hw/i386/*' headers Philippe Mathieu-Daudé
2021-05-26 18:54   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 08/15] softmmu/cpu-timers: Remove unused 'exec/exec-all.h' header Philippe Mathieu-Daudé
2021-05-26 18:55   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 09/15] softmmu/runstate: Clean headers Philippe Mathieu-Daudé
2021-05-26 18:55   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 10/15] exec/gdbstub: Make gdb_exit() / gdb_set_stop_cpu() target agnostic Philippe Mathieu-Daudé
2021-05-19 18:12   ` Philippe Mathieu-Daudé
2021-05-26 18:59   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 11/15] exec/cpu: Make address_space_init/reloading_memory_map " Philippe Mathieu-Daudé
2021-05-26 19:01   ` Richard Henderson
2021-05-26 21:32     ` Philippe Mathieu-Daudé
2021-05-26 21:43       ` Richard Henderson
2022-02-03 12:37     ` Philippe Mathieu-Daudé via
2021-05-17 11:55 ` [RFC PATCH 12/15] sysemu/kvm: Make kvm_on_sigbus() / kvm_on_sigbus_vcpu() " Philippe Mathieu-Daudé
2021-05-26 19:02   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 13/15] sysemu/memory_mapping: Become target-agnostic Philippe Mathieu-Daudé
2021-05-26 19:06   ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 14/15] softmmu/cpus: Extract QMP command handlers to cpus-qmp.c Philippe Mathieu-Daudé
2021-05-26 19:10   ` Richard Henderson
2021-05-26 21:35     ` Philippe Mathieu-Daudé
2021-05-26 21:47       ` Richard Henderson
2021-05-17 11:55 ` [RFC PATCH 15/15] softmmu: Build target-agnostic objects once Philippe Mathieu-Daudé
2021-05-26 19:10   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f353037a-404d-730f-8424-70708943d55b@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).