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 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 F3EB2C433EF for ; Wed, 13 Apr 2022 17:35:23 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v24AIoKYU793wBWkh80m8+p6Nwj4pxG1ZIUlSH1UkSs=; b=vIOex6hDUx8prl isaELI1DVmbIM410uKMeyCG9doHwoRmkzxa6tceNzGyjBidaZUQAFc+tiRF6/pktZwJkBtEyxwiX4 pIIE0ql/yG4eQcPjn3VxsVQvwwrhAusTENWAESiAJHh1GlIqV6ttLf6aHTkb9l+i9aQWBeqy2IPfI o0WXUImpE8H/YiJcvDyukAMAkFiiLYWQosQIJ73r2KDuGgVuPAzJ4tKZyaT51SVCuyKdHeaBs3Vjx tOnUoVpECmjQLBymVIkGSy/x1BE5mvxxrOtu61GImpWqnfLucT6GXvyaQUpEeIVU3e3j9lmFHIWWq D0YXyeyrwVAl1l+pCSnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1negsj-001wth-Or; Wed, 13 Apr 2022 17:34:18 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1negsg-001wsH-75 for linux-arm-kernel@lists.infradead.org; Wed, 13 Apr 2022 17:34:15 +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 9114C61E9C for ; Wed, 13 Apr 2022 17:34:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04FACC385A3 for ; Wed, 13 Apr 2022 17:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649871253; bh=AVocpNwjSkLGSzGlS2++FGduzyecnhv355Yt7+tEao8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IYCTiLyOf0k2EG6zr+S/ZIu0O7zY73DdGhPxNAHu82tk5/gnj9DuLpbpH4LnMdzPH tOT3oxXsvz5EHmBZeCgmB15qUpVRljSffD0uMTfRtGGJgf9edL+NC97NA5x79EzSjX oJgFxT29njR4bb2Pvj47dYMeGGu0PjR4iEGEIDx/ZbpZT0HU+7ocoXym2Fa+tFiopd 3Io3W5jrkI8kP1JFL/NPdaYsjooqTHhthCdnLJ4hIb8l3z2xIG/MZBzefCeFI7XyCV xqrHwoBfz8Xfz6Bky1mzA4HLjVUEJPJQ+ckcn42T96KgrRo16n0HPQGavymfEC1k94 E2Muh0P7yF62w== Received: by mail-oi1-f173.google.com with SMTP id q129so2813860oif.4 for ; Wed, 13 Apr 2022 10:34:12 -0700 (PDT) X-Gm-Message-State: AOAM5337MGcho/Xsdtq1K0yxpkEErAYxn7kTqcGvv2bd68rhyqgs8jEh doew5HcSo7fcPIRRoHNNqQTmVSQFCf7e0VA1Zrk= X-Google-Smtp-Source: ABdhPJwvuZ9QjRGO9JVhURFAeN52z9xkOWMZ2fWfTXdRr904a7/0Tngr4vYc3L1YWCVxeMbBM9ot6+1PyksRLMmje0E= X-Received: by 2002:a05:6808:1596:b0:2f7:5d89:eec7 with SMTP id t22-20020a056808159600b002f75d89eec7mr4842556oiw.228.1649871252179; Wed, 13 Apr 2022 10:34:12 -0700 (PDT) MIME-Version: 1.0 References: <20220413170545.3042558-1-james.morse@arm.com> <20220413170545.3042558-3-james.morse@arm.com> In-Reply-To: <20220413170545.3042558-3-james.morse@arm.com> From: Ard Biesheuvel Date: Wed, 13 Apr 2022 19:34:00 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] ARM: Remove AES hwcap for parts affected by errata To: James Morse Cc: Linux ARM , Russell King , Catalin Marinas , Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_103414_374463_C483CC3D X-CRM114-Status: GOOD ( 24.93 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 13 Apr 2022 at 19:06, James Morse wrote: > > Cortex-A57 and Cortex-A72 have an erratum where an interrupt that > occurs between a pair of AES instructions in aarch32 mode may corrupt > the ELR. The task will subsequently produce the wrong AES result. > > The AES instructions are part of the cryptographic extensions, which are > optional. User-space software will detect the support for these > instructions from the hwcaps. If the platform doesn't support these > instructions a software implementation should be used. > > Remove the hwcap bits on affected parts to indicate user-space should > not use the AES instructions. > > Signed-off-by: James Morse Acked-by: Ard Biesheuvel > --- > arch/arm/kernel/setup.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > index 1e8a50a97edf..8a409bfd33f2 100644 > --- a/arch/arm/kernel/setup.c > +++ b/arch/arm/kernel/setup.c > @@ -501,6 +501,15 @@ static void __init elf_hwcap_fixup(void) > return; > } > > + /* > + * HWCAP2_AES can get the wrong result due to A57's erratum #1742098 or > + * A72's #1655431. > + */ > + if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A57 || > + read_cpuid_part() == ARM_CPU_PART_CORTEX_A72) { > + elf_hwcap2 &= ~HWCAP2_AES; > + } > + > /* Verify if CPUID scheme is implemented */ > if ((id & 0x000f0000) != 0x000f0000) > return; > -- > 2.30.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel