Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp673774ybh; Tue, 10 Mar 2020 06:15:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv54kPTMMW2TCPt7qeK85ZmYWpRljS/6wrjWUJnOUriSEcCZrBL6ewqUwacXv8W0eSIswmF X-Received: by 2002:a9d:600d:: with SMTP id h13mr11104248otj.213.1583846141329; Tue, 10 Mar 2020 06:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583846141; cv=none; d=google.com; s=arc-20160816; b=z7HG+3YfzPGBz5v521ig0ZQIW0XiSLmUu+ikRmFBMBq5OGXc+L7+z+f6M+f96mKAXO 2/9h8qqS/DRkvbG9xr612MdEx3JqdmuqUXASqZqiV0HOnOCLGGKdOrPUiXCr7JVrhyDm 82lXiKqlN4E3jvRDzlaspYeu+Nf9yabZzZcoFc5Dzfpk5qhgXumSw/LuL15TnYC4XMjv NUEgPTb69Wjk/2AIhOTCQy9xoH9tmNgB99flRVP5KRZ8vC5cDHWPWDDZnZpKHqE71xSI Z/BlcbZK4Pj2jVCdDKBpqCe0DhndKao7GiuK2J1PV+Nmn5ZBAgQtDwgyRN9iQZ+34T39 op/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OLyMZ/tqnW2t46EUfL1U1PZFyzEp+hbSspWTxl9jnsw=; b=QGLSM0H8Xi5DGRZzH84L+KzT2r5YFzXIkL8/RnIEP8eUDxHvCHu37IH1J4Dzb3wV7f NrK2UZ4Qa9JUFnv/ceFwtvY5oBQM/LJiLxzIVGNtit5x9c67Iv6pddfN1uzjQJUl3uVE dTT5eXXzEtfLIVTaM0hCH0BTv0+3mf1L+NVg0J7izpm2aqU6gMj+QdBtAYeJY8vh9cja 0PvOYeCNGTqt+QsFBVxV0sJgQPM4TIEZIc3EM0dPAdOJqWzljqLLFM5u+FczP3iLNQlK zWD9tbhddnamMFr8O4WdAoy6epF+mC+KgPlB+Y9OUF7CyU4TNk5E3e2btIMrRO/Nos5o SQIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WU5xnnn1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si7571881otr.262.2020.03.10.06.15.29; Tue, 10 Mar 2020 06:15:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WU5xnnn1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731933AbgCJNOt (ORCPT + 99 others); Tue, 10 Mar 2020 09:14:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:38742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731918AbgCJNOp (ORCPT ); Tue, 10 Mar 2020 09:14:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 80A5A20409; Tue, 10 Mar 2020 13:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583846085; bh=N7ZjrJbpQYOlJtKKx2Idc4ra5Chlqv/dLveE4xpwF0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WU5xnnn1mIwMTgzSoljSAufHUit2ncZtg4ePxjYaYKXbWZXf+Fp+IKjCebqEiLbJ5 bkovflDnMT2NF0TUKHwq9b1Qmyal6bXHT9PfglrCo6MmUSdg976/+yDQjE24OmX46L Wg8iLkeGGmte5U0UHlddIetwqFk3V/hc3enJqwD8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Desnes A. Nunes do Rosario" , Leonardo Bras , Michael Ellerman Subject: [PATCH 4.19 82/86] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems Date: Tue, 10 Mar 2020 13:45:46 +0100 Message-Id: <20200310124535.279386096@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310124530.808338541@linuxfoundation.org> References: <20200310124530.808338541@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Desnes A. Nunes do Rosario commit fc37a1632d40c80c067eb1bc235139f5867a2667 upstream. PowerVM systems running compatibility mode on a few Power8 revisions are still vulnerable to the hardware defect that loses PMU exceptions arriving prior to a context switch. The software fix for this issue is enabled through the CPU_FTR_PMAO_BUG cpu_feature bit, nevertheless this bit also needs to be set for PowerVM compatibility mode systems. Fixes: 68f2f0d431d9ea4 ("powerpc: Add a cpu feature CPU_FTR_PMAO_BUG") Signed-off-by: Desnes A. Nunes do Rosario Reviewed-by: Leonardo Bras Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200227134715.9715-1-desnesn@linux.ibm.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/cputable.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c @@ -2188,11 +2188,13 @@ static struct cpu_spec * __init setup_cp * oprofile_cpu_type already has a value, then we are * possibly overriding a real PVR with a logical one, * and, in that case, keep the current value for - * oprofile_cpu_type. + * oprofile_cpu_type. Futhermore, let's ensure that the + * fix for the PMAO bug is enabled on compatibility mode. */ if (old.oprofile_cpu_type != NULL) { t->oprofile_cpu_type = old.oprofile_cpu_type; t->oprofile_type = old.oprofile_type; + t->cpu_features |= old.cpu_features & CPU_FTR_PMAO_BUG; } }