summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Guo <wei.guo.simon@gmail.com>2018-05-23 15:02:08 +0800
committerPaul Mackerras <paulus@ozlabs.org>2018-06-01 10:30:48 +1000
commitd234d68eb7464c9ebd11e870404e83d3e9348406 (patch)
treebe1c8c775b03cfc687fae507dc20752f3ccf7492
parent7284ca8a5eaee311d2e4aec73b2df9bd57e0cdcb (diff)
downloadlinux-stable-d234d68eb7464c9ebd11e870404e83d3e9348406.tar.gz
linux-stable-d234d68eb7464c9ebd11e870404e83d3e9348406.tar.bz2
linux-stable-d234d68eb7464c9ebd11e870404e83d3e9348406.zip
KVM: PPC: Book3S PR: Enable HTM for PR KVM for KVM_CHECK_EXTENSION ioctl
With current patch set, PR KVM now supports HTM. So this patch turns it on for PR KVM. Tested with: https://github.com/justdoitqd/publicFiles/blob/master/test_kvm_htm_cap.c Signed-off-by: Simon Guo <wei.guo.simon@gmail.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-rw-r--r--arch/powerpc/kvm/powerpc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 05eccdc10fdd..b8247fac3e56 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -648,9 +648,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
#endif
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
case KVM_CAP_PPC_HTM:
- r = hv_enabled &&
- (!!(cur_cpu_spec->cpu_user_features2 & PPC_FEATURE2_HTM) ||
- cpu_has_feature(CPU_FTR_P9_TM_HV_ASSIST));
+ r = !!(cur_cpu_spec->cpu_user_features2 & PPC_FEATURE2_HTM) ||
+ (hv_enabled && cpu_has_feature(CPU_FTR_P9_TM_HV_ASSIST));
break;
#endif
default: