From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs7Oc-0004Q4-L2 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 08:03:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bs7Oa-0007X3-HM for qemu-devel@nongnu.org; Thu, 06 Oct 2016 08:03:30 -0400 From: David Gibson Date: Thu, 6 Oct 2016 23:03:07 +1100 Message-Id: <1475755395-27307-22-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1475755395-27307-1-git-send-email-david@gibson.dropbear.id.au> References: <1475755395-27307-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PULL 21/29] target-ppc/kvm: Enable transactional memory on POWER8 with KVM-HV, too List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Thomas Huth , David Gibson From: Thomas Huth 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 Signed-off-by: David Gibson --- target-ppc/kvm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 83482b4..9c4834c 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; } -- 2.7.4