From patchwork Wed May 25 14:14:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 12861257 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73FE2C433F5 for ; Wed, 25 May 2022 14:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FMCXnM7gMq0PLPyyNGZkDTZ/19ZR7sqcoR3vjeL2shQ=; b=Nq2avKEKGc44Bk Um8wMRoI84O+cxc5EBKWVLBLhHNxqGzHY4fay08vVrtvXR03HY7NAxZ6CCOeN0SDsgMCpOyIbVyS8 LwHVlWmbvaLH9t2AV1HIV6oM1js6V2KazqyojLlJiqDHVObtyYIiUR3tgUwTs8P9pwvYQaYwAnSC9 HrjlIgrYMj1GlmT4kNqiOnZrdCjgTO+bTvbQAXzfKCO0C3Mhwe9padPOrGNllYoRB7GIpoluAB2Qd NuF77/ZgxnGEEXGCzyqLTihJtS72EYd6wonsZEDd1HuL3jfhLXDA3ddUtGuf5us01knOTfsuLADDX O60sPAD4t2lu9DYMXvqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntrnL-00BP4a-7k; Wed, 25 May 2022 14:15:27 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntrnI-00BP4A-NJ for linux-arm-kernel@lists.infradead.org; Wed, 25 May 2022 14:15:26 +0000 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 3DCE361873; Wed, 25 May 2022 14:15:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A25DDC385B8; Wed, 25 May 2022 14:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653488123; bh=S1Gj/2OcFLv/NRlqB1KX2nPJuAHizF+qPlTsXdSwkmg=; h=From:To:Cc:Subject:Date:From; b=pFW2twbiU13LurQimsOgIwIDRjaAavP0cMkuOdu+3Hdd2ObV9nN/Syjgoq+nmQxc/ mmEL7fYrLxJj9KChC0Om+umNNcBLnvhvmE8sRuhlWxRQPDEKbYm6GutuzTEB7qh/Cs h8YhW5SbTquN1xvE+2/yyISzSZkw99JCmjDoo+67XzTD7VTX27sHpSGuYELUPdAciG gOMjjkFfs1BvcuzaVUiQ5rd9XULgmIOdoN/qw2IsdahhbzbA8eVKMYy6/4JaeWCbo0 8KjVw+3BtEyD4PLNH3/GrSFq4wYhqp9Ip4LNEy3a2Xuau8sb7+L9nwKFdByQUr1nts YWDY89Vo+Bfnw== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux@armlinux.org.uk, Ard Biesheuvel , Jon Hunter Subject: [PATCH] ARM: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle Date: Wed, 25 May 2022 16:14:43 +0200 Message-Id: <20220525141443.1581977-1-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1695; h=from:subject; bh=S1Gj/2OcFLv/NRlqB1KX2nPJuAHizF+qPlTsXdSwkmg=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBijjnSAkPfvR0aORUndd8TvOe83i5SX8iq6Xfa59fg 1vUAiFqJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYo450gAKCRDDTyI5ktmPJNx6DA C7X8PSo1pNLl1CkLIZp/sGOx58V1tkXm/HItZr5J1YOm9piMD145eN17vwJykMY6N7uBFwIhs2qYLW Z9KB8MgiiKUVws8FCSLSDPp+3lY+IMyY0FDpDq1VzQGU9kURh2o4WR/xg3ePkXDHUYfZmAcsI72N0i j/UVErhOmnfhFITxaekuAMx1sSyuoTihN030jenQzPTsX+Y4xSfhMmAIlmgOJ5hoIsQMU11fQLY6Of 0JGJ+76WSpdmFrFWLEHvoQ/K23o7tXhfq+A6cgXE1w0msiq+2yUXnr33Q2a6e9Pjyga1gzBUGTUWul LbM//SRs3siSp8pH4EQdglMEToFnyj+yJQkwY5+0yGN8HcvzrC6LCS+n7tL+WJbu8E2cmnccNuRB88 Ym5mvHNrsjg8x3xeu7dcJX84j0gGo+DotdhH+mEwFyT5Nyxg6f/3rm/DYQIBUQtlcUAOomREcPcKv4 3e3lhgTOoGhA8FHetxXRayI0wfT2sBFvig05ue87gf4GI= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220525_071524_841331_6CBC2156 X-CRM114-Status: GOOD ( 15.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Tested-by: Jon Hunter Signed-off-by: Ard Biesheuvel --- 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 fb9f3eb6bf48..9edb0c5eb369 100644 --- a/arch/arm/mm/proc-v7-bugs.c +++ b/arch/arm/mm/proc-v7-bugs.c @@ -209,10 +209,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; }