From patchwork Thu Jul 14 16:15:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 12918177 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 A00A0CCA47C for ; Thu, 14 Jul 2022 16:16:49 +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=3g3gP3MvoacNBYcTvbz1PQMk4C4lS2zNruKK8NzwCKk=; b=HWQjzNqUWd2uzW EEy/uqpgijAw2OwO7jsh7yM+LRpnU3zNZ5F6N+uZJc5ftmL5Ctmkxb0w4WGAIlahA2sbL+JKInviK RJv/JKR8LcGIZ5eTQ6K0rL8jpmJftkIWM+piO0wQEfksM5tPoqfwEzwaF6e2DRhRCvjcB6A/ShUiq DweWFgWzwYayYqaZw2XgVW4Z5Q5tFGFji42M6ogkrvk2S7UA0N5rNAlr84rAJvS+xEgZOsHWEM0P/ RWAsuq9YGd/o/tQGC/9wkOOVJU9pjxq00LbyA/jY68jMx7XaAeuEREBS0CB2xJWXpAovACl33QPi4 InfQVL7JvO3/o6GodSyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC1VH-00G9ZR-PL; Thu, 14 Jul 2022 16:15:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC1Uz-00G9P6-PG for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2022 16:15:37 +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 68B641D13; Thu, 14 Jul 2022 09:15:31 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.174]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 17AAC3F70D; Thu, 14 Jul 2022 09:15:29 -0700 (PDT) From: James Morse To: linux-arm-kernel@lists.infradead.org Cc: Russell King , Catalin Marinas , Will Deacon , Ard Biesheuvel , James Morse Subject: [PATCH v3 0/2] arm64: errata: Remove AES hwcap for COMPAT tasks Date: Thu, 14 Jul 2022 17:15:21 +0100 Message-Id: <20220714161523.279570-1-james.morse@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-20220714_091533_903623_87A435EA X-CRM114-Status: GOOD ( 13.14 ) 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 Hello! The change since v2 is the affected range for A57. It turns out A57's r0p0 is not affected by this erratum, the document on developer.arm.com is now the latest version. These patches remove the AES HWCAP on A57 and A72 for aarch32 user-space processes due to erratum #1742098 and #1655431. An interrupt between two instructions will cause these parts to get the wrong result. These extensions are optional, so software should have a fallback implementation. Operating on the HWCAP bitmap directly avoids affecting KVM, which was the problem with v1. But it does mean HWCAP_PMULL is still visible to aarch32 processes. This isn't affected by the erratum, but is detected from the same field in the ID register. PMULL is value '2', AES is value '1'. User-space would be crazy to let PMULL imply AES, right ... There is no dependency between the two patches. [v2] https://lore.kernel.org/linux-arm-kernel/20220413170545.3042558-1-james.morse@arm.com/ [v1] https://lore.kernel.org/linux-arm-kernel/20220127122914.1585008-1-james.morse@arm.com/ [A57] https://developer.arm.com/documentation/epm049219/2300 #1742098 [A72 https://developer.arm.com/documentation/epm012079/11 #1655431 James Morse (2): ARM: Remove AES hwcap for parts affected by errata arm64: errata: Remove AES hwcap for COMPAT tasks Documentation/arm64/silicon-errata.rst | 4 ++++ arch/arm/include/asm/cputype.h | 5 +++++ arch/arm/kernel/setup.c | 10 ++++++++++ arch/arm64/Kconfig | 16 ++++++++++++++++ arch/arm64/kernel/cpu_errata.c | 16 ++++++++++++++++ arch/arm64/kernel/cpufeature.c | 14 +++++++++++++- arch/arm64/tools/cpucaps | 1 + 7 files changed, 65 insertions(+), 1 deletion(-)