[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 086/115] target/ppc: Restrict PPCVirtualHypervisorClass to system-
From: |
Paolo Bonzini |
Subject: |
[PULL 086/115] target/ppc: Restrict PPCVirtualHypervisorClass to system-mode |
Date: |
Thu, 11 Jun 2020 15:44:20 -0400 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
The code related to PPC Virtual Hypervisor is pointless in user-mode.
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200526172427.17460-5-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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 1988b436cb..e7d382ac10 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1202,6 +1202,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);
@@ -1215,10 +1216,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"
@@ -1230,6 +1229,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 38cb773ab4..a40888411c 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -10942,16 +10942,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)
--
2.26.2
- [PULL 107/115] target/i386: sev: Remove redundant handle field, (continued)
- [PULL 107/115] target/i386: sev: Remove redundant handle field, Paolo Bonzini, 2020/06/11
- [PULL 108/115] target/i386: sev: Unify SEVState and SevGuestState, Paolo Bonzini, 2020/06/11
- [PULL 109/115] checkpatch: reversed logic with acpi test checks, Paolo Bonzini, 2020/06/11
- [PULL 099/115] xen: fix build without pci passthrough, Paolo Bonzini, 2020/06/11
- [PULL 110/115] exec/memory: Remove unused MemoryRegionMmio type, Paolo Bonzini, 2020/06/11
- [PULL 114/115] stubs: move Xen stubs to accel/, Paolo Bonzini, 2020/06/11
- [PULL 111/115] hw/usb: Move device-specific declarations to new 'hcd-musb.h' header, Paolo Bonzini, 2020/06/11
- [PULL 113/115] replay: fix replay shutdown for console mode, Paolo Bonzini, 2020/06/11
- [PULL 112/115] exec/cpu-common: Move MUSB specific typedefs to 'hw/usb/hcd-musb.h', Paolo Bonzini, 2020/06/11
- [PULL 115/115] target/i386: Remove obsolete TODO file, Paolo Bonzini, 2020/06/11
- [PULL 086/115] target/ppc: Restrict PPCVirtualHypervisorClass to system-mode,
Paolo Bonzini <=
- [PULL 106/115] target/i386: sev: Remove redundant policy field, Paolo Bonzini, 2020/06/11
- Re: [PULL 000/115] Huge miscellaneous pull request for 2020-06-11, no-reply, 2020/06/11
- Re: [PULL 000/115] Huge miscellaneous pull request for 2020-06-11, Peter Maydell, 2020/06/12