diff options
author | Sam Bobroff <sam.bobroff@au1.ibm.com> | 2016-07-19 23:41:36 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-08-01 13:42:06 -0400 |
commit | 23528bb21ee2c9b27f3feddd77a2a3351a8df148 (patch) | |
tree | eb17f1c15fa51cc04a606cd79658c806637eaddb | |
parent | 40a2df49858eb40ccfe979da69b74d8b203a869b (diff) |
KVM: PPC: Introduce KVM_CAP_PPC_HTM
Introduce a new KVM capability, KVM_CAP_PPC_HTM, that can be queried to
determine if a PowerPC KVM guest should use HTM (Hardware Transactional
Memory).
This will be used by QEMU to populate the pa-features bits in the
guest's device tree.
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 4 | ||||
-rw-r--r-- | include/uapi/linux/kvm.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 1ac036e45ed4..6ce40dd6fe51 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -588,6 +588,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) | |||
588 | r = 1; | 588 | r = 1; |
589 | break; | 589 | break; |
590 | #endif | 590 | #endif |
591 | case KVM_CAP_PPC_HTM: | ||
592 | r = cpu_has_feature(CPU_FTR_TM_COMP) && | ||
593 | is_kvmppc_hv_enabled(kvm); | ||
594 | break; | ||
591 | default: | 595 | default: |
592 | r = 0; | 596 | r = 0; |
593 | break; | 597 | break; |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 8f2756c263d4..e98bb4cce639 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -869,6 +869,7 @@ struct kvm_ppc_smmu_info { | |||
869 | #define KVM_CAP_X2APIC_API 129 | 869 | #define KVM_CAP_X2APIC_API 129 |
870 | #define KVM_CAP_S390_USER_INSTR0 130 | 870 | #define KVM_CAP_S390_USER_INSTR0 130 |
871 | #define KVM_CAP_MSI_DEVID 131 | 871 | #define KVM_CAP_MSI_DEVID 131 |
872 | #define KVM_CAP_PPC_HTM 132 | ||
872 | 873 | ||
873 | #ifdef KVM_CAP_IRQ_ROUTING | 874 | #ifdef KVM_CAP_IRQ_ROUTING |
874 | 875 | ||