arm64: errata: refer to config ARM64_ERRATUM_2645198 to make workaround work
Subsystems (2)
PATCH 1/1 arm64: errata: refer to config ARM64_ERRATUM_2645198 to make workaround work
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.
--- arch/arm64/mm/hugetlbpage.c | 2 +- arch/arm64/mm/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/mm/hugetlbpage.c +1 -1
@@ -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
arch/arm64/mm/mmu.c +1 -1
@@ -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
Signature · 1 line
2.17.1
Will Deacon
maintainerQuoted 15 lines · Lukas Bulwahn
Commit
44ecda71fd8a("arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption") implements a workaround for arm64 erratum 2645198. The arm64 cpucaps is calledWORKAROUND_2645198; the kernel build configuration is calledARM64_ERRATUM_2645198.In the functions
huge_ptep_modify_prot_start()andptep_modify_prot_start(), the code accidently refers to the non-existing configCONFIG_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_2645198and make the intended workaround effectively work.
Quoted 6 lines
Fixes 44ecda71fd8a ("arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption")Signed-off-by Lukas Bulwahn <[email protected]>--- arch/arm64/mm/hugetlbpage.c | 2 +- arch/arm64/mm/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Thanks for the report!
Quoted 18 lines
arch/arm64/mm/hugetlbpage.c +1
-1@@ -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 arch/arm64/mm/mmu.c +0
-0
arch/arm64/mm/mmu.c early_initcall(prevent_bootmem_remove_init); · line 1639
Quoted 8 lines
arch/arm64/mm/mmu.c +1
-1@@ -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
Grr, this bug seems to exist in all three versions of the patch reviewed on the list, so I can only draw the conclusion that this code has never been tested. Consequently, I'm more inclined to _revert_ the change for now and we can bring it back as a fix once somebody has checked that it actually works properly.
Will
Quoted 44 lines · Will Deacon
Quoted 15 lines · Lukas Bulwahn
Commit
44ecda71fd8a("arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption") implements a workaround for arm64 erratum 2645198. The arm64 cpucaps is calledWORKAROUND_2645198; the kernel build configuration is calledARM64_ERRATUM_2645198.In the functions
huge_ptep_modify_prot_start()andptep_modify_prot_start(), the code accidently refers to the non-existing configCONFIG_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_2645198and make the intended workaround effectively work.Quoted 6 lines
Fixes 44ecda71fd8a ("arm64: errata: Workaround possible Cortex-A715 [ESR|FAR]_ELx corruption")Signed-off-by Lukas Bulwahn <[email protected]>--- arch/arm64/mm/hugetlbpage.c | 2 +- arch/arm64/mm/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Thanks for the report!
Quoted 19 lines
arch/arm64/mm/hugetlbpage.c +1
-1@@ -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 arch/arm64/mm/mmu.c +0
-0@@ -1633,7 +1633,7 @@ early_initcall(prevent_bootmem_remove_init);
Quoted 10 lines
arch/arm64/mm/mmu.c early_initcall(prevent_bootmem_remove_init); · line 1639
Quoted 7 lines
arch/arm64/mm/mmu.c +1
-1pte_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 Grr, this bug seems to exist in all three versions of the patch reviewed on the list, so I can only draw the conclusion that this code has never been
Ohh, my bad, apologies. I did not have a real system with this erratum, although had emulated and tested this workaround path via some other debug changes (which might have just forced the first condition to always evaluate true).
Quoted 3 lines
tested. Consequently, I'm more inclined to _revert_ the change for now and we can bring it back as a fix once somebody has checked that it actually works properly.
Please do not revert this change if possible.
Will Deacon
maintainerQuoted 32 lines · Anshuman Khandual
Quoted 20 lines · Will Deacon
Quoted 19 lines · Lukas Bulwahn
arch/arm64/mm/hugetlbpage.c +1
-1@@ -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 arch/arm64/mm/mmu.c +0
-0@@ -1633,7 +1633,7 @@ early_initcall(prevent_bootmem_remove_init);Quoted 10 lines
arch/arm64/mm/mmu.c early_initcall(prevent_bootmem_remove_init); · line 1639
Quoted 7 lines
arch/arm64/mm/mmu.c +1
-1pte_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 Grr, this bug seems to exist in all three versions of the patch reviewed on the list, so I can only draw the conclusion that this code has never been
Quoted 3 lines
Ohh, my bad, apologies. I did not have a real system with this erratum, although had emulated and tested this workaround path via some other debug changes (which might have just forced the first condition to always evaluate true).
"might have"?
Quoted 4 lines
Quoted 3 lines
tested. Consequently, I'm more inclined to _revert_ the change for now and we can bring it back as a fix once somebody has checked that it actually works properly.
Please do not revert this change if possible.
I've gone ahead with the revert anyway, just because it's the easy thing to do and we can bring back a fixed version of the patch as a fix in the new year. So please send a new version with this fix folded in after you've tested that it doesn't cause regressions for systems without the erratum.
Cheers,
Will
Quoted 42 lines · Will Deacon
Quoted 32 lines · Anshuman Khandual
Quoted 20 lines · Will Deacon
Quoted 19 lines · Lukas Bulwahn
arch/arm64/mm/hugetlbpage.c +1
-1@@ -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 arch/arm64/mm/mmu.c +0
-0@@ -1633,7 +1633,7 @@ early_initcall(prevent_bootmem_remove_init);Quoted 10 lines
arch/arm64/mm/mmu.c early_initcall(prevent_bootmem_remove_init); · line 1639
Quoted 7 lines
arch/arm64/mm/mmu.c +1
-1pte_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 Grr, this bug seems to exist in all three versions of the patch reviewed on the list, so I can only draw the conclusion that this code has never been
Quoted 3 lines
Ohh, my bad, apologies. I did not have a real system with this erratum, although had emulated and tested this workaround path via some other debug changes (which might have just forced the first condition to always evaluate true).
"might have"?
Quoted 3 lines
Quoted 3 lines
tested. Consequently, I'm more inclined to _revert_ the change for now and we can bring it back as a fix once somebody has checked that it actually works properly.
Quoted 6 lines
Quoted 1 line
Please do not revert this change if possible.
I've gone ahead with the revert anyway, just because it's the easy thing to do and we can bring back a fixed version of the patch as a fix in the new year. So please send a new version with this fix folded in after you've tested that it doesn't cause regressions for systems without the erratum.
Sure, will resend. Again, apologies for this last minute merge window trouble.