spapr: Handle HPT allocation failure in nested guest
commitf0638a0b6bba455e8eaf518f23487d6ff1f59b5a
authorFabiano Rosas <farosas@linux.ibm.com>
Fri, 11 Sep 2020 04:31:23 +0000 (11 01:31 -0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 8 Oct 2020 23:15:06 +0000 (9 10:15 +1100)
treec894e067f5fb9b461e7ebaaeab0defad3eca3682
parent497d415d76b9f59fcae27f22df1ca2c3fa4df64e
spapr: Handle HPT allocation failure in nested guest

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