From patchwork Wed Mar 21 10:24:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 888661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="fA8ZfkMO"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 405mCH2h4rz9s1S for ; Wed, 21 Mar 2018 21:25:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751676AbeCUKZL (ORCPT ); Wed, 21 Mar 2018 06:25:11 -0400 Received: from ozlabs.org ([103.22.144.67]:52993 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbeCUKZK (ORCPT ); Wed, 21 Mar 2018 06:25:10 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 405mC8363Zz9s0m; Wed, 21 Mar 2018 21:25:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1521627908; bh=Sal9kjHhiOP0hZMiC/I6AJ10FPGx8aWh20NKJ7JwY7E=; h=From:To:Cc:Subject:Date:From; b=fA8ZfkMOJfd43vzg6C5rRKh7e6zJSJIXaKOuoMohcQqedPZdvi7L3VldepVTQHJO4 6cojT8cllnfLOhjn+wCxTXehGyoF49gjZAGkf5beX1TQ4miq6/bs0aAE42q39cb2aL nUgdwjmDAK90jcSUc0wkTuJVq18gqn51njOQxvhLweurotWJOf0rSAZEKELGEEFKQf gj1whPLqEm6VNcYor48cY3XCl1bIqPTP/pXNlJZ+Oq4FMBfBuE9xIj5y339KlVr8kh mxx5fzAXLAJ790amAmNwh11P71W72QRjpIIWz67uWhkMASgDDGCAudo4uTRYVTF29w f4reKglihLtag== From: Paul Mackerras To: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org Cc: kvm-ppc@vger.kernel.org Subject: [PATCH 0/5] KVM & powerpc: Work around POWER9 TM hardware bugs Date: Wed, 21 Mar 2018 21:24:56 +1100 Message-Id: <1521627901-13547-1-git-send-email-paulus@ozlabs.org> X-Mailer: git-send-email 2.7.4 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org This patch series applies on top of my patch series "powerpc: Free up CPU feature bits". POWER9 has some shortcomings in its implementation of transactional memory. Starting with v2.2 of the "Nimbus" chip, some changes have been made to the hardware which make it able to generate hypervisor interrupts in the situations where hardware needs the hypervisor to provide some assistance with the implementation. Specifically, the core does not have enough storage to store a complete checkpoint of all the architected state for all 4 threads, and therefore needs to be able to offload the checkpointed state of threads which are in transactional suspended state (for threads that are in transactional state, the hardware can simply abort the transaction). This series implements the hypervisor assistance for TM for KVM guests, thus allowing them to use TM. This then means that we can allow live migration of guests on POWER8 that may be using TM to POWER9 hosts. This version adds a feature bit for the XER[SO] bug workaround so that it can be turned off on future systems which may still require hypervisor assistance for TM but have the XER[SO] bug fixed. It also makes the test in the idle code (which includes a sync instruction) conditional on the XER[SO] bug feature bit, meaning that the code to force SMT4 mode will only work when that feature bit is set. Paul. arch/powerpc/include/asm/asm-prototypes.h | 3 + arch/powerpc/include/asm/cputable.h | 7 +- arch/powerpc/include/asm/kvm_asm.h | 2 + arch/powerpc/include/asm/kvm_book3s.h | 4 + arch/powerpc/include/asm/kvm_book3s_64.h | 43 ++++++ arch/powerpc/include/asm/kvm_book3s_asm.h | 1 + arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/include/asm/paca.h | 3 + arch/powerpc/include/asm/powernv.h | 1 + arch/powerpc/include/asm/ppc-opcode.h | 4 + arch/powerpc/include/asm/reg.h | 7 + arch/powerpc/kernel/asm-offsets.c | 3 + arch/powerpc/kernel/cputable.c | 23 +++- arch/powerpc/kernel/dt_cpu_ftrs.c | 5 + arch/powerpc/kernel/exceptions-64s.S | 4 +- arch/powerpc/kernel/idle_book3s.S | 21 +++ arch/powerpc/kvm/Makefile | 7 + arch/powerpc/kvm/book3s_hv.c | 18 ++- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 166 ++++++++++++++++++++++- arch/powerpc/kvm/book3s_hv_tm.c | 216 ++++++++++++++++++++++++++++++ arch/powerpc/kvm/book3s_hv_tm_builtin.c | 109 +++++++++++++++ arch/powerpc/kvm/powerpc.c | 5 +- arch/powerpc/platforms/powernv/idle.c | 81 +++++++++++ 23 files changed, 720 insertions(+), 14 deletions(-) --- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html