Commit 56ef24e5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull arm64 fixes from Catalin Marinas:

 - Clean-ups following the merging window: remove unused variable,
   duplicate includes, superfluous barrier, move some inline asm to
   separate functions.

 - Disable top-byte-ignore on kernel code addresses with KASAN/MTE
   enabled (already done when MTE is disabled).

 - Fix ARCH_LOW_ADDRESS_LIMIT definition with CONFIG_ZONE_DMA disabled.

 - Compiler/linker flags: link with "-z norelno", discard .eh_frame_hdr
   instead of --no-eh-frame-hdr.

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
  arm64: Move PSTATE.TCO setting to separate functions
  arm64: kasan: Set TCR_EL1.TBID1 when KASAN_HW_TAGS is enabled
  arm64: vdso: disable .eh_frame_hdr via /DISCARD/ instead of --no-eh-frame-hdr
  arm64: traps: remove duplicate include statement
  arm64: link with -z norelro for LLD or aarch64-elf
  arm64: mm: Fix ARCH_LOW_ADDRESS_LIMIT when !CONFIG_ZONE_DMA
  arm64: mte: remove an ISB on kernel exit
  arm64/smp: Remove unused irq variable in arch_show_interrupts()
parents 6279d812 83b5bd62
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#
# Copyright (C) 1995-2001 by Russell King

LDFLAGS_vmlinux	:=--no-undefined -X -z norelro
LDFLAGS_vmlinux	:=--no-undefined -X

ifeq ($(CONFIG_RELOCATABLE), y)
# Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
@@ -115,16 +115,20 @@ KBUILD_CPPFLAGS += -mbig-endian
CHECKFLAGS	+= -D__AARCH64EB__
# Prefer the baremetal ELF build target, but not all toolchains include
# it so fall back to the standard linux version if needed.
KBUILD_LDFLAGS	+= -EB $(call ld-option, -maarch64elfb, -maarch64linuxb)
KBUILD_LDFLAGS	+= -EB $(call ld-option, -maarch64elfb, -maarch64linuxb -z norelro)
UTS_MACHINE	:= aarch64_be
else
KBUILD_CPPFLAGS	+= -mlittle-endian
CHECKFLAGS	+= -D__AARCH64EL__
# Same as above, prefer ELF but fall back to linux target if needed.
KBUILD_LDFLAGS	+= -EL $(call ld-option, -maarch64elf, -maarch64linux)
KBUILD_LDFLAGS	+= -EL $(call ld-option, -maarch64elf, -maarch64linux -z norelro)
UTS_MACHINE	:= aarch64
endif

ifeq ($(CONFIG_LD_IS_LLD), y)
KBUILD_LDFLAGS	+= -z norelro
endif

CHECKFLAGS	+= -D__aarch64__

ifeq ($(CONFIG_DYNAMIC_FTRACE_WITH_REGS),y)
+2 −1
Original line number Diff line number Diff line
@@ -94,7 +94,8 @@
#endif /* CONFIG_ARM64_FORCE_52BIT */

extern phys_addr_t arm64_dma_phys_limit;
#define ARCH_LOW_ADDRESS_LIMIT	(arm64_dma_phys_limit - 1)
extern phys_addr_t arm64_dma32_phys_limit;
#define ARCH_LOW_ADDRESS_LIMIT	((arm64_dma_phys_limit ? : arm64_dma32_phys_limit) - 1)

struct debug_info {
#ifdef CONFIG_HAVE_HW_BREAKPOINT
+13 −3
Original line number Diff line number Diff line
@@ -176,10 +176,21 @@ static inline void __uaccess_enable_hw_pan(void)
 * The Tag check override (TCO) bit disables temporarily the tag checking
 * preventing the issue.
 */
static inline void uaccess_disable_privileged(void)
static inline void __uaccess_disable_tco(void)
{
	asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(0),
				 ARM64_MTE, CONFIG_KASAN_HW_TAGS));
}

static inline void __uaccess_enable_tco(void)
{
	asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
				 ARM64_MTE, CONFIG_KASAN_HW_TAGS));
}

static inline void uaccess_disable_privileged(void)
{
	__uaccess_disable_tco();

	if (uaccess_ttbr0_disable())
		return;
@@ -189,8 +200,7 @@ static inline void uaccess_disable_privileged(void)

static inline void uaccess_enable_privileged(void)
{
	asm volatile(ALTERNATIVE("nop", SET_PSTATE_TCO(1),
				 ARM64_MTE, CONFIG_KASAN_HW_TAGS));
	__uaccess_enable_tco();

	if (uaccess_ttbr0_enable())
		return;
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,6 @@ alternative_else_nop_endif
	mrs_s	\tmp2, SYS_GCR_EL1
	bfi	\tmp2, \tmp, #0, #16
	msr_s	SYS_GCR_EL1, \tmp2
	isb
#endif
	.endm

@@ -194,6 +193,7 @@ alternative_else_nop_endif
	ldr_l	\tmp, gcr_kernel_excl

	mte_set_gcr \tmp, \tmp2
	isb
1:
#endif
	.endm
+0 −1
Original line number Diff line number Diff line
@@ -807,7 +807,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)
	unsigned int cpu, i;

	for (i = 0; i < NR_IPI; i++) {
		unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
		seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i,
			   prec >= 4 ? " " : "");
		for_each_online_cpu(cpu)
Loading