summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kvm_book3s_uvmem.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2020-03-19 15:29:55 +1100
committerPaul Mackerras <paulus@ozlabs.org>2020-03-26 11:09:04 +1100
commit9a5788c615f52f6d7bf0b61986a632d4ec86791d (patch)
tree6f21798f53aa6e38106980450fcdadc1a68148d5 /arch/powerpc/include/asm/kvm_book3s_uvmem.h
parent377f02d487b5f74a2411fa01316ba4aff1819629 (diff)
downloadlinux-9a5788c615f52f6d7bf0b61986a632d4ec86791d.tar.bz2
KVM: PPC: Book3S HV: Add a capability for enabling secure guests
At present, on Power systems with Protected Execution Facility hardware and an ultravisor, a KVM guest can transition to being a secure guest at will. Userspace (QEMU) has no way of knowing whether a host system is capable of running secure guests. This will present a problem in future when the ultravisor is capable of migrating secure guests from one host to another, because virtualization management software will have no way to ensure that secure guests only run in domains where all of the hosts can support secure guests. This adds a VM capability which has two functions: (a) userspace can query it to find out whether the host can support secure guests, and (b) userspace can enable it for a guest, which allows that guest to become a secure guest. If userspace does not enable it, KVM will return an error when the ultravisor does the hypercall that indicates that the guest is starting to transition to a secure guest. The ultravisor will then abort the transition and the guest will terminate. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Ram Pai <linuxram@us.ibm.com>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_book3s_uvmem.h')
-rw-r--r--arch/powerpc/include/asm/kvm_book3s_uvmem.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s_uvmem.h b/arch/powerpc/include/asm/kvm_book3s_uvmem.h
index 5a9834e0e2d1..9cb7d8be2366 100644
--- a/arch/powerpc/include/asm/kvm_book3s_uvmem.h
+++ b/arch/powerpc/include/asm/kvm_book3s_uvmem.h
@@ -5,6 +5,7 @@
#ifdef CONFIG_PPC_UV
int kvmppc_uvmem_init(void);
void kvmppc_uvmem_free(void);
+bool kvmppc_uvmem_available(void);
int kvmppc_uvmem_slot_init(struct kvm *kvm, const struct kvm_memory_slot *slot);
void kvmppc_uvmem_slot_free(struct kvm *kvm,
const struct kvm_memory_slot *slot);
@@ -30,6 +31,11 @@ static inline int kvmppc_uvmem_init(void)
static inline void kvmppc_uvmem_free(void) { }
+static inline bool kvmppc_uvmem_available(void)
+{
+ return false;
+}
+
static inline int
kvmppc_uvmem_slot_init(struct kvm *kvm, const struct kvm_memory_slot *slot)
{