From patchwork Tue Jul 16 08:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Min X-Patchwork-Id: 13734184 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 78F8FC3DA59 for ; Tue, 16 Jul 2024 08:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc: To:From:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=pH9JvJFDu3Qe6gePTQl0luiqyOMv/fa1Ps+pUJWRaEg=; b=lbJkuJxhI1PzG2r0x5Mgf7aZY2 73VoJaKSdV7wgnQA2hTbxYk9JjmapZxv7EoGLgsBaze270MlYzuNB1xzWhls23pFNK1iIShThupY5 wX3Y6pu+HGwtbBU08xTHQDiA0m98mBl9NufH6D9/cQLzGLZcWjGasTGDNNJmL5i24xjSbY4rUeELs BaG5dxNxdGrsn+XL2Av9rDkb90xEQCDJjAwiEaDBcJ24mGkC3zfDsGNHcOopmU7qrvB3+8oEpfVAc arNQshGrl+btj3ivPJpRCDewQHmWK5MwEmlf223g0PozKDJDiu5xbd1kDC5MD8HnIcLG5mTAD8peG IGS9ijQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTdvJ-00000009n7g-0AbN; Tue, 16 Jul 2024 08:52:37 +0000 Received: from lgeamrelo11.lge.com ([156.147.23.51]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTduj-00000009mxJ-1MGS for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2024 08:52:03 +0000 Received: from unknown (HELO lgemrelse7q.lge.com) (156.147.1.151) by 156.147.23.51 with ESMTP; 16 Jul 2024 17:51:54 +0900 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: chanho.min@lge.com Received: from unknown (HELO localhost.localdomain) (10.178.31.96) by 156.147.1.151 with ESMTP; 16 Jul 2024 17:51:54 +0900 X-Original-SENDERIP: 10.178.31.96 X-Original-MAILFROM: chanho.min@lge.com From: Chanho Min To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Gunho Lee , Chanho Min Subject: [PATCH] arm64: set MITIGATE_SPECTRE_BRANCH_HISTORY to n by default Date: Tue, 16 Jul 2024 17:51:36 +0900 Message-Id: <20240716085136.4160-1-chanho.min@lge.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240716_015201_716368_E929FB1E X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. 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 lmbench shows 25% performance regression after MITIGATE_SPECTRE_BRANCH_HISTORY is enabled. This performance drop may be more significant than mitigating the spectre-BHB. This patch changes this security option to disable by default and makes it selectable. - lat_syscall result with MITIGATE_SPECTRE_BRANCH_HISTORY enabled (cortex-a78) write call 0.2777 0.2810 0.2824 0.280367 read call 0.3435 0.3452 0.3443 0.344333 - lat_syscall result with MITIGATE_SPECTRE_BRANCH_HISTORY disabled (cortex-a78) write call 0.2101 0.2117 0.2116 0.2111 read call 0.2732 0.2744 0.2763 0.274633 Signed-off-by: Chanho Min --- arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5d91259ee7b5..be76f425c060 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1626,7 +1626,7 @@ config UNMAP_KERNEL_AT_EL0 config MITIGATE_SPECTRE_BRANCH_HISTORY bool "Mitigate Spectre style attacks against branch history" if EXPERT - default y + default n help Speculation attacks against some high-performance processors can make use of branch history to influence future speculation.