Skip to content

Commit 671e148

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "A few arm64 fixes that came in during the merge window for -rc1. The main thing is restoring the pointer authentication hwcaps, which disappeared during some recent refactoring - Fix regression in CPU erratum workaround when disabling the MMU - Fix detection of pointer authentication hwcaps - Avoid writeable, executable ELF sections in vmlinux" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: lds: move .got section out of .text arm64: kernel: remove SHF_WRITE|SHF_EXECINSTR from .idmap.text arm64: cpufeature: Fix pointer auth hwcaps arm64: Fix label placement in record_mmu_state()
2 parents 611c9d8 + 0fddb79 commit 671e148

6 files changed

Lines changed: 22 additions & 23 deletions

File tree

arch/arm64/kernel/cpu-reset.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <asm/virt.h>
1515

1616
.text
17-
.pushsection .idmap.text, "awx"
17+
.pushsection .idmap.text, "a"
1818

1919
/*
2020
* cpu_soft_restart(el2_switch, entry, arg0, arg1, arg2)

arch/arm64/kernel/cpufeature.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,26 +2676,26 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
26762676
#ifdef CONFIG_ARM64_PTR_AUTH
26772677
static const struct arm64_cpu_capabilities ptr_auth_hwcap_addr_matches[] = {
26782678
{
2679-
ARM64_CPUID_FIELDS(ID_AA64ISAR1_EL1, APA, PAuth)
2679+
HWCAP_CPUID_MATCH(ID_AA64ISAR1_EL1, APA, PAuth)
26802680
},
26812681
{
2682-
ARM64_CPUID_FIELDS(ID_AA64ISAR2_EL1, APA3, PAuth)
2682+
HWCAP_CPUID_MATCH(ID_AA64ISAR2_EL1, APA3, PAuth)
26832683
},
26842684
{
2685-
ARM64_CPUID_FIELDS(ID_AA64ISAR1_EL1, API, PAuth)
2685+
HWCAP_CPUID_MATCH(ID_AA64ISAR1_EL1, API, PAuth)
26862686
},
26872687
{},
26882688
};
26892689

26902690
static const struct arm64_cpu_capabilities ptr_auth_hwcap_gen_matches[] = {
26912691
{
2692-
ARM64_CPUID_FIELDS(ID_AA64ISAR1_EL1, GPA, IMP)
2692+
HWCAP_CPUID_MATCH(ID_AA64ISAR1_EL1, GPA, IMP)
26932693
},
26942694
{
2695-
ARM64_CPUID_FIELDS(ID_AA64ISAR2_EL1, GPA3, IMP)
2695+
HWCAP_CPUID_MATCH(ID_AA64ISAR2_EL1, GPA3, IMP)
26962696
},
26972697
{
2698-
ARM64_CPUID_FIELDS(ID_AA64ISAR1_EL1, GPI, IMP)
2698+
HWCAP_CPUID_MATCH(ID_AA64ISAR1_EL1, GPI, IMP)
26992699
},
27002700
{},
27012701
};

arch/arm64/kernel/head.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ CPU_BE( tbz x19, #SCTLR_ELx_EE_SHIFT, 1f )
150150
pre_disable_mmu_workaround
151151
msr sctlr_el2, x19
152152
b 3f
153-
pre_disable_mmu_workaround
154-
2: msr sctlr_el1, x19
153+
2: pre_disable_mmu_workaround
154+
msr sctlr_el1, x19
155155
3: isb
156156
mov x19, xzr
157157
ret

arch/arm64/kernel/sleep.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ SYM_FUNC_START(__cpu_suspend_enter)
9797
ret
9898
SYM_FUNC_END(__cpu_suspend_enter)
9999

100-
.pushsection ".idmap.text", "awx"
100+
.pushsection ".idmap.text", "a"
101101
SYM_CODE_START(cpu_resume)
102102
mov x0, xzr
103103
bl init_kernel_el

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,8 @@ SECTIONS
181181
KPROBES_TEXT
182182
HYPERVISOR_TEXT
183183
*(.gnu.warning)
184-
. = ALIGN(16);
185-
*(.got) /* Global offset table */
186184
}
187185

188-
/*
189-
* Make sure that the .got.plt is either completely empty or it
190-
* contains only the lazy dispatch entries.
191-
*/
192-
.got.plt : { *(.got.plt) }
193-
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18,
194-
"Unexpected GOT/PLT entries detected!")
195-
196186
. = ALIGN(SEGMENT_ALIGN);
197187
_etext = .; /* End of text section */
198188

@@ -201,6 +191,15 @@ SECTIONS
201191

202192
HYPERVISOR_DATA_SECTIONS
203193

194+
.got : { *(.got) }
195+
/*
196+
* Make sure that the .got.plt is either completely empty or it
197+
* contains only the lazy dispatch entries.
198+
*/
199+
.got.plt : { *(.got.plt) }
200+
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18,
201+
"Unexpected GOT/PLT entries detected!")
202+
204203
/* code sections that are never executed via the kernel mapping */
205204
.rodata.text : {
206205
TRAMP_TEXT

arch/arm64/mm/proc.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ alternative_else_nop_endif
167167
SYM_FUNC_END(cpu_do_resume)
168168
#endif
169169

170-
.pushsection ".idmap.text", "awx"
170+
.pushsection ".idmap.text", "a"
171171

172172
.macro __idmap_cpu_set_reserved_ttbr1, tmp1, tmp2
173173
adrp \tmp1, reserved_pg_dir
@@ -201,7 +201,7 @@ SYM_FUNC_END(idmap_cpu_replace_ttbr1)
201201

202202
#define KPTI_NG_PTE_FLAGS (PTE_ATTRINDX(MT_NORMAL) | SWAPPER_PTE_FLAGS)
203203

204-
.pushsection ".idmap.text", "awx"
204+
.pushsection ".idmap.text", "a"
205205

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

0 commit comments

Comments
 (0)