Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e60329c9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files


Pull arm64 fixes from Will Deacon:
 "A larger-than-usual batch of arm64 fixes for -rc3.

  The bulk of the fixes are dealing with a bunch of issues with the
  build system from the compat vDSO, which unfortunately led to some
  significant Makefile rework to manage the horrible combinations of
  toolchains that we can end up needing to drive simultaneously.

  We came close to disabling the thing entirely, but Vincenzo was quick
  to spin up some patches and I ended up picking up most of the bits
  that were left [*]. Future work will look at disentangling the header
  files properly.

  Other than that, we have some important fixes all over, including one
  papering over the miscompilation fallout from forcing
  CONFIG_OPTIMIZE_INLINING=y, which I'm still unhappy about. Harumph.

  We've still got a couple of open issues, so I'm expecting to have some
  more fixes later this cycle.

  Summary:

   - Numerous fixes to the compat vDSO build system, especially when
     combining gcc and clang

   - Fix parsing of PAR_EL1 in spurious kernel fault detection

   - Partial workaround for Neoverse-N1 erratum #1542419

   - Fix IRQ priority masking on entry from compat syscalls

   - Fix advertisment of FRINT HWCAP to userspace

   - Attempt to workaround inlining breakage with '__always_inline'

   - Fix accidental freeing of parent SVE state on fork() error path

   - Add some missing NULL pointer checks in instruction emulation init

   - Some formatting and comment fixes"

[*] Will's final fixes were

        Reviewed-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
        Tested-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>

    but they were already in linux-next by then and he didn't rebase
    just to add those.

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (21 commits)
  arm64: armv8_deprecated: Checking return value for memory allocation
  arm64: Kconfig: Make CONFIG_COMPAT_VDSO a proper Kconfig option
  arm64: vdso32: Rename COMPATCC to CC_COMPAT
  arm64: vdso32: Pass '--target' option to clang via VDSO_CAFLAGS
  arm64: vdso32: Don't use KBUILD_CPPFLAGS unconditionally
  arm64: vdso32: Move definition of COMPATCC into vdso32/Makefile
  arm64: Default to building compat vDSO with clang when CONFIG_CC_IS_CLANG
  lib: vdso: Remove CROSS_COMPILE_COMPAT_VDSO
  arm64: vdso32: Remove jump label config option in Makefile
  arm64: vdso32: Detect binutils support for dmb ishld
  arm64: vdso: Remove stale files from old assembly implementation
  arm64: vdso32: Fix broken compat vDSO build warnings
  arm64: mm: fix spurious fault detection
  arm64: ftrace: Ensure synchronisation in PLT setup for Neoverse-N1 #1542419
  arm64: Fix incorrect irqflag restore for priority masking for compat
  arm64: mm: avoid virt_to_phys(init_mm.pgd)
  arm64: cpufeature: Effectively expose FRINT capability to userspace
  arm64: Mark functions using explicit register variables as '__always_inline'
  docs: arm64: Fix indentation and doc formatting
  arm64/sve: Fix wrong free for task->thread.sve_state
  ...
parents e3280b54 3e7c93bd
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -154,11 +154,18 @@ return virtual addresses to userspace from a 48-bit range.


Software can "opt-in" to receiving VAs from a 52-bit space by
Software can "opt-in" to receiving VAs from a 52-bit space by
specifying an mmap hint parameter that is larger than 48-bit.
specifying an mmap hint parameter that is larger than 48-bit.

For example:
For example:

.. code-block:: c

   maybe_high_address = mmap(~0UL, size, prot, flags,...);
   maybe_high_address = mmap(~0UL, size, prot, flags,...);


It is also possible to build a debug kernel that returns addresses
It is also possible to build a debug kernel that returns addresses
from a 52-bit space by enabling the following kernel config options:
from a 52-bit space by enabling the following kernel config options:

.. code-block:: sh

   CONFIG_EXPERT=y && CONFIG_ARM64_FORCE_52BIT=y
   CONFIG_EXPERT=y && CONFIG_ARM64_FORCE_52BIT=y


Note that this option is only intended for debugging applications
Note that this option is only intended for debugging applications
+13 −2
Original line number Original line Diff line number Diff line
@@ -110,7 +110,6 @@ config ARM64
	select GENERIC_STRNLEN_USER
	select GENERIC_STRNLEN_USER
	select GENERIC_TIME_VSYSCALL
	select GENERIC_TIME_VSYSCALL
	select GENERIC_GETTIMEOFDAY
	select GENERIC_GETTIMEOFDAY
	select GENERIC_COMPAT_VDSO if (!CPU_BIG_ENDIAN && COMPAT)
	select HANDLE_DOMAIN_IRQ
	select HANDLE_DOMAIN_IRQ
	select HARDIRQS_SW_RESEND
	select HARDIRQS_SW_RESEND
	select HAVE_PCI
	select HAVE_PCI
