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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
"Catalin's out enjoying the sunshine, so I'm sending the fixes for a
couple of weeks (although there hopefully won't be any more!).

We've got a revert of a previous fix because it broke the build with
some distro toolchains and a preemption fix when detemining whether or
not the SIMD unit is in use.

Summary:

- Revert back to the 'linux' target for LD, as 'elf' breaks some
distributions

- Fix preemption race when testing whether the vector unit is in use
or not"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: neon: Fix function may_use_simd() return error status
Revert "arm64: Use aarch64elf and aarch64elfb emulation mode variants"

+11 -14
+4 -2
arch/arm64/Makefile
··· 60 60 KBUILD_CPPFLAGS += -mbig-endian 61 61 CHECKFLAGS += -D__AARCH64EB__ 62 62 AS += -EB 63 - LDFLAGS += -EB -maarch64elfb 63 + # We must use the linux target here, since distributions don't tend to package 64 + # the ELF linker scripts with binutils, and this results in a build failure. 65 + LDFLAGS += -EB -maarch64linuxb 64 66 UTS_MACHINE := aarch64_be 65 67 else 66 68 KBUILD_CPPFLAGS += -mlittle-endian 67 69 CHECKFLAGS += -D__AARCH64EL__ 68 70 AS += -EL 69 - LDFLAGS += -EL -maarch64elf 71 + LDFLAGS += -EL -maarch64linux # See comment above 70 72 UTS_MACHINE := aarch64 71 73 endif 72 74
+7 -12
arch/arm64/include/asm/simd.h
··· 29 29 static __must_check inline bool may_use_simd(void) 30 30 { 31 31 /* 32 - * The raw_cpu_read() is racy if called with preemption enabled. 33 - * This is not a bug: kernel_neon_busy is only set when 34 - * preemption is disabled, so we cannot migrate to another CPU 35 - * while it is set, nor can we migrate to a CPU where it is set. 36 - * So, if we find it clear on some CPU then we're guaranteed to 37 - * find it clear on any CPU we could migrate to. 38 - * 39 - * If we are in between kernel_neon_begin()...kernel_neon_end(), 40 - * the flag will be set, but preemption is also disabled, so we 41 - * can't migrate to another CPU and spuriously see it become 42 - * false. 32 + * kernel_neon_busy is only set while preemption is disabled, 33 + * and is clear whenever preemption is enabled. Since 34 + * this_cpu_read() is atomic w.r.t. preemption, kernel_neon_busy 35 + * cannot change under our feet -- if it's set we cannot be 36 + * migrated, and if it's clear we cannot be migrated to a CPU 37 + * where it is set. 43 38 */ 44 39 return !in_irq() && !irqs_disabled() && !in_nmi() && 45 - !raw_cpu_read(kernel_neon_busy); 40 + !this_cpu_read(kernel_neon_busy); 46 41 } 47 42 48 43 #else /* ! CONFIG_KERNEL_MODE_NEON */