Commit 2fa39482 authored by Russell King (Oracle)'s avatar Russell King (Oracle)
Browse files

Merge tag 'arm-vmap-stacks-v6' of...

Merge tag 'arm-vmap-stacks-v6' of git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux into devel-stable

ARM: support for IRQ and vmap'ed stacks [v6]

This tag covers the changes between the version of vmap'ed + IRQ stacks
support pulled into rmk/devel-stable [0] (which was dropped from v5.17
due to issues discovered too late in the cycle), and my v5 proposed for
the v5.18 cycle [1].

[0] git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git arm-irq-and-vmap-stacks-for-rmk
[1] https://lore.kernel.org/linux-arm-kernel/20220124174744.1054712-1-ardb@kernel.org/
parents 5fe41793 4d5a643e
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ config ARM
	select RTC_LIB
	select SYS_SUPPORTS_APM_EMULATION
	select THREAD_INFO_IN_TASK
	select HAVE_ARCH_VMAP_STACK if MMU && (!LD_IS_LLD || LLD_VERSION >= 140000) && !PM_SLEEP_SMP
	select HAVE_ARCH_VMAP_STACK if MMU && ARM_HAS_GROUP_RELOCS
	select TRACE_IRQFLAGS_SUPPORT if !CPU_V7M
	# Above selects are sorted alphabetically; please add new ones
	# according to that.  Thanks.
@@ -140,6 +140,17 @@ config ARM
	  Europe.  There is an ARM Linux project with a web page at
	  <http://www.arm.linux.org.uk/>.

config ARM_HAS_GROUP_RELOCS
	def_bool y
	depends on !LD_IS_LLD || LLD_VERSION >= 140000
	depends on !COMPILE_TEST
	help
	  Whether or not to use R_ARM_ALU_PC_Gn or R_ARM_LDR_PC_Gn group
	  relocations, which have been around for a long time, but were not
	  supported in LLD until version 14. The combined range is -/+ 256 MiB,
	  which is usually sufficient, but not for allyesconfig, so we disable
	  this feature when doing compile testing.

config ARM_HAS_SG_CHAIN
	bool

+4 −4
Original line number Diff line number Diff line
@@ -656,8 +656,8 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )

	.macro		__ldst_va, op, reg, tmp, sym, cond
#if __LINUX_ARM_ARCH__ >= 7 || \
    (defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS)) || \
    (defined(CONFIG_LD_IS_LLD) && CONFIG_LLD_VERSION < 140000)
    !defined(CONFIG_ARM_HAS_GROUP_RELOCS) || \
    (defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
	mov_l		\tmp, \sym, \cond
	\op\cond	\reg, [\tmp]
#else
@@ -716,8 +716,8 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
	 */
	.macro		ldr_this_cpu, rd:req, sym:req, t1:req, t2:req
#if __LINUX_ARM_ARCH__ >= 7 || \
    (defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS)) || \
    (defined(CONFIG_LD_IS_LLD) && CONFIG_LLD_VERSION < 140000)
    !defined(CONFIG_ARM_HAS_GROUP_RELOCS) || \
    (defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
	this_cpu_offset	\t1
	mov_l		\t2, \sym
	ldr		\rd, [\t1, \t2]
+5 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ struct task_struct;

extern struct task_struct *__current;

static inline __attribute_const__ struct task_struct *get_current(void)
static __always_inline __attribute_const__ struct task_struct *get_current(void)
{
	struct task_struct *cur;

@@ -37,8 +37,8 @@ static inline __attribute_const__ struct task_struct *get_current(void)
#ifdef CONFIG_CPU_V6
	    "1:							\n\t"
	    "	.subsection 1					\n\t"
#if !(defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS)) && \
    !(defined(CONFIG_LD_IS_LLD) && CONFIG_LLD_VERSION < 140000)
#if defined(CONFIG_ARM_HAS_GROUP_RELOCS) && \
    !(defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
	    "2: " LOAD_SYM_ARMV6(%0, __current) "		\n\t"
	    "	b	1b					\n\t"
#else
@@ -55,8 +55,8 @@ static inline __attribute_const__ struct task_struct *get_current(void)
#endif
	    : "=r"(cur));
#elif __LINUX_ARM_ARCH__>= 7 || \
      (defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS)) || \
      (defined(CONFIG_LD_IS_LLD) && CONFIG_LLD_VERSION < 140000)
      !defined(CONFIG_ARM_HAS_GROUP_RELOCS) || \
      (defined(MODULE) && defined(CONFIG_ARM_MODULE_PLTS))
	cur = __current;
#else
	asm(LOAD_SYM_ARMV6(%0, __current) : "=r"(cur));
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ typedef struct {
#else
	int		switch_pending;
#endif
	unsigned int	vmalloc_seq;
	atomic_t	vmalloc_seq;
	unsigned long	sigpage;
#ifdef CONFIG_VDSO
	unsigned long	vdso;
+20 −2
Original line number Diff line number Diff line
@@ -23,6 +23,16 @@

void __check_vmalloc_seq(struct mm_struct *mm);

#ifdef CONFIG_MMU
static inline void check_vmalloc_seq(struct mm_struct *mm)
{
	if (!IS_ENABLED(CONFIG_ARM_LPAE) &&
	    unlikely(atomic_read(&mm->context.vmalloc_seq) !=
		     atomic_read(&init_mm.context.vmalloc_seq)))
		__check_vmalloc_seq(mm);
}
#endif

#ifdef CONFIG_CPU_HAS_ASID

void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk);
@@ -52,8 +62,7 @@ static inline void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm,
static inline void check_and_switch_context(struct mm_struct *mm,
					    struct task_struct *tsk)
{
	if (unlikely(mm->context.vmalloc_seq != init_mm.context.vmalloc_seq))
		__check_vmalloc_seq(mm);
	check_vmalloc_seq(mm);

	if (irqs_disabled())
		/*
@@ -129,6 +138,15 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
#endif
}

#ifdef CONFIG_VMAP_STACK
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
{
	if (mm != &init_mm)
		check_vmalloc_seq(mm);
}
#define enter_lazy_tlb enter_lazy_tlb
#endif

#include <asm-generic/mmu_context.h>

#endif
Loading