From patchwork Thu Dec 15 09:48:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 33565 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp252401wrn; Thu, 15 Dec 2022 01:53:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7TWRSWHT1UQDM1UJXAF2pE//XYDdzQaMhLUZ5PJY+wI0uMiPde8SKPvKlFlgoDB3bavka/ X-Received: by 2002:a17:90a:d515:b0:219:c1e8:114d with SMTP id t21-20020a17090ad51500b00219c1e8114dmr28320176pju.26.1671098011575; Thu, 15 Dec 2022 01:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671098011; cv=none; d=google.com; s=arc-20160816; b=kGmquXUTBeYN5m4QehgBWlvB9K1gtev9qbp52+Utspix5Xir/cqb/HpNdnwWOpiNjw bPVNNKIkQKDB5B6fM1as3fTJGc1iMb0ZePRBKLAZWvL/qhx1OH5vwnbViOEZPnMKkw8f aWJrW56RPPhG6h4xpjHOliigwm6FD3UEzsGHgIDQEz/Rr2lknjIGM80EybYK6mr4BzmE l8+hlGfsB3AS7G7KYvMjaX0Gfb6+lmqfx6+H7O1qRfQstvDJYP19CGZizAe3Z70iyjEn cJXu5qImUKhbYPqWb5ppWBCG4oFmy0mzL7yPCbylq82laLZB6S1E6PdV9BTmX/hp7crH zPzw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 93-20020a17090a09e600b00218cbdb0de5si4366269pjo.72.2022.12.15.01.53.18; Thu, 15 Dec 2022 01:53:31 -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 + 99 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752273268154768125?= X-GMAIL-MSGID: =?utf-8?q?1752273268154768125?= 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