Skip to content

Commit

Permalink
target-ppc/kvm: Enable transactional memory on POWER8 with KVM-HV, too
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
huth authored and dgibson committed Oct 5, 2016
1 parent 96c9cff commit 7f516c9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion target-ppc/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7f516c9

Please sign in to comment.