All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: [PATCH] arm64: errata: refer to config ARM64_ERRATUM_2645198 to make workaround work
Date: Thu, 15 Dec 2022 10:48:11 +0100	[thread overview]
Message-ID: <20221215094811.23188-1-lukas.bulwahn@gmail.com> (raw)

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 <lukas.bulwahn@gmail.com>
---
 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


WARNING: multiple messages have this Message-ID (diff)
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: [PATCH] arm64: errata: refer to config ARM64_ERRATUM_2645198 to make workaround work
Date: Thu, 15 Dec 2022 10:48:11 +0100	[thread overview]
Message-ID: <20221215094811.23188-1-lukas.bulwahn@gmail.com> (raw)

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 <lukas.bulwahn@gmail.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2022-12-15  9:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  9:48 Lukas Bulwahn [this message]
2022-12-15  9:48 ` [PATCH] arm64: errata: refer to config ARM64_ERRATUM_2645198 to make workaround work Lukas Bulwahn
2022-12-15 10:57 ` Will Deacon
2022-12-15 10:57   ` Will Deacon
2022-12-15 11:29   ` Anshuman Khandual
2022-12-15 11:29     ` Anshuman Khandual
2022-12-15 19:44     ` Will Deacon
2022-12-15 19:44       ` Will Deacon
2022-12-15 23:31       ` Anshuman Khandual
2022-12-15 23:31         ` Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221215094811.23188-1-lukas.bulwahn@gmail.com \
    --to=lukas.bulwahn@gmail.com \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.