Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp818665rwb; Thu, 15 Dec 2022 02:55:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf7z42CVb9b8GL12YGlxGLYbtaaZWytf3eW0mKVftcjVr0lbYJ0lka8RTkjwzNyompW2GVde X-Received: by 2002:a62:524c:0:b0:576:b277:2cd with SMTP id g73-20020a62524c000000b00576b27702cdmr27004359pfb.34.1671101744120; Thu, 15 Dec 2022 02:55:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671101744; cv=none; d=google.com; s=arc-20160816; b=Kvg0mXXfo7ZR9ZhJEyIeeAt34dDSaUaJcra9frC63lGILWJS19HutPvPpl7OTR9Njs iS+1WbWe3+/Sby3tbXDRV1H/bewaicWXucMXG9fhSug8GKrKfrTzxEAMZfSmgSr9rybZ GXMjUIpVmdao0Q9XLNHLnjrn59WWrt7/1G0ezlzd9whE0VGdKtHcPoNEuDwafhB1zwPf COvaTND0pQmKiETCdfkTZT+8P9qmv9j7BPvUyB//e9qxTTFyB/Qy4G+lgTLJRCOoSh1C q6QlzLxzFIElHu64joBaaUeV4dLPDN9gstNyU5pMj55hQLXFYzDBU5CLpaGHmUfdSMuN WacQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=j84zMuJuK3HAp9zOgMIVL+Uq6tjz2z4EhGNGd4W418M=; b=iNueho3HHsvzXw3BFaUCR02z0Yotaf+adwUlEeOOQyPvqLeaqq51+ak8tN0frSjxB8 8BE3sAYqXCsNQ8Hwo4rRc3Zw3OgBwp1DAL37XnU098nQa/vOrWkIZrbg8zr/F+7qg4Dr bdOzapV4GqD7kzucPMNqrz1XCQxkw7Gj9gjNVoW2FBjyiBKV5faNUFh3MW7CTyqYJLWU HoPI9GI5cBgp0LqJwDzNHp2th2GJrAeTW71ulhhOV4WdIoKSju8ELse9PcQTMpo3nbxm nPNIXxzStoze7BjDkLcb//OB+kuLk4b1/IdUsnVm5xM+10dUsLGz3wX2vlBqPTy5Fsiz iWrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PKjKRu6q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020aa78c59000000b0056be594a8b2si2303898pfd.202.2022.12.15.02.55.34; Thu, 15 Dec 2022 02:55:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PKjKRu6q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbiLOJwM (ORCPT + 68 others); Thu, 15 Dec 2022 04:52:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbiLOJv3 (ORCPT ); Thu, 15 Dec 2022 04:51:29 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04905E03B; Thu, 15 Dec 2022 01:51:28 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id b2so50951387eja.7; Thu, 15 Dec 2022 01:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j84zMuJuK3HAp9zOgMIVL+Uq6tjz2z4EhGNGd4W418M=; b=PKjKRu6qWEO5muTqlD2CVwbLvq2hdoDup0XgCi6Fncx3S9fWoO5WwlCMwVNLyTBEZL M7EqDOFqiVKbf4vNolZfe2mBrpG6PPBvHkBcxmYCv3ePLgBjrkZZ9h308B1znZY/VGSo q6bf/E1PCcJEzeSOf3kbfW/Gxj+7pY0JfjydStRpX7KeMMRayi0sAwLaN4XbcUpGdMel +BISnAzi1N7MeHRPR7GwN3ccBy6CkcCNAPw7ydbAfa0jeQcCOdVizdKS4sBra4KymZRI LPKVx8X7pcaNiS9z/s+yWA8RohNOL014IAMGVsEAF5EB5feqYiJHuFGj7cuAFwyfT9bW FLag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j84zMuJuK3HAp9zOgMIVL+Uq6tjz2z4EhGNGd4W418M=; b=mlZeZlp44Rf70NQm0Oit5C2wk+fndI9g1agu0Rf/YzKYwTmeCgDO2ezNG4f3mvf77/ 4KKM3Bt8jJ3E2IbNpOPhc11oVz2OyshJaw4CFm/UVj4TSRRY0o1TWIk1vovr6maaxRRq D1ZUwGID3DDm/jh5hoZ+BnnLlmkufREShC8MKE5PmGg3cG4iwwhdXsALaUfWWWNqwhu7 m7PeIHv0Okrfd0/PE3X6Afk4QVhsIj/KM+QhKkdEtlnnRXv1X5hP7j1DNtsbdez6dcxx EDHiN0y85Q/9loYo72MgVbQHuLZgeLvr2VjYp4oJHZhH+G+8wuw+tI3Dv2Y2wvm2e2aX qVHQ== X-Gm-Message-State: ANoB5pkuRS+uV1zCY/iAIvuAUpl8G+mgujFIq4IOKzSKjt4Hujik/pek 0sGNcVwmWYLO2t0/WZArWIc= X-Received: by 2002:a17:906:168a:b0:7c1:10b4:4742 with SMTP id s10-20020a170906168a00b007c110b44742mr21853116ejd.55.1671097886550; Thu, 15 Dec 2022 01:51:26 -0800 (PST) Received: from felia.fritz.box (ipbcc1d920.dynamic.kabel-deutschland.de. [188.193.217.32]) by smtp.gmail.com with ESMTPSA id e9-20020a170906080900b007bfacaea851sm6787739ejd.88.2022.12.15.01.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 01:51:25 -0800 (PST) From: Lukas Bulwahn To: Catalin Marinas , Will Deacon , Anshuman Khandual , linux-arm-kernel@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH] arm64: errata: refer to config ARM64_ERRATUM_2645198 to make workaround work Date: Thu, 15 Dec 2022 10:48:11 +0100 Message-Id: <20221215094811.23188-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 44ecda71fd8a ("arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption") implements a workaround for arm64 erratum 2645198. The arm64 cpucaps is called WORKAROUND_2645198; the kernel build configuration is called ARM64_ERRATUM_2645198. In the functions huge_ptep_modify_prot_start() and ptep_modify_prot_start(), the code accidently refers to the non-existing config CONFIG_ARM64_WORKAROUND_2645198. Note that the config name uses ERRATUM, not WORKAROUND. By this accidental misreference, this condition is always false, the branch of the workaround is not reachable and the workaround is effectively not implemented at all. Refer to the intended config ARM64_ERRATUM_2645198 and make the intended workaround effectively work. Fixes: 44ecda71fd8a ("arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption") Signed-off-by: Lukas Bulwahn --- arch/arm64/mm/hugetlbpage.c | 2 +- arch/arm64/mm/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index cd8d96e1fa1a..95364e8bdc19 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -562,7 +562,7 @@ bool __init arch_hugetlb_valid_size(unsigned long size) pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { - if (IS_ENABLED(CONFIG_ARM64_WORKAROUND_2645198) && + if (IS_ENABLED(CONFIG_ARM64_ERRATUM_2645198) && cpus_have_const_cap(ARM64_WORKAROUND_2645198)) { /* * Break-before-make (BBM) is required for all user space mappings diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 12915f379c22..d77c9f56b7b4 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1633,7 +1633,7 @@ early_initcall(prevent_bootmem_remove_init); pte_t ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { - if (IS_ENABLED(CONFIG_ARM64_WORKAROUND_2645198) && + if (IS_ENABLED(CONFIG_ARM64_ERRATUM_2645198) && cpus_have_const_cap(ARM64_WORKAROUND_2645198)) { /* * Break-before-make (BBM) is required for all user space mappings -- 2.17.1