[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/20] spapr: Handle HPT allocation failure in nested guest
From: |
David Gibson |
Subject: |
[PULL 01/20] spapr: Handle HPT allocation failure in nested guest |
Date: |
Fri, 9 Oct 2020 21:19:32 +1100 |
From: Fabiano Rosas <farosas@linux.ibm.com>
The nested KVM code does not yet support HPT guests. Calling the
KVM_CAP_PPC_ALLOC_HTAB ioctl currently leads to KVM setting the guest
as HPT and erroneously executing code in L1 that should only run in
hypervisor mode, leading to an exception in the L1 vcpu thread when it
enters the nested guest.
This can be reproduced with -machine max-cpu-compat=power8 in the L2
guest command line.
The KVM code has since been modified to fail the ioctl when running in
a nested environment so QEMU needs to be able to handle that. This
patch provides an error message informing the user about the lack of
support for HPT in nested guests.
Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20200911043123.204162-1-farosas@linux.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 2db810f73a..544a1947d9 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1483,6 +1483,12 @@ void spapr_reallocate_hpt(SpaprMachineState *spapr, int
shift,
spapr_free_hpt(spapr);
rc = kvmppc_reset_htab(shift);
+
+ if (rc == -EOPNOTSUPP) {
+ error_setg(errp, "HPT not supported in nested guests");
+ return;
+ }
+
if (rc < 0) {
/* kernel-side HPT needed, but couldn't allocate one */
error_setg_errno(errp, errno,
--
2.26.2
- [PULL 00/20] ppc-for-5.2 queue 20201009, David Gibson, 2020/10/09
- [PULL 01/20] spapr: Handle HPT allocation failure in nested guest,
David Gibson <=
- [PULL 04/20] ppc: Fix return value in cpu_post_load() error path, David Gibson, 2020/10/09
- [PULL 03/20] ppc: Add a return value to ppc_set_compat() and ppc_set_compat_all(), David Gibson, 2020/10/09
- [PULL 02/20] spapr: Fix error leak in spapr_realize_vcpu(), David Gibson, 2020/10/09
- [PULL 05/20] spapr: Simplify error handling in callers of ppc_set_compat(), David Gibson, 2020/10/09
- [PULL 06/20] spapr: Get rid of cas_check_pvr() error reporting, David Gibson, 2020/10/09
- [PULL 08/20] spapr: Simplify error handling in spapr_vio_busdev_realize(), David Gibson, 2020/10/09
- [PULL 10/20] spapr: Simplify error handling in prop_get_fdt(), David Gibson, 2020/10/09
- [PULL 20/20] specs/ppc-spapr-numa: update with new NUMA support, David Gibson, 2020/10/09
- [PULL 18/20] spapr_numa: change reference-points and maxdomain settings, David Gibson, 2020/10/09
- [PULL 07/20] spapr: Simplify error handling in do_client_architecture_support(), David Gibson, 2020/10/09