From patchwork Tue Mar 10 12:42:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 229641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38B5BC10F27 for ; Tue, 10 Mar 2020 13:10:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00C8424649 for ; Tue, 10 Mar 2020 13:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845859; bh=vOLqPUkrIFKun3K8ZLpcW5BYZQ6Hp26NIkskCwvGYhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=z0jXgP2xaLxIBPUoIwac3DfltTBX262f6vPBjPAXhLKX4TRdJeXWPj7O4BydDs+b2 4sdUPWXRm0J7ciXwg1Yap7OYJQI86onzDkK8o3FBYb7MrVlycMoV5oYdME2UNKLugb 3+APxUiO9cYoyX+8954ca/pruHYNoO9165tMBMa0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728636AbgCJNK5 (ORCPT ); Tue, 10 Mar 2020 09:10:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:60474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731135AbgCJNK5 (ORCPT ); Tue, 10 Mar 2020 09:10:57 -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 AC6892467D; Tue, 10 Mar 2020 13:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845856; bh=vOLqPUkrIFKun3K8ZLpcW5BYZQ6Hp26NIkskCwvGYhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvletcAcu1LtPwKqGhxCuviduBXJCzP/fp+ZYeajOLyJJjaSb9RxNtDQuz0Nm/tpg yL2q957DJ1GFAXcP2qloY3Zwd4Cb6YhiP1iooNc0xF6kbcORsmh//1WHOjBeYIfWch qXZI/V/B1e6hNxpKvrrvT8GEdmjoxrJJTpS+Ccp0= 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.14 124/126] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems Date: Tue, 10 Mar 2020 13:42:25 +0100 Message-Id: <20200310124211.327163434@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310124203.704193207@linuxfoundation.org> References: <20200310124203.704193207@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 @@ -2232,11 +2232,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; } }