Skip to content

Commit a6294b5

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: "The usual summary below, but the main fix is for the fast GUP lockless page-table walk when we have a combination of compile-time and run-time folding of the p4d and the pud respectively. - Remove some redundant Kconfig conditionals - Fix string output in ptrace selftest - Fix fast GUP crashes in some page-table configurations - Remove obsolete linker option when building the vDSO - Fix some sysreg field definitions for the GIC" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: Fix lockless walks with static and dynamic page-table folding arm64/sysreg: Correct the values for GICv4.1 arm64/vdso: Remove --hash-style=sysv kselftest: missing arg in ptrace.c arm64/Kconfig: Remove redundant 'if HAVE_FUNCTION_GRAPH_TRACER' arm64: remove redundant 'if HAVE_ARCH_KASAN' in Kconfig
2 parents 6467dfd + 3663901 commit a6294b5

File tree

6 files changed

+31
-9
lines changed

6 files changed

+31
-9
lines changed

arch/arm64/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ config ARM64
168168
select HAVE_ARCH_JUMP_LABEL
169169
select HAVE_ARCH_JUMP_LABEL_RELATIVE
170170
select HAVE_ARCH_KASAN
171-
select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
172-
select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
173-
select HAVE_ARCH_KASAN_HW_TAGS if (HAVE_ARCH_KASAN && ARM64_MTE)
171+
select HAVE_ARCH_KASAN_VMALLOC
172+
select HAVE_ARCH_KASAN_SW_TAGS
173+
select HAVE_ARCH_KASAN_HW_TAGS if ARM64_MTE
174174
# Some instrumentation may be unsound, hence EXPERT
175175
select HAVE_ARCH_KCSAN if EXPERT
176176
select HAVE_ARCH_KFENCE
@@ -211,8 +211,8 @@ config ARM64
211211
select HAVE_FTRACE_MCOUNT_RECORD
212212
select HAVE_FUNCTION_TRACER
213213
select HAVE_FUNCTION_ERROR_INJECTION
214-
select HAVE_FUNCTION_GRAPH_RETVAL if HAVE_FUNCTION_GRAPH_TRACER
215214
select HAVE_FUNCTION_GRAPH_TRACER
215+
select HAVE_FUNCTION_GRAPH_RETVAL
216216
select HAVE_GCC_PLUGINS
217217
select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \
218218
HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI

arch/arm64/include/asm/pgtable.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,28 @@ static inline bool pgtable_l5_enabled(void) { return false; }
10651065

10661066
#define p4d_offset_kimg(dir,addr) ((p4d_t *)dir)
10671067

1068+
static inline
1069+
p4d_t *p4d_offset_lockless_folded(pgd_t *pgdp, pgd_t pgd, unsigned long addr)
1070+
{
1071+
/*
1072+
* With runtime folding of the pud, pud_offset_lockless() passes
1073+
* the 'pgd_t *' we return here to p4d_to_folded_pud(), which
1074+
* will offset the pointer assuming that it points into
1075+
* a page-table page. However, the fast GUP path passes us a
1076+
* pgd_t allocated on the stack and so we must use the original
1077+
* pointer in 'pgdp' to construct the p4d pointer instead of
1078+
* using the generic p4d_offset_lockless() implementation.
1079+
*
1080+
* Note: reusing the original pointer means that we may
1081+
* dereference the same (live) page-table entry multiple times.
1082+
* This is safe because it is still only loaded once in the
1083+
* context of each level and the CPU guarantees same-address
1084+
* read-after-read ordering.
1085+
*/
1086+
return p4d_offset(pgdp, addr);
1087+
}
1088+
#define p4d_offset_lockless p4d_offset_lockless_folded
1089+
10681090
#endif /* CONFIG_PGTABLE_LEVELS > 4 */
10691091

10701092
#define pgd_ERROR(e) \

arch/arm64/kernel/vdso/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
2121
# potential future proofing if we end up with internal calls to the exported
2222
# routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
2323
# preparation in build-time C")).
24-
ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv \
24+
ldflags-y := -shared -soname=linux-vdso.so.1 \
2525
-Bsymbolic --build-id=sha1 -n $(btildflags-y)
2626

2727
ifdef CONFIG_LD_ORPHAN_WARN

arch/arm64/kernel/vdso32/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ VDSO_AFLAGS += -D__ASSEMBLY__
9898
# From arm vDSO Makefile
9999
VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
100100
VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096
101-
VDSO_LDFLAGS += -shared --hash-style=sysv --build-id=sha1
101+
VDSO_LDFLAGS += -shared --build-id=sha1
102102
VDSO_LDFLAGS += --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
103103

104104

arch/arm64/tools/sysreg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Res0 63:32
149149
UnsignedEnum 31:28 GIC
150150
0b0000 NI
151151
0b0001 GICv3
152-
0b0010 GICv4p1
152+
0b0011 GICv4p1
153153
EndEnum
154154
UnsignedEnum 27:24 Virt_frac
155155
0b0000 NI
@@ -903,7 +903,7 @@ EndEnum
903903
UnsignedEnum 27:24 GIC
904904
0b0000 NI
905905
0b0001 IMP
906-
0b0010 V4P1
906+
0b0011 V4P1
907907
EndEnum
908908
SignedEnum 23:20 AdvSIMD
909909
0b0000 IMP

tools/testing/selftests/arm64/abi/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void test_hw_debug(pid_t child, int type, const char *type_name)
156156
/* Zero is not currently architecturally valid */
157157
ksft_test_result(arch, "%s_arch_set\n", type_name);
158158
} else {
159-
ksft_test_result_skip("%s_arch_set\n");
159+
ksft_test_result_skip("%s_arch_set\n", type_name);
160160
}
161161
}
162162

0 commit comments

Comments
 (0)