Skip to content

Commit

Permalink
arm64: kernel: remove SHF_WRITE|SHF_EXECINSTR from .idmap.text
Browse files Browse the repository at this point in the history
commit d541708 ("arm64: fix .idmap.text assertion for large kernels")
modified some of the section assembler directives that declare
.idmap.text to be SHF_ALLOC instead of
SHF_ALLOC|SHF_WRITE|SHF_EXECINSTR.

This patch fixes up the remaining stragglers that were left behind.  Add
Fixes tag so that this doesn't precede related change in stable.

Fixes: d541708 ("arm64: fix .idmap.text assertion for large kernels")
Reported-by: Greg Thelen <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
nickdesaulniers authored and willdeacon committed May 2, 2023
1 parent eda081d commit 4df69e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arch/arm64/kernel/cpu-reset.S
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <asm/virt.h>

.text
.pushsection .idmap.text, "awx"
.pushsection .idmap.text, "a"

/*
* cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/kernel/sleep.S
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ SYM_FUNC_START(__cpu_suspend_enter)
ret
SYM_FUNC_END(__cpu_suspend_enter)

.pushsection ".idmap.text", "awx"
.pushsection ".idmap.text", "a"
SYM_CODE_START(cpu_resume)
mov x0, xzr
bl init_kernel_el
Expand Down
6 changes: 3 additions & 3 deletions arch/arm64/mm/proc.S
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ alternative_else_nop_endif
SYM_FUNC_END(cpu_do_resume)
#endif

.pushsection ".idmap.text", "awx"
.pushsection ".idmap.text", "a"

.macro __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2
adrp \tmp1, reserved_pg_dir
Expand Down Expand Up @@ -201,7 +201,7 @@ SYM_FUNC_END(idmap_cpu_replace_ttbr1)

#define KPTI_NG_PTE_FLAGS (PTE_ATTRINDX(MT_NORMAL) | SWAPPER_PTE_FLAGS)

.pushsection ".idmap.text", "awx"
.pushsection ".idmap.text", "a"

.macro kpti_mk_tbl_ng, type, num_entries
add end_\type\()p, cur_\type\()p, #\num_entries * 8
Expand Down Expand Up @@ -400,7 +400,7 @@ SYM_FUNC_END(idmap_kpti_install_ng_mappings)
* Output:
* Return in x0 the value of the SCTLR_EL1 register.
*/
.pushsection ".idmap.text", "awx"
.pushsection ".idmap.text", "a"
SYM_FUNC_START(__cpu_setup)
tlbi vmalle1 // Invalidate local TLB
dsb nsh
Expand Down

0 comments on commit 4df69e0

Please sign in to comment.