]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: PPC: Add CAP to indicate hcall fixes
authorAlexander Graf <agraf@suse.de>
Thu, 22 May 2014 15:40:15 +0000 (17:40 +0200)
committerAlexander Graf <agraf@suse.de>
Fri, 30 May 2014 12:26:27 +0000 (14:26 +0200)
We worked around some nasty KVM magic page hcall breakages:

  1) NX bit not honored, so ignore NX when we detect it
  2) LE guests swizzle hypercall instruction

Without these fixes in place, there's no way it would make sense to expose kvm
hypercalls to a guest. Chances are immensely high it would trip over and break.

So add a new CAP that gives user space a hint that we have workarounds for the
bugs above in place. It can use those as hint to disable PV hypercalls when
the guest CPU is anything POWER7 or higher and the host does not have fixes
in place.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/powerpc.c
include/uapi/linux/kvm.h

index 154f352c39ae42d0cf81ddc6f93ffb4df7456bc0..bab20f4104430489674b5c05e4a1223036e2eac3 100644 (file)
@@ -416,6 +416,7 @@ int kvm_dev_ioctl_check_extension(long ext)
        case KVM_CAP_SPAPR_TCE:
        case KVM_CAP_PPC_ALLOC_HTAB:
        case KVM_CAP_PPC_RTAS:
+       case KVM_CAP_PPC_FIXUP_HCALL:
 #ifdef CONFIG_KVM_XICS
        case KVM_CAP_IRQ_XICS:
 #endif
index 2b83cf35437a5a6dab6ecc01d3c94265892bdd60..16c923de85e753f8a43de2977595032472d2b645 100644 (file)
@@ -748,6 +748,7 @@ struct kvm_ppc_smmu_info {
 #define KVM_CAP_S390_IRQCHIP 99
 #define KVM_CAP_IOEVENTFD_NO_LENGTH 100
 #define KVM_CAP_VM_ATTRIBUTES 101
+#define KVM_CAP_PPC_FIXUP_HCALL 102
 
 #ifdef KVM_CAP_IRQ_ROUTING