Skip to content

Commit 23528bb

Browse files
sambltcbonzini
authored andcommitted
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>
1 parent 40a2df4 commit 23528bb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

arch/powerpc/kvm/powerpc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
588588
r = 1;
589589
break;
590590
#endif
591+
case KVM_CAP_PPC_HTM:
592+
r = cpu_has_feature(CPU_FTR_TM_COMP) &&
593+
is_kvmppc_hv_enabled(kvm);
594+
break;
591595
default:
592596
r = 0;
593597
break;

include/uapi/linux/kvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ struct kvm_ppc_smmu_info {
869869
#define KVM_CAP_X2APIC_API 129
870870
#define KVM_CAP_S390_USER_INSTR0 130
871871
#define KVM_CAP_MSI_DEVID 131
872+
#define KVM_CAP_PPC_HTM 132
872873

873874
#ifdef KVM_CAP_IRQ_ROUTING
874875

0 commit comments

Comments
 (0)