qemu-e2k/hw/ppc
Nicholas Piggin 120f738a46 spapr: implement nested-hv capability for the virtual hypervisor
This implements the Nested KVM HV hcall API for spapr under TCG.

The L2 is switched in when the H_ENTER_NESTED hcall is made, and the
L1 is switched back in returned from the hcall when a HV exception
is sent to the vhyp. Register state is copied in and out according to
the nested KVM HV hcall API specification.

The hdecr timer is started when the L2 is switched in, and it provides
the HDEC / 0x980 return to L1.

The MMU re-uses the bare metal radix 2-level page table walker by
using the get_pate method to point the MMU to the nested partition
table entry. MMU faults due to partition scope errors raise HV
exceptions and accordingly are routed back to the L1.

The MMU does not tag translations for the L1 (direct) vs L2 (nested)
guests, so the TLB is flushed on any L1<->L2 transition (hcall entry
and exit).

Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
[ clg: checkpatch fixes ]
Message-Id: <20220216102545.1808018-10-npiggin@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-02-18 08:34:14 +01:00
..
Kconfig hw/ppc/Kconfig: Add dependency PEGASOS2 -> ATI_VGA 2021-07-20 20:10:20 +02:00
e500-ccsr.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
e500.c qdev: Make DeviceState.id independent of QemuOpts 2021-10-15 16:06:35 +02:00
e500.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04:00
e500plat.c hw/ppc/e500plat: Only try to add valid dynamic sysbus devices to platform bus 2021-04-06 11:49:14 +01:00
fdt.c target/ppc: Split page size information into a separate allocation 2018-04-27 18:05:22 +10:00
fw_cfg.c hw/ppc: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
mac.h hw/ppc/mac.h: Remove MAX_CPUS macro 2021-12-17 17:57:12 +01:00
mac_newworld.c hw/ppc/mac.h: Remove MAX_CPUS macro 2021-12-17 17:57:12 +01:00
mac_oldworld.c hw/ppc/mac.h: Remove MAX_CPUS macro 2021-12-17 17:57:12 +01:00
meson.build spapr: Implement Open Firmware client interface 2021-07-09 10:38:19 +10:00
mpc8544_guts.c ppc/ppc4xx: Convert printfs() 2022-01-04 07:55:34 +01:00
mpc8544ds.c ppc/e500: use memdev for RAM 2020-02-19 16:50:00 +00:00
pef.c ppc/pef.c: initialize cgs->ready in kvmppc_svm_init() 2021-06-03 18:10:31 +10:00
pegasos2.c target/ppc: Introduce a vhyp framework for nested HV support 2022-02-18 08:34:14 +01:00
pnv.c ppc/pnv: Introduce user creatable pnv-phb4 devices 2022-01-12 11:28:27 +01:00
pnv_bmc.c Various spelling fixes 2021-03-09 21:19:10 +01:00
pnv_core.c ppc/pnv: Rename "id" to "quad-id" in PnvQuad 2021-09-29 19:37:38 +10:00
pnv_homer.c ppc/pnv: change the PowerNV machine devices to be non user creatable 2020-02-02 14:07:57 +11:00
pnv_lpc.c ppc/pnv: Introduce a LPC FW memory region attribute to map the PNOR 2021-02-10 10:43:50 +11:00
pnv_occ.c ppc/pnv: change the PowerNV machine devices to be non user creatable 2020-02-02 14:07:57 +11:00
pnv_pnor.c ppc/pnv: Fix check on block device before updating drive contents 2021-11-09 10:32:52 +11:00
pnv_psi.c ppc patch queue 2021-05-04 2021-05-05 20:29:14 +01:00
pnv_xscom.c ppc/pnv: Add a comment on the "primary-topology-index" property 2021-09-29 19:37:38 +10:00
ppc.c ppc: allow the hdecr timer to be created/destroyed 2022-02-18 08:34:14 +01:00
ppc4xx_devs.c ppc/ppc4xx: Convert printfs() 2022-01-04 07:55:34 +01:00
ppc4xx_pci.c ppc/ppc4xx: Convert printfs() 2022-01-04 07:55:34 +01:00
ppc405.h ppc/ppc405: Fix bi_pci_enetaddr2 field in U-Boot board information 2021-12-17 17:57:17 +01:00
ppc405_boards.c ppc/ppc405: Fix boot from kernel 2021-12-17 17:57:17 +01:00
ppc405_uc.c ppc/ppc405: Fix timer initialization 2022-01-04 07:55:34 +01:00
ppc440.h ppc440_uc: Basic emulation of PPC440 DMA controller 2018-07-03 09:56:52 +10:00
ppc440_bamboo.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
ppc440_pcix.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
ppc440_uc.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
ppc_booke.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
ppce500_spin.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
prep.c target/ppc: Remove PowerPC 601 CPUs 2022-02-09 09:08:55 +01:00
prep_systemio.c prep: add ppc-parity write method 2021-02-08 15:15:32 +01:00
rs6000_mc.c Do not include hw/boards.h if it's not really necessary 2021-05-02 17:24:51 +02:00
sam460ex.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
spapr.c spapr: implement nested-hv capability for the virtual hypervisor 2022-02-18 08:34:14 +01:00
spapr_caps.c spapr: implement nested-hv capability for the virtual hypervisor 2022-02-18 08:34:14 +01:00
spapr_cpu_core.c spapr: prevent hdec timer being set up under virtual hypervisor 2022-02-18 08:34:14 +01:00
spapr_drc.c spapr: use DEVICE_UNPLUG_GUEST_ERROR to report unplug errors 2021-09-30 12:26:06 +10:00
spapr_events.c spapr: Explain purpose of ->fwnmi_migration_blocker more clearly 2021-08-26 17:15:28 +02:00
spapr_hcall.c spapr: implement nested-hv capability for the virtual hypervisor 2022-02-18 08:34:14 +01:00
spapr_iommu.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
spapr_irq.c spapr/xics: Drop unused argument to xics_kvm_has_broken_disconnect() 2020-12-14 15:50:55 +11:00
spapr_numa.c spapr_numa.c: fix FORM1 distance-less nodes 2021-11-10 13:48:13 +01:00
spapr_nvdimm.c spapr: nvdimm: Introduce spapr-nvdimm device 2022-02-18 08:34:14 +01:00
spapr_ovec.c spapr: Improve handling of memory unplug with old guests 2021-01-19 10:20:29 +11:00
spapr_pci.c pci: Export pci_for_each_device_under_bus*() 2021-11-01 19:36:11 -04:00
spapr_pci_nvlink2.c pci: Export pci_for_each_device_under_bus*() 2021-11-01 19:36:11 -04:00
spapr_pci_vfio.c pci: Export pci_for_each_device_under_bus*() 2021-11-01 19:36:11 -04:00
spapr_rng.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
spapr_rtas.c spapr: Set LPCR to current AIL mode when starting a new CPU 2021-06-03 13:22:06 +10:00
spapr_rtas_ddw.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
spapr_rtc.c rtc: Move RTC function prototypes to their own header 2022-01-28 14:29:46 +00:00
spapr_softmmu.c target/ppc: fix Hash64 MMU update of PTE bit R 2021-11-29 21:00:08 +01:00
spapr_tpm_proxy.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
spapr_vio.c qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
spapr_vof.c spapr: Force 32bit when resetting a core 2022-01-28 13:15:01 +01:00
trace-events ppc/ppc405: Restore TCR and STR write handlers 2022-01-04 07:55:34 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
virtex_ml507.c Do not include exec/address-spaces.h if it's not really necessary 2021-05-02 17:24:51 +02:00
vof.c hw/ppc/vof: Add missing includes 2022-01-28 13:15:03 +01:00