From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57821C43334 for ; Tue, 19 Jul 2022 12:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238211AbiGSMFz (ORCPT ); Tue, 19 Jul 2022 08:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238295AbiGSMEW (ORCPT ); Tue, 19 Jul 2022 08:04:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C52420F66; Tue, 19 Jul 2022 05:00:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 79B856163C; Tue, 19 Jul 2022 12:00:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B76BC341C6; Tue, 19 Jul 2022 12:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232012; bh=Qq1egKqaN2guD+MLaTNP3WxiufugS4HznBle4H2PDEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JaRZDlG8l9aQ2ZbSKTO6IE3QHFjgFWIUqIMHnJoRLPwp/zNaXGa7n12EYnLZPYGlX oEnANF1LgSv+WI/WpdDfCRTDXFxVP2Vkfk6C6ind41/r4dbswcf+f/O07c5W5jcoLL aUqJJQVra7flMF4fEvjLmj+8vxljNxEjJ2GbzSiU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Hunter , Ard Biesheuvel , "Russell King (Oracle)" , Sasha Levin Subject: [PATCH 4.19 12/48] ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle Date: Tue, 19 Jul 2022 13:53:49 +0200 Message-Id: <20220719114520.982991373@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114518.915546280@linuxfoundation.org> References: <20220719114518.915546280@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel [ Upstream commit 0609e200246bfd3b7516091c491bec4308349055 ] Jon reports that the Spectre-BHB init code is filling up the kernel log with spurious notifications about which mitigation has been enabled, every time any CPU comes out of a low power state. Given that Spectre-BHB mitigations are system wide, only a single mitigation can be enabled, and we already print an error if two types of CPUs coexist in a single system that require different Spectre-BHB mitigations. This means that the pr_info() that describes the selected mitigation does not need to be emitted for each CPU anyway, and so we can simply emit it only once. In order to clarify the above in the log message, update it to describe that the selected mitigation will be enabled on all CPUs, including ones that are unaffected. If another CPU comes up later that is affected and requires a different mitigation, we report an error as before. Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Tested-by: Jon Hunter Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) Signed-off-by: Sasha Levin --- arch/arm/mm/proc-v7-bugs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/proc-v7-bugs.c b/arch/arm/mm/proc-v7-bugs.c index 40fb2900038e..e53f824a2583 100644 --- a/arch/arm/mm/proc-v7-bugs.c +++ b/arch/arm/mm/proc-v7-bugs.c @@ -222,10 +222,10 @@ static int spectre_bhb_install_workaround(int method) return SPECTRE_VULNERABLE; spectre_bhb_method = method; - } - pr_info("CPU%u: Spectre BHB: using %s workaround\n", - smp_processor_id(), spectre_bhb_method_name(method)); + pr_info("CPU%u: Spectre BHB: enabling %s workaround for all CPUs\n", + smp_processor_id(), spectre_bhb_method_name(method)); + } return SPECTRE_MITIGATED; } -- 2.35.1