@@ -1159,7 +1158,7 @@ menuconfig COMPAT
if COMPAT
if COMPAT


config KUSER_HELPERS
config KUSER_HELPERS
	bool "Enable kuser helpers page for 32 bit applications"
	bool "Enable kuser helpers page for 32-bit applications"
	default y
	default y
	help
	help
	  Warning: disabling this option may break 32-bit user programs.
	  Warning: disabling this option may break 32-bit user programs.
@@ -1185,6 +1184,18 @@ config KUSER_HELPERS
	  Say N here only if you are absolutely certain that you do not
	  Say N here only if you are absolutely certain that you do not
	  need these helpers; otherwise, the safe option is to say Y.
	  need these helpers; otherwise, the safe option is to say Y.


config COMPAT_VDSO
	bool "Enable vDSO for 32-bit applications"
	depends on !CPU_BIG_ENDIAN && "$(CROSS_COMPILE_COMPAT)" != ""
	select GENERIC_COMPAT_VDSO
	default y
	help
	  Place in the process address space of 32-bit applications an
	  ELF shared object providing fast implementations of gettimeofday
	  and clock_gettime.

	  You must have a 32-bit build of glibc 2.22 or later for programs
	  to seamlessly take advantage of this.


menuconfig ARMV8_DEPRECATED
menuconfig ARMV8_DEPRECATED
	bool "Emulate deprecated/obsolete ARMv8 instructions"
	bool "Emulate deprecated/obsolete ARMv8 instructions"
+0 −16
Original line number Original line Diff line number Diff line
@@ -53,22 +53,6 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
  endif
  endif
endif
endif


ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y)
  CROSS_COMPILE_COMPAT ?= $(CONFIG_CROSS_COMPILE_COMPAT_VDSO:"%"=%)

  ifeq ($(CONFIG_CC_IS_CLANG), y)
    $(warning CROSS_COMPILE_COMPAT is clang, the compat vDSO will not be built)
  else ifeq ($(strip $(CROSS_COMPILE_COMPAT)),)
    $(warning CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built)
  else ifeq ($(shell which $(CROSS_COMPILE_COMPAT)gcc 2> /dev/null),)
    $(error $(CROSS_COMPILE_COMPAT)gcc not found, check CROSS_COMPILE_COMPAT)
  else
    export CROSS_COMPILE_COMPAT
    export CONFIG_COMPAT_VDSO := y
    compat_vdso := -DCONFIG_COMPAT_VDSO=1
  endif
endif

KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)	\
KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)	\
		   $(compat_vdso) $(cc_has_k_constraint)
		   $(compat_vdso) $(cc_has_k_constraint)
KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
+4 −2
Original line number Original line Diff line number Diff line
@@ -321,7 +321,8 @@ static inline s64 __lse_atomic64_dec_if_positive(atomic64_t *v)
}
}


#define __CMPXCHG_CASE(w, sfx, name, sz, mb, cl...)			\
#define __CMPXCHG_CASE(w, sfx, name, sz, mb, cl...)			\
static inline u##sz __lse__cmpxchg_case_##name##sz(volatile void *ptr,	\
static __always_inline u##sz						\
__lse__cmpxchg_case_##name##sz(volatile void *ptr,			\
					      u##sz old,		\
					      u##sz old,		\
					      u##sz new)		\
					      u##sz new)		\
{									\
{									\
@@ -362,7 +363,8 @@ __CMPXCHG_CASE(x, , mb_, 64, al, "memory")
#undef __CMPXCHG_CASE
#undef __CMPXCHG_CASE


#define __CMPXCHG_DBL(name, mb, cl...)					\
#define __CMPXCHG_DBL(name, mb, cl...)					\
static inline long __lse__cmpxchg_double##name(unsigned long old1,	\
static __always_inline long						\
__lse__cmpxchg_double##name(unsigned long old1,				\
					 unsigned long old2,		\
					 unsigned long old2,		\
					 unsigned long new1,		\
					 unsigned long new1,		\
					 unsigned long new2,		\
					 unsigned long new2,		\
+1 −1
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@


#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")


#if __LINUX_ARM_ARCH__ >= 8
#if __LINUX_ARM_ARCH__ >= 8 && defined(CONFIG_AS_DMB_ISHLD)
#define aarch32_smp_mb()	dmb(ish)
#define aarch32_smp_mb()	dmb(ish)
#define aarch32_smp_rmb()	dmb(ishld)
#define aarch32_smp_rmb()	dmb(ishld)
#define aarch32_smp_wmb()	dmb(ishst)
#define aarch32_smp_wmb()	dmb(ishst)
Loading