From patchwork Tue Jan 16 11:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 13520706 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 7C177C47077 for ; Tue, 16 Jan 2024 11:03:15 +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=TQuxpkWncZjKSO7nunjlzydAuKrdxiyBO+6Ek1qXzaQ=; b=Z1lZ1BOxG0DwtQ 3DVGYHepExARATxbzRITyiZK/ri5GouMrIESpKqA4TZyeMdN4SqX1BnCGiY2R1J6X1BcvKe2P5E6z xtFHefGWMLJ+sPp5dSNmb3TdBUOHIKHrX4udlyyJPuo6MJcdJekc6g0GfKNPANDk4pJ3DBBxDTIMz xRq7X6OaVDC78FrBJE58dp7ETVfEIDHl4R7dwR0O7zK4Oyi0TqBwDFp7329X1yqnZapP4lc5jkek4 skTeCW+ocS7t2SB2s0ojIyxpiQCi99pURFpGinje4Od7CpimTxvoApeQXrODiy5FRaez0V8z3lV7M xzUZ1ZJVxpDlzYnTPn2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPhDO-00BjrM-2L; Tue, 16 Jan 2024 11:02:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPhDK-00BjqN-2z for linux-arm-kernel@lists.infradead.org; Tue, 16 Jan 2024 11:02:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DCC8FEC; Tue, 16 Jan 2024 03:03:20 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 251723F6C4; Tue, 16 Jan 2024 03:02:26 -0800 (PST) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, james.morse@arm.com, mark.rutland@arm.com, robh@kernel.org, stable@vger.kernel.org, will@kernel.org Subject: [PATCH 0/2] arm64: fix+cleanup for ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD Date: Tue, 16 Jan 2024 11:02:19 +0000 Message-Id: <20240116110221.420467-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240116_030239_107172_2B3E3206 X-CRM114-Status: UNSURE ( 9.93 ) 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 Hi, While testing an unrelated patch on the arm64 for-next/core branch, I spotted an issue in the ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD workaround. The first patch fixes that issue, and the second patch cleans up the remaining logic. The issue has existed since the workaround was introduced in commit: 471470bc7052d28c ("arm64: errata: Add Cortex-A520 speculative unprivileged load workaround") As that logic has recently been reworked in the arm64 for-next/core branch, these patches are based atop that rework, specifically atop commit: 546b7cde9b1dd360 ("arm64: Rename ARM64_WORKAROUND_2966298") As the patches alter the KPTI exception return logic, I've given this testing with KPTI forced on, forced off, and disabled at build time, which all appear to be fine. I don't have any hardware requiring the ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD workaround, but as the resulting logic for this is very simple I do not expect any issues with that part of the logic. Mark. Mark Rutland (2): arm64: entry: fix ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD arm64: entry: simplify kernel_exit logic arch/arm64/kernel/entry.S | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)