summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-09-29 12:48:07 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-10-05 11:05:28 +1100
commit7f516c9675285298826d4ef20ce1a093b13caf89 (patch)
treecad550dc847799bd22dcb26c54a7181d775e5854
parent96c9cff0ab986f3a0606e1a96c5b00e6a7c675c6 (diff)
downloadfocaccia-qemu-7f516c9675285298826d4ef20ce1a093b13caf89.tar.gz
focaccia-qemu-7f516c9675285298826d4ef20ce1a093b13caf89.zip
target-ppc/kvm: Enable transactional memory on POWER8 with KVM-HV, too
Transactional memory is also supported on POWER8 KVM-HV if the
KVM_CAP_PPC_HTM is not available in the kernel yet, so add a hack
to allow TM here, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to '')
-rw-r--r--target-ppc/kvm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 83482b46ae..9c4834c4fc 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -570,11 +570,18 @@ int kvm_arch_init_vcpu(CPUState *cs)
 
     idle_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, kvm_kick_cpu, cpu);
 
-    /* Some targets support access to KVM's guest TLB. */
     switch (cenv->mmu_model) {
     case POWERPC_MMU_BOOKE206:
+        /* This target supports access to KVM's guest TLB */
         ret = kvm_booke206_tlb_init(cpu);
         break;
+    case POWERPC_MMU_2_07:
+        if (!cap_htm && !kvmppc_is_pr(cs->kvm_state)) {
+            /* KVM-HV has transactional memory on POWER8 also without the
+             * KVM_CAP_PPC_HTM extension, so enable it here instead. */
+            cap_htm = true;
+        }
+        break;
     default:
         break;
     }