From: David Gibson <david@gibson.dropbear.id.au>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Chris Wulff" <crwulff@gmail.com>,
"Sagar Karandikar" <sagark@eecs.berkeley.edu>,
"David Hildenbrand" <david@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org, "Max Filippov" <jcmvbkbc@gmail.com>,
"Alistair Francis" <Alistair.Francis@wdc.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Marek Vasut" <marex@denx.de>,
"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>,
qemu-ppc@nongnu.org,
"Aleksandar Rikalo" <aleksandar.rikalo@rt-rk.com>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
qemu-s390x@nongnu.org, qemu-arm@nongnu.org,
"Stafford Horne" <shorne@gmail.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Richard Henderson" <rth@twiddle.net>,
qemu-riscv@nongnu.org,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
"Cornelia Huck" <cohuck@redhat.com>,
"Roman Bolshakov" <r.bolshakov@yadro.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [PATCH 05/11] target/ppc: Restrict PPCVirtualHypervisorClass to system-mode
Date: Mon, 11 May 2020 11:15:27 +1000 [thread overview]
Message-ID: <20200511011527.GC2183@umbus.fritz.box> (raw)
In-Reply-To: <20200509130910.26335-6-f4bug@amsat.org>
[-- Attachment #1: Type: text/plain, Size: 4083 bytes --]
On Sat, May 09, 2020 at 03:09:04PM +0200, Philippe Mathieu-Daudé wrote:
> The code related to PPC Virtual Hypervisor is pointless in user-mode.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> target/ppc/cpu.h | 4 ++--
> target/ppc/kvm_ppc.h | 22 +++++++++++-----------
> target/ppc/translate_init.inc.c | 4 ++++
> 3 files changed, 17 insertions(+), 13 deletions(-)
>
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index 6b6dd7e483..73920a9cac 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -1176,6 +1176,7 @@ PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr);
> PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr);
> PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc);
>
> +#ifndef CONFIG_USER_ONLY
> struct PPCVirtualHypervisorClass {
> InterfaceClass parent;
> void (*hypercall)(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu);
> @@ -1189,10 +1190,8 @@ struct PPCVirtualHypervisorClass {
> void (*hpte_set_r)(PPCVirtualHypervisor *vhyp, hwaddr ptex, uint64_t pte1);
> void (*get_pate)(PPCVirtualHypervisor *vhyp, ppc_v3_pate_t *entry);
> target_ulong (*encode_hpt_for_kvm_pr)(PPCVirtualHypervisor *vhyp);
> -#ifndef CONFIG_USER_ONLY
> void (*cpu_exec_enter)(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu);
> void (*cpu_exec_exit)(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu);
> -#endif
> };
>
> #define TYPE_PPC_VIRTUAL_HYPERVISOR "ppc-virtual-hypervisor"
> @@ -1204,6 +1203,7 @@ struct PPCVirtualHypervisorClass {
> #define PPC_VIRTUAL_HYPERVISOR_GET_CLASS(obj) \
> OBJECT_GET_CLASS(PPCVirtualHypervisorClass, (obj), \
> TYPE_PPC_VIRTUAL_HYPERVISOR)
> +#endif /* CONFIG_USER_ONLY */
>
> void ppc_cpu_do_interrupt(CPUState *cpu);
> bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
> diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
> index fcaf745516..701c0c262b 100644
> --- a/target/ppc/kvm_ppc.h
> +++ b/target/ppc/kvm_ppc.h
> @@ -280,6 +280,17 @@ static inline bool kvmppc_has_cap_spapr_vfio(void)
> return false;
> }
>
> +static inline void kvmppc_read_hptes(ppc_hash_pte64_t *hptes,
> + hwaddr ptex, int n)
> +{
> + abort();
> +}
> +
> +static inline void kvmppc_write_hpte(hwaddr ptex, uint64_t pte0, uint64_t pte1)
> +{
> + abort();
> +}
> +
> #endif /* !CONFIG_USER_ONLY */
>
> static inline bool kvmppc_has_cap_epr(void)
> @@ -310,17 +321,6 @@ static inline int kvmppc_load_htab_chunk(QEMUFile *f, int fd, uint32_t index,
> abort();
> }
>
> -static inline void kvmppc_read_hptes(ppc_hash_pte64_t *hptes,
> - hwaddr ptex, int n)
> -{
> - abort();
> -}
> -
> -static inline void kvmppc_write_hpte(hwaddr ptex, uint64_t pte0, uint64_t pte1)
> -{
> - abort();
> -}
> -
> static inline bool kvmppc_has_cap_fixup_hcalls(void)
> {
> abort();
> diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
> index 2b6e832c4c..4ea0cc501b 100644
> --- a/target/ppc/translate_init.inc.c
> +++ b/target/ppc/translate_init.inc.c
> @@ -10946,16 +10946,20 @@ static const TypeInfo ppc_cpu_type_info = {
> .class_init = ppc_cpu_class_init,
> };
>
> +#ifndef CONFIG_USER_ONLY
> static const TypeInfo ppc_vhyp_type_info = {
> .name = TYPE_PPC_VIRTUAL_HYPERVISOR,
> .parent = TYPE_INTERFACE,
> .class_size = sizeof(PPCVirtualHypervisorClass),
> };
> +#endif
>
> static void ppc_cpu_register_types(void)
> {
> type_register_static(&ppc_cpu_type_info);
> +#ifndef CONFIG_USER_ONLY
> type_register_static(&ppc_vhyp_type_info);
> +#endif
> }
>
> type_init(ppc_cpu_register_types)
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-05-11 1:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-09 13:08 [PATCH 00/11] exec/cpu: Poison 'hwaddr' type in user-mode emulation Philippe Mathieu-Daudé
2020-05-09 13:09 ` [PATCH 01/11] plugins: Restrict functions handling hwaddr to system-mode Philippe Mathieu-Daudé
2020-05-10 10:44 ` Philippe Mathieu-Daudé
2020-05-09 13:09 ` [PATCH 02/11] sysemu/accel: Restrict machine methods " Philippe Mathieu-Daudé
2020-05-11 9:54 ` Edgar E. Iglesias
2020-05-11 10:17 ` Cornelia Huck
2020-05-09 13:09 ` [PATCH 03/11] sysemu/tcg: Only declare tcg_allowed when TCG is available Philippe Mathieu-Daudé
2020-05-11 9:46 ` Edgar E. Iglesias
2020-05-11 10:20 ` Cornelia Huck
2020-05-09 13:09 ` [PATCH 04/11] sysemu/hvf: Only declare hvf_allowed when HVF " Philippe Mathieu-Daudé
2020-05-11 9:47 ` Edgar E. Iglesias
2020-05-11 10:22 ` Cornelia Huck
2020-06-03 23:35 ` Cameron Esfahani
2020-05-09 13:09 ` [PATCH 05/11] target/ppc: Restrict PPCVirtualHypervisorClass to system-mode Philippe Mathieu-Daudé
2020-05-11 1:15 ` David Gibson [this message]
2020-05-09 13:09 ` [PATCH 06/11] target/s390x: Only compile decode_basedisp() on system-mode Philippe Mathieu-Daudé
2020-05-11 10:39 ` Cornelia Huck
2020-05-09 13:09 ` [PATCH 07/11] target/s390x/helper: Clean ifdef'ry Philippe Mathieu-Daudé
2020-05-11 9:43 ` David Hildenbrand
2020-05-11 10:44 ` Cornelia Huck
2020-05-09 13:09 ` [PATCH 08/11] target/s390x: Restrict system-mode declarations Philippe Mathieu-Daudé
2020-05-11 10:48 ` Cornelia Huck
2020-05-11 12:21 ` Philippe Mathieu-Daudé
2020-05-12 6:01 ` Cornelia Huck
2020-05-12 6:46 ` Philippe Mathieu-Daudé
2020-05-12 6:52 ` David Hildenbrand
2020-05-09 13:09 ` [PATCH 09/11] target/cpu: Restrict handlers using hwaddr type to system-mode Philippe Mathieu-Daudé
2020-05-09 16:08 ` Philippe Mathieu-Daudé
2020-05-09 20:01 ` Philippe Mathieu-Daudé
2020-05-09 21:03 ` Paolo Bonzini
2020-05-11 1:16 ` David Gibson
2020-05-09 13:09 ` [PATCH 10/11] exec: Use 'cpu-common.h' instead of system-mode specific 'hwaddr.h' Philippe Mathieu-Daudé
2020-05-09 13:09 ` [PATCH 11/11] exec/cpu-common: Poison hwaddr type in user-mode emulation 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=20200511011527.GC2183@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=Alistair.Francis@wdc.com \
--cc=aleksandar.qemu.devel@gmail.com \
--cc=aleksandar.rikalo@rt-rk.com \
--cc=alex.bennee@linaro.org \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=cohuck@redhat.com \
--cc=crwulff@gmail.com \
--cc=david@redhat.com \
--cc=edgar.iglesias@gmail.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=jcmvbkbc@gmail.com \
--cc=kbastian@mail.uni-paderborn.de \
--cc=laurent@vivier.eu \
--cc=marex@denx.de \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=r.bolshakov@yadro.com \
--cc=rth@twiddle.net \
--cc=sagark@eecs.berkeley.edu \
--cc=shorne@gmail.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).