diff options
author | Paul Mackerras <paulus@samba.org> | 2014-06-02 11:03:00 +1000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-07-28 15:22:18 +0200 |
commit | ae2113a4f1a6cd5a3cd3d75f394547922758e9ac (patch) | |
tree | 59a1dbf6369d853d0ad76c62a0333c47bb8992d0 /arch/powerpc/kvm/powerpc.c | |
parent | 699a0ea0823d32030b0666b28ff8633960f7ffa7 (diff) | |
download | talos-op-linux-ae2113a4f1a6cd5a3cd3d75f394547922758e9ac.tar.gz talos-op-linux-ae2113a4f1a6cd5a3cd3d75f394547922758e9ac.zip |
KVM: PPC: Book3S: Allow only implemented hcalls to be enabled or disabled
This adds code to check that when the KVM_CAP_PPC_ENABLE_HCALL
capability is used to enable or disable in-kernel handling of an
hcall, that the hcall is actually implemented by the kernel.
If not an EINVAL error is returned.
This also checks the default-enabled list of hcalls and prints a
warning if any hcall there is not actually implemented.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/powerpc.c')
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 3222a4d08a6f..7efc2b711404 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -1119,6 +1119,8 @@ static int kvm_vm_ioctl_enable_cap(struct kvm *kvm, if (hcall > MAX_HCALL_OPCODE || (hcall & 3) || cap->args[1] > 1) break; + if (!kvmppc_book3s_hcall_implemented(kvm, hcall)) + break; if (cap->args[1]) set_bit(hcall / 4, kvm->arch.enabled_hcalls); else |