KVM: PPC: Book3S HV: Support reset of secure guest
authorBharata B Rao <bharata@linux.ibm.com>
Mon, 25 Nov 2019 03:06:30 +0000 (08:36 +0530)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 28 Nov 2019 06:02:31 +0000 (17:02 +1100)
commit22945688acd4d0ec2620b0670a53110401ed9c59
tree389ea049e1286364c1ccafde9c6c307eb1e5ab23
parentc32622575dd0ecb6fd0b41e3a451bd58152971ba
KVM: PPC: Book3S HV: Support reset of secure guest

Add support for reset of secure guest via a new ioctl KVM_PPC_SVM_OFF.
This ioctl will be issued by QEMU during reset and includes the
the following steps:

- Release all device pages of the secure guest.
- Ask UV to terminate the guest via UV_SVM_TERMINATE ucall
- Unpin the VPA pages so that they can be migrated back to secure
  side when guest becomes secure again. This is required because
  pinned pages can't be migrated.
- Reinit the partition scoped page tables

After these steps, guest is ready to issue UV_ESM call once again
to switch to secure mode.

Signed-off-by: Bharata B Rao <bharata@linux.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
[Implementation of uv_svm_terminate() and its call from
guest shutdown path]
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
[Unpinning of VPA pages]
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Documentation/virt/kvm/api.txt
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/include/asm/ultravisor-api.h
arch/powerpc/include/asm/ultravisor.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/powerpc.c
include/uapi/linux/kvm.h