From: Claudio Fontana <cfontana@suse.de>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Roman Bolshakov" <r.bolshakov@yadro.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Pavel Dovgalyuk <dovgaluk@ispras.ru>,
Wenchao Wang <wenchao.wang@intel.com>,
haxm-team@intel.com, Sunil Muthuswamy <sunilmut@microsoft.com>,
Richard Henderson <rth@twiddle.net>,
Colin Xu <colin.xu@intel.com>
Subject: Re: [RFC v4 11/14] hvf: remove hvf specific functions from global includes
Date: Wed, 12 Aug 2020 16:49:13 +0200 [thread overview]
Message-ID: <a729d3f4-3560-fc4f-aa57-ec02d23f16c2@suse.de> (raw)
In-Reply-To: <20200811210326.4425-12-cfontana@suse.de>
On 8/11/20 11:03 PM, Claudio Fontana wrote:
> Signed-off-by: Claudio Fontana <cfontana@suse.de>
> ---
> accel/stubs/Makefile.objs | 1 -
> accel/stubs/hvf-stub.c | 30 ------------------------------
> include/sysemu/hvf.h | 8 --------
> target/i386/hvf/hvf-cpus.c | 1 +
> target/i386/hvf/hvf-int.h | 24 ++++++++++++++++++++++++
> target/i386/hvf/hvf.c | 1 +
> target/i386/hvf/x86hvf.c | 2 ++
> target/i386/hvf/x86hvf.h | 1 -
> 8 files changed, 28 insertions(+), 40 deletions(-)
> delete mode 100644 accel/stubs/hvf-stub.c
> create mode 100644 target/i386/hvf/hvf-int.h
>
> diff --git a/accel/stubs/Makefile.objs b/accel/stubs/Makefile.objs
> index bbd14e71fb..6630954f30 100644
> --- a/accel/stubs/Makefile.objs
> +++ b/accel/stubs/Makefile.objs
> @@ -1,5 +1,4 @@
> obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o
> -obj-$(call lnot,$(CONFIG_HVF)) += hvf-stub.o
> obj-$(call lnot,$(CONFIG_WHPX)) += whpx-stub.o
> obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
> obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o
> diff --git a/accel/stubs/hvf-stub.c b/accel/stubs/hvf-stub.c
> deleted file mode 100644
> index e81dfe888c..0000000000
> --- a/accel/stubs/hvf-stub.c
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -/*
> - * QEMU HVF support
> - *
> - * Copyright 2017 Red Hat, Inc.
> - *
> - * This software is licensed under the terms of the GNU General Public
> - * License version 2 or later, as published by the Free Software Foundation,
> - * and may be copied, distributed, and modified under those terms.
> - *
> - * See the COPYING file in the top-level directory.
> - *
> - */
> -
> -#include "qemu/osdep.h"
> -#include "cpu.h"
> -#include "sysemu/hvf.h"
> -
> -int hvf_init_vcpu(CPUState *cpu)
> -{
> - return -ENOSYS;
> -}
> -
> -int hvf_vcpu_exec(CPUState *cpu)
> -{
> - return -ENOSYS;
> -}
> -
> -void hvf_vcpu_destroy(CPUState *cpu)
> -{
> -}
> diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h
> index 6d3ee4fdb7..b4f7191dd9 100644
> --- a/include/sysemu/hvf.h
> +++ b/include/sysemu/hvf.h
> @@ -23,14 +23,6 @@ extern bool hvf_allowed;
> #define hvf_get_supported_cpuid(func, idx, reg) 0
> #endif /* !CONFIG_HVF */
>
> -int hvf_init_vcpu(CPUState *);
> -int hvf_vcpu_exec(CPUState *);
> -void hvf_cpu_synchronize_state(CPUState *);
> -void hvf_cpu_synchronize_post_reset(CPUState *);
> -void hvf_cpu_synchronize_post_init(CPUState *);
> -void hvf_cpu_synchronize_pre_loadvm(CPUState *);
> -void hvf_vcpu_destroy(CPUState *);
> -
> #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf")
>
> #define HVF_STATE(obj) \
> diff --git a/target/i386/hvf/hvf-cpus.c b/target/i386/hvf/hvf-cpus.c
> index 9540157f1e..3e5cd75dc9 100644
> --- a/target/i386/hvf/hvf-cpus.c
> +++ b/target/i386/hvf/hvf-cpus.c
> @@ -55,6 +55,7 @@
> #include "target/i386/cpu.h"
> #include "qemu/guest-random.h"
>
> +#include "hvf-int.h"
> #include "hvf-cpus.h"
>
> /*
> diff --git a/target/i386/hvf/hvf-int.h b/target/i386/hvf/hvf-int.h
> new file mode 100644
> index 0000000000..50d108ca08
> --- /dev/null
> +++ b/target/i386/hvf/hvf-int.h
Hmm maybe I could avoid creating a new header file,
and just cram these functions in hvf-cpus.h ?
Any thoughts?
Thanks,
Claudio
> @@ -0,0 +1,24 @@
> +/*
> + * QEMU Hypervisor.framework (HVF) support
> + *
> + * Copyright Google Inc., 2017
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + *
> + */
> +
> +/* header to be included in HVF-specific internal code */
> +
> +#ifndef HVF_INT_H
> +#define HVF_INT_H
> +
> +int hvf_init_vcpu(CPUState *);
> +int hvf_vcpu_exec(CPUState *);
> +void hvf_cpu_synchronize_state(CPUState *);
> +void hvf_cpu_synchronize_post_reset(CPUState *);
> +void hvf_cpu_synchronize_post_init(CPUState *);
> +void hvf_cpu_synchronize_pre_loadvm(CPUState *);
> +void hvf_vcpu_destroy(CPUState *);
> +
> +#endif /* HVF_INT_H */
> diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
> index ed9356565c..728b4695e6 100644
> --- a/target/i386/hvf/hvf.c
> +++ b/target/i386/hvf/hvf.c
> @@ -72,6 +72,7 @@
> #include "sysemu/accel.h"
> #include "target/i386/cpu.h"
>
> +#include "hvf-int.h"
> #include "hvf-cpus.h"
>
> HVFState *hvf_state;
> diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c
> index 5cbcb32ab6..17e0280be0 100644
> --- a/target/i386/hvf/x86hvf.c
> +++ b/target/i386/hvf/x86hvf.c
> @@ -32,6 +32,8 @@
> #include <Hypervisor/hv.h>
> #include <Hypervisor/hv_vmx.h>
>
> +#include "hvf-int.h"
> +
> void hvf_set_segment(struct CPUState *cpu, struct vmx_segment *vmx_seg,
> SegmentCache *qseg, bool is_tr)
> {
> diff --git a/target/i386/hvf/x86hvf.h b/target/i386/hvf/x86hvf.h
> index 79539f7282..4fabc6d582 100644
> --- a/target/i386/hvf/x86hvf.h
> +++ b/target/i386/hvf/x86hvf.h
> @@ -35,5 +35,4 @@ void hvf_get_msrs(CPUState *cpu_state);
> void vmx_clear_int_window_exiting(CPUState *cpu);
> void hvf_get_segments(CPUState *cpu_state);
> void vmx_update_tpr(CPUState *cpu);
> -void hvf_cpu_synchronize_state(CPUState *cpu_state);
> #endif
>
next prev parent reply other threads:[~2020-08-12 14:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 21:03 [RFC v4 00/14] QEMU cpus.c refactoring part2 Claudio Fontana
2020-08-11 21:03 ` [RFC v4 01/14] cpu-timers, icount: new modules Claudio Fontana
2020-08-11 21:03 ` [RFC v4 02/14] cpus: prepare new CpusAccel cpu accelerator interface Claudio Fontana
2020-08-11 21:03 ` [RFC v4 03/14] cpus: extract out TCG-specific code to accel/tcg Claudio Fontana
2020-08-12 16:06 ` Philippe Mathieu-Daudé
2020-08-11 21:03 ` [RFC v4 04/14] cpus: extract out qtest-specific code to accel/qtest Claudio Fontana
2020-08-11 21:03 ` [RFC v4 05/14] cpus: extract out kvm-specific code to accel/kvm Claudio Fontana
2020-08-12 16:10 ` Philippe Mathieu-Daudé
2020-08-11 21:03 ` [RFC v4 06/14] cpus: extract out hax-specific code to target/i386/ Claudio Fontana
2020-08-11 21:03 ` [RFC v4 07/14] cpus: extract out whpx-specific " Claudio Fontana
2020-08-11 21:03 ` [RFC v4 08/14] cpus: extract out hvf-specific code to target/i386/hvf/ Claudio Fontana
2020-08-11 21:03 ` [RFC v4 09/14] cpus: cleanup now unneeded includes Claudio Fontana
2020-08-11 21:03 ` [RFC v4 10/14] cpus: add handle_interrupt to the CpusAccel interface Claudio Fontana
2020-08-11 21:03 ` [RFC v4 11/14] hvf: remove hvf specific functions from global includes Claudio Fontana
2020-08-12 14:49 ` Claudio Fontana [this message]
2020-08-12 16:12 ` Philippe Mathieu-Daudé
2020-08-11 21:03 ` [RFC v4 12/14] whpx: remove whpx " Claudio Fontana
2020-08-11 21:03 ` [RFC v4 13/14] hax: remove hax " Claudio Fontana
2020-08-11 21:03 ` [RFC v4 14/14] kvm: remove kvm " Claudio Fontana
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=a729d3f4-3560-fc4f-aa57-ec02d23f16c2@suse.de \
--to=cfontana@suse.de \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=colin.xu@intel.com \
--cc=dovgaluk@ispras.ru \
--cc=ehabkost@redhat.com \
--cc=haxm-team@intel.com \
--cc=lvivier@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=r.bolshakov@yadro.com \
--cc=rth@twiddle.net \
--cc=sunilmut@microsoft.com \
--cc=thuth@redhat.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).