mbox series

[0/3] spapr: Nested TCG is TCG only

Message ID 20220317172049.2681740-1-farosas@linux.ibm.com (mailing list archive)
Headers show
Series spapr: Nested TCG is TCG only | expand

Message

Fabiano Rosas March 17, 2022, 5:20 p.m. UTC
In a KVM-only scenario that does not support nested KVM, a well
written guest would never try to call nested KVM hypercalls. However,
if a buggy or malicious guest calls the nested KVM API even without
nested KVM support, the L0 would redirect the hypercalls into
QEMU. Previously this would have caused an H_FUNCTION return for every
call, but now that QEMU knows about the nested KVM API, it tries to
service the calls. This is incorrect because the spapr virtual
hypervisor implementation of the nested KVM API depends on the first
level guest to be emulated by TCG.

So add guards against that and move the whole code under CONFIG_TCG.

Fabiano Rosas (3):
  spapr: Ignore nested KVM hypercalls when not running TCG
  spapr: Move hypercall_register_softmmu
  spapr: Move nested KVM hypercalls under a TCG only config.

 hw/ppc/spapr_hcall.c | 76 ++++++++++++++++++++++++++------------------
 1 file changed, 45 insertions(+), 31 deletions(-)