From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Roman Bolshakov <r.bolshakov@yadro.com>,
Cameron Esfahani <dirty@apple.com>,
Kamil Rytarowski <kamil@netbsd.org>,
Reinoud Zandijk <reinoud@netbsd.org>,
Colin Xu <colin.xu@intel.com>,
haxm-team@intel.com, Sunil Muthuswamy <sunilmut@microsoft.com>,
Wenchao Wang <wenchao.wang@intel.com>
Subject: Re: [PATCH] target/i386: Include 'hw/i386/apic.h' locally
Date: Thu, 16 Sep 2021 00:05:18 +0200 [thread overview]
Message-ID: <a4cba848-e668-7cf1-fe93-b5da3a4ac6dc@redhat.com> (raw)
In-Reply-To: <20210902152243.386118-1-f4bug@amsat.org>
On 02/09/21 17:22, Philippe Mathieu-Daudé wrote:
> Instead of including a sysemu-specific header in "cpu.h"
> (which is shared with user-mode emulations), include it
> locally when required.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Based-on: <20210902151715.383678-1-f4bug@amsat.org>
> "accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() to sysemu"
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo
> ---
> target/i386/cpu.h | 4 ----
> hw/i386/kvmvapic.c | 1 +
> hw/i386/x86.c | 1 +
> target/i386/cpu-sysemu.c | 1 +
> target/i386/cpu.c | 1 +
> target/i386/gdbstub.c | 4 ++++
> target/i386/hax/hax-all.c | 1 +
> target/i386/helper.c | 1 +
> target/i386/hvf/x86_emu.c | 1 +
> target/i386/nvmm/nvmm-all.c | 1 +
> target/i386/tcg/seg_helper.c | 4 ++++
> target/i386/tcg/sysemu/misc_helper.c | 1 +
> target/i386/whpx/whpx-all.c | 1 +
> 13 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index c7cc65e92d5..eddafd1acd5 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2046,10 +2046,6 @@ typedef X86CPU ArchCPU;
> #include "exec/cpu-all.h"
> #include "svm.h"
>
> -#if !defined(CONFIG_USER_ONLY)
> -#include "hw/i386/apic.h"
> -#endif
> -
> static inline void cpu_get_tb_cpu_state(CPUX86State *env, target_ulong *pc,
> target_ulong *cs_base, uint32_t *flags)
> {
> diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
> index 43f8a8f679e..7333818bdd1 100644
> --- a/hw/i386/kvmvapic.c
> +++ b/hw/i386/kvmvapic.c
> @@ -16,6 +16,7 @@
> #include "sysemu/hw_accel.h"
> #include "sysemu/kvm.h"
> #include "sysemu/runstate.h"
> +#include "hw/i386/apic.h"
> #include "hw/i386/apic_internal.h"
> #include "hw/sysbus.h"
> #include "hw/boards.h"
> diff --git a/hw/i386/x86.c b/hw/i386/x86.c
> index 00448ed55aa..e0218f8791f 100644
> --- a/hw/i386/x86.c
> +++ b/hw/i386/x86.c
> @@ -43,6 +43,7 @@
> #include "target/i386/cpu.h"
> #include "hw/i386/topology.h"
> #include "hw/i386/fw_cfg.h"
> +#include "hw/i386/apic.h"
> #include "hw/intc/i8259.h"
> #include "hw/rtc/mc146818rtc.h"
>
> diff --git a/target/i386/cpu-sysemu.c b/target/i386/cpu-sysemu.c
> index 1078e3d157f..65709e41903 100644
> --- a/target/i386/cpu-sysemu.c
> +++ b/target/i386/cpu-sysemu.c
> @@ -30,6 +30,7 @@
> #include "hw/qdev-properties.h"
>
> #include "exec/address-spaces.h"
> +#include "hw/i386/apic.h"
> #include "hw/i386/apic_internal.h"
>
> #include "cpu-internal.h"
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 97e250e8760..04f59043804 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -33,6 +33,7 @@
> #include "standard-headers/asm-x86/kvm_para.h"
> #include "hw/qdev-properties.h"
> #include "hw/i386/topology.h"
> +#include "hw/i386/apic.h"
> #ifndef CONFIG_USER_ONLY
> #include "exec/address-spaces.h"
> #include "hw/boards.h"
> diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c
> index 098a2ad15a9..5438229c1a9 100644
> --- a/target/i386/gdbstub.c
> +++ b/target/i386/gdbstub.c
> @@ -21,6 +21,10 @@
> #include "cpu.h"
> #include "exec/gdbstub.h"
>
> +#ifndef CONFIG_USER_ONLY
> +#include "hw/i386/apic.h"
> +#endif
> +
> #ifdef TARGET_X86_64
> static const int gpr_map[16] = {
> R_EAX, R_EBX, R_ECX, R_EDX, R_ESI, R_EDI, R_EBP, R_ESP,
> diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c
> index bf65ed6fa92..cd89e3233a9 100644
> --- a/target/i386/hax/hax-all.c
> +++ b/target/i386/hax/hax-all.c
> @@ -32,6 +32,7 @@
> #include "sysemu/reset.h"
> #include "sysemu/runstate.h"
> #include "hw/boards.h"
> +#include "hw/i386/apic.h"
>
> #include "hax-accel-ops.h"
>
> diff --git a/target/i386/helper.c b/target/i386/helper.c
> index 533b29cb91b..874beda98ae 100644
> --- a/target/i386/helper.c
> +++ b/target/i386/helper.c
> @@ -26,6 +26,7 @@
> #ifndef CONFIG_USER_ONLY
> #include "sysemu/hw_accel.h"
> #include "monitor/monitor.h"
> +#include "hw/i386/apic.h"
> #endif
>
> void cpu_sync_bndcs_hflags(CPUX86State *env)
> diff --git a/target/i386/hvf/x86_emu.c b/target/i386/hvf/x86_emu.c
> index 7c8203b21fb..fb3e88959d4 100644
> --- a/target/i386/hvf/x86_emu.c
> +++ b/target/i386/hvf/x86_emu.c
> @@ -45,6 +45,7 @@
> #include "x86_flags.h"
> #include "vmcs.h"
> #include "vmx.h"
> +#include "hw/i386/apic.h"
>
> void hvf_handle_io(struct CPUState *cpu, uint16_t port, void *data,
> int direction, int size, uint32_t count);
> diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
> index 28dee4c5ee3..4c07cfc7194 100644
> --- a/target/i386/nvmm/nvmm-all.c
> +++ b/target/i386/nvmm/nvmm-all.c
> @@ -22,6 +22,7 @@
> #include "qemu/queue.h"
> #include "migration/blocker.h"
> #include "strings.h"
> +#include "hw/i386/apic.h"
>
> #include "nvmm-accel-ops.h"
>
> diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c
> index 13c6e6ee62e..71fd2bf8d06 100644
> --- a/target/i386/tcg/seg_helper.c
> +++ b/target/i386/tcg/seg_helper.c
> @@ -28,6 +28,10 @@
> #include "helper-tcg.h"
> #include "seg_helper.h"
>
> +#ifndef CONFIG_USER_ONLY
> +#include "hw/i386/apic.h"
> +#endif
> +
> /* return non zero if error */
> static inline int load_segment_ra(CPUX86State *env, uint32_t *e1_ptr,
> uint32_t *e2_ptr, int selector,
> diff --git a/target/i386/tcg/sysemu/misc_helper.c b/target/i386/tcg/sysemu/misc_helper.c
> index e7a2ebde813..dbeda8d0b0f 100644
> --- a/target/i386/tcg/sysemu/misc_helper.c
> +++ b/target/i386/tcg/sysemu/misc_helper.c
> @@ -24,6 +24,7 @@
> #include "exec/cpu_ldst.h"
> #include "exec/address-spaces.h"
> #include "tcg/helper-tcg.h"
> +#include "hw/i386/apic.h"
>
> void helper_outb(CPUX86State *env, uint32_t port, uint32_t data)
> {
> diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
> index 3e925b9da70..9ab844fd05d 100644
> --- a/target/i386/whpx/whpx-all.c
> +++ b/target/i386/whpx/whpx-all.c
> @@ -20,6 +20,7 @@
> #include "qemu/main-loop.h"
> #include "hw/boards.h"
> #include "hw/i386/ioapic.h"
> +#include "hw/i386/apic.h"
> #include "hw/i386/apic_internal.h"
> #include "qemu/error-report.h"
> #include "qapi/error.h"
>
next prev parent reply other threads:[~2021-09-15 22:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 15:22 [PATCH] target/i386: Include 'hw/i386/apic.h' locally Philippe Mathieu-Daudé
2021-09-15 14:36 ` Philippe Mathieu-Daudé
2021-09-15 22:05 ` Paolo Bonzini [this message]
2021-09-29 14:08 ` Philippe Mathieu-Daudé
2021-09-29 15:00 ` Laurent Vivier
2021-09-29 15:16 ` Laurent Vivier
2021-09-29 16:06 ` Philippe Mathieu-Daudé
2021-09-29 16:23 ` Laurent Vivier
2021-09-29 16:29 ` Philippe Mathieu-Daudé
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=a4cba848-e668-7cf1-fe93-b5da3a4ac6dc@redhat.com \
--to=pbonzini@redhat.com \
--cc=colin.xu@intel.com \
--cc=dirty@apple.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=haxm-team@intel.com \
--cc=kamil@netbsd.org \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.com \
--cc=reinoud@netbsd.org \
--cc=richard.henderson@linaro.org \
--cc=sunilmut@microsoft.com \
--cc=wenchao.wang@intel.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).