Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+31 -9
+4 -4
arch/arm64/Kconfig
··· 168 168 select HAVE_ARCH_JUMP_LABEL 169 169 select HAVE_ARCH_JUMP_LABEL_RELATIVE 170 170 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 174 174 # Some instrumentation may be unsound, hence EXPERT 175 175 select HAVE_ARCH_KCSAN if EXPERT 176 176 select HAVE_ARCH_KFENCE ··· 211 211 select HAVE_FTRACE_MCOUNT_RECORD 212 212 select HAVE_FUNCTION_TRACER 213 213 select HAVE_FUNCTION_ERROR_INJECTION 214 - select HAVE_FUNCTION_GRAPH_RETVAL if HAVE_FUNCTION_GRAPH_TRACER 215 214 select HAVE_FUNCTION_GRAPH_TRACER 215 + select HAVE_FUNCTION_GRAPH_RETVAL 216 216 select HAVE_GCC_PLUGINS 217 217 select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \ 218 218 HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI
+22
arch/arm64/include/asm/pgtable.h
··· 1065 1065 1066 1066 #define p4d_offset_kimg(dir,addr) ((p4d_t *)dir) 1067 1067 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 + 1068 1090 #endif /* CONFIG_PGTABLE_LEVELS > 4 */ 1069 1091 1070 1092 #define pgd_ERROR(e) \
+1 -1
arch/arm64/kernel/vdso/Makefile
··· 21 21 # potential future proofing if we end up with internal calls to the exported 22 22 # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so 23 23 # 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 \ 25 25 -Bsymbolic --build-id=sha1 -n $(btildflags-y) 26 26 27 27 ifdef CONFIG_LD_ORPHAN_WARN
+1 -1
arch/arm64/kernel/vdso32/Makefile
··· 98 98 # From arm vDSO Makefile 99 99 VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1 100 100 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 102 102 VDSO_LDFLAGS += --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL) 103 103 104 104
+2 -2
arch/arm64/tools/sysreg
··· 149 149 UnsignedEnum 31:28 GIC 150 150 0b0000 NI 151 151 0b0001 GICv3 152 - 0b0010 GICv4p1 152 + 0b0011 GICv4p1 153 153 EndEnum 154 154 UnsignedEnum 27:24 Virt_frac 155 155 0b0000 NI ··· 903 903 UnsignedEnum 27:24 GIC 904 904 0b0000 NI 905 905 0b0001 IMP 906 - 0b0010 V4P1 906 + 0b0011 V4P1 907 907 EndEnum 908 908 SignedEnum 23:20 AdvSIMD 909 909 0b0000 IMP
+1 -1
tools/testing/selftests/arm64/abi/ptrace.c
··· 156 156 /* Zero is not currently architecturally valid */ 157 157 ksft_test_result(arch, "%s_arch_set\n", type_name); 158 158 } else { 159 - ksft_test_result_skip("%s_arch_set\n"); 159 + ksft_test_result_skip("%s_arch_set\n", type_name); 160 160 } 161 161 } 162 162