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

Commit 39c40a1b authored by Will Deacon's avatar Will Deacon Committed by Sami Tolvanen
Browse files

BACKPORT: arm64: force CONFIG_SMP=y and remove redundant #ifdefs



Nobody seems to be producing !SMP systems anymore, so this is just
becoming a source of kernel bugs, particularly if people want to use
coherent DMA with non-shared pages.

This patch forces CONFIG_SMP=y for arm64, removing a modest amount of
code in the process.

Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>

Bug: 31432001
Change-Id: Ib3e05c90d2f7699d537bc09c2d7991c7241b7dae
(cherry picked from commit 4b3dc9679cf779339d9049800803dfc3c83433d1)
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent 4ea8326f
Loading
Loading
Loading
Loading
+4 −19
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ config ARM64
	select DCACHE_WORD_ACCESS
	select GENERIC_ALLOCATOR
	select GENERIC_CLOCKEVENTS
	select GENERIC_CLOCKEVENTS_BROADCAST if SMP
	select GENERIC_CLOCKEVENTS_BROADCAST
	select GENERIC_CPU_AUTOPROBE
	select GENERIC_EARLY_IOREMAP
	select GENERIC_IOMAP
@@ -159,6 +159,9 @@ config NEED_DMA_MAP_STATE
config NEED_SG_DMA_LENGTH
	def_bool y

config SMP
	def_bool y

config SWIOTLB
	def_bool y

@@ -419,22 +422,8 @@ config CPU_BIG_ENDIAN
       help
         Say Y if you plan on running a kernel in big-endian mode.

config SMP
	bool "Symmetric Multi-Processing"
	help
	  This enables support for systems with more than one CPU.  If
	  you say N here, the kernel will run on single and
	  multiprocessor machines, but will use only one CPU of a
	  multiprocessor machine. If you say Y here, the kernel will run
	  on many, but not all, single processor machines. On a single
	  processor machine, the kernel will run faster if you say N
	  here.

	  If you don't know what to do here, say N.

config SCHED_MC
	bool "Multi-core scheduler support"
	depends on SMP
	help
	  Multi-core scheduler support improves the CPU scheduler's decision
	  making when dealing with multi-core CPU chips at a cost of slightly
@@ -442,7 +431,6 @@ config SCHED_MC

config SCHED_SMT
	bool "SMT scheduler support"
	depends on SMP
	help
	  Improves the CPU scheduler's decision making when dealing with
	  MultiThreading at a cost of slightly increased overhead in some
@@ -450,14 +438,11 @@ config SCHED_SMT

config NR_CPUS
	int "Maximum number of CPUs (2-64)"
	range 2 64
	depends on SMP
	# These have to remain sorted largest to smallest
	default "64"

config HOTPLUG_CPU
	bool "Support for hot-pluggable CPUs"
	depends on SMP
	help
	  Say Y here to experiment with turning CPUs off and on.  CPUs
	  can be controlled through /sys/devices/system/cpu.
+0 −2
Original line number Diff line number Diff line
@@ -103,9 +103,7 @@
 * SMP data memory barrier
 */
	.macro	smp_dmb, opt
#ifdef CONFIG_SMP
	dmb	\opt
#endif
	.endm

#define USER(l, x...)				\
+2 −23
Original line number Diff line number Diff line
@@ -32,27 +32,8 @@
#define rmb()		dsb(ld)
#define wmb()		dsb(st)

#ifndef CONFIG_SMP
#define smp_mb()	barrier()
#define smp_rmb()	barrier()
#define smp_wmb()	barrier()

#define smp_store_release(p, v)						\
do {									\
	compiletime_assert_atomic_type(*p);				\
	barrier();							\
	ACCESS_ONCE(*p) = (v);						\
} while (0)

#define smp_load_acquire(p)						\
({									\
	typeof(*p) ___p1 = ACCESS_ONCE(*p);				\
	compiletime_assert_atomic_type(*p);				\
	barrier();							\
	___p1;								\
})

#else
#define dma_rmb()	dmb(oshld)
#define dma_wmb()	dmb(oshst)

#define smp_mb()	dmb(ish)
#define smp_rmb()	dmb(ishld)
@@ -90,8 +71,6 @@ do { \
	___p1;								\
})

#endif

#define read_barrier_depends()		do { } while(0)
#define smp_read_barrier_depends()	do { } while(0)

+0 −4
Original line number Diff line number Diff line
@@ -24,9 +24,7 @@

typedef struct {
	unsigned int __softirq_pending;
#ifdef CONFIG_SMP
	unsigned int ipi_irqs[NR_IPI];
#endif
} ____cacheline_aligned irq_cpustat_t;

#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
@@ -34,10 +32,8 @@ typedef struct {
#define __inc_irq_stat(cpu, member)	__IRQ_STAT(cpu, member)++
#define __get_irq_stat(cpu, member)	__IRQ_STAT(cpu, member)

#ifdef CONFIG_SMP
u64 smp_irq_stat_cpu(unsigned int cpu);
#define arch_irq_stat_cpu	smp_irq_stat_cpu
#endif

#define __ARCH_IRQ_EXIT_IRQS_DISABLED	1

+0 −11
Original line number Diff line number Diff line
#ifndef __ASM_IRQ_WORK_H
#define __ASM_IRQ_WORK_H

#ifdef CONFIG_SMP

#include <asm/smp.h>

static inline bool arch_irq_work_has_interrupt(void)
@@ -10,13 +8,4 @@ static inline bool arch_irq_work_has_interrupt(void)
	return !!__smp_cross_call;
}

#else

static inline bool arch_irq_work_has_interrupt(void)
{
	return false;
}

#endif

#endif /* __ASM_IRQ_WORK_H */
Loading