Skip to content

Commit 1205b62

Browse files
committed
Merge tag 'for-4.21' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: "Included in this update: - Florian Fainelli noticed that userspace segfaults caused by the lack of kernel-userspace helpers was hard to diagnose; we now issue a warning when userspace tries to use the helpers but the kernel has them disabled. - Ben Dooks wants compatibility for the old ATAG serial number with DT systems. - Some cleanup of assembly by Nicolas Pitre. - User accessors optimisation from Vincent Whitchurch. - More robust kdump on SMP systems from Yufen Wang. - Sebastian Andrzej Siewior noticed problems with the SMP "boot_lock" on RT kernels, and so we convert the Versatile series of platforms to use a raw spinlock instead, consolidating the Versatile implementation. We entirely remove the boot_lock on OMAP systems, where it's unnecessary. Further patches for other systems will be submitted for the following merge window. - Start switching old StrongARM-11x0 systems to use gpiolib rather than their private GPIO implementation - mostly PCMCIA bits. - ARM Kconfig cleanups. - Cleanup a mostly harmless mistake in the recent Spectre patch in 4.20 (which had the effect that data that can be placed into the init sections was incorrectly always placed in the rodata section)" * tag 'for-4.21' of git://git.armlinux.org.uk/~rmk/linux-arm: (25 commits) ARM: omap2: remove unnecessary boot_lock ARM: versatile: rename and comment SMP implementation ARM: versatile: convert boot_lock to raw ARM: vexpress/realview: consolidate immitation CPU hotplug ARM: fix the cockup in the previous patch ARM: sa1100/cerf: switch to using gpio_led_register_device() ARM: sa1100/assabet: switch to using gpio leds ARM: sa1100/assabet: add gpio keys support for right-hand two buttons ARM: sa1111: remove legacy GPIO interfaces pcmcia: sa1100*: remove redundant bvd1/bvd2 setting ARM: pxa/lubbock: switch PCMCIA to MAX1600 library ARM: pxa/mainstone: switch PCMCIA to MAX1600 library and gpiod APIs ARM: sa1100/neponset: switch PCMCIA to MAX1600 library and gpiod APIs ARM: sa1100/jornada720: switch PCMCIA to gpiod APIs pcmcia: add MAX1600 library ARM: sa1100: explicitly register sa11x0-pcmcia devices ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+ ARM: 8812/1: Optimise copy_{from/to}_user for !CPU_USE_DOMAINS ARM: 8811/1: always list both ldrd/strd registers explicitly ARM: 8808/1: kexec:offline panic_smp_self_stop CPU ...
2 parents 9ee3b3f + 6de9292 commit 1205b62

57 files changed

Lines changed: 869 additions & 853 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/Kconfig‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ config ARM
2828
select ARCH_WANT_IPC_PARSE_VERSION
2929
select BUILDTIME_EXTABLE_SORT if MMU
3030
select CLONE_BACKWARDS
31-
select CPU_PM if (SUSPEND || CPU_IDLE)
31+
select CPU_PM if SUSPEND || CPU_IDLE
3232
select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
3333
select DMA_REMAP if MMU
3434
select EDAC_SUPPORT
3535
select EDAC_ATOMIC_SCRUB
3636
select GENERIC_ALLOCATOR
3737
select GENERIC_ARCH_TOPOLOGY if ARM_CPU_TOPOLOGY
38-
select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI)
38+
select GENERIC_ATOMIC64 if CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI
3939
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
4040
select GENERIC_CPU_AUTOPROBE
4141
select GENERIC_EARLY_IOREMAP
@@ -50,12 +50,12 @@ config ARM
5050
select GENERIC_STRNLEN_USER
5151
select HANDLE_DOMAIN_IRQ
5252
select HARDIRQS_SW_RESEND
53-
select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
53+
select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT
5454
select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
5555
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
5656
select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
5757
select HAVE_ARCH_MMAP_RND_BITS if MMU
58-
select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
58+
select HAVE_ARCH_SECCOMP_FILTER if AEABI && !OABI_COMPAT
5959
select HAVE_ARCH_THREAD_STRUCT_WHITELIST
6060
select HAVE_ARCH_TRACEHOOK
6161
select HAVE_ARM_SMCCC if CPU_V7
@@ -64,16 +64,16 @@ config ARM
6464
select HAVE_C_RECORDMCOUNT
6565
select HAVE_DEBUG_KMEMLEAK
6666
select HAVE_DMA_CONTIGUOUS if MMU
67-
select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU
67+
select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
6868
select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
6969
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
7070
select HAVE_EXIT_THREAD
71-
select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
72-
select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
73-
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
71+
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
72+
select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL
73+
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
7474
select HAVE_GCC_PLUGINS
7575
select HAVE_GENERIC_DMA_COHERENT
76-
select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
76+
select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)
7777
select HAVE_IDE if PCI || ISA || PCMCIA
7878
select HAVE_IRQ_TIME_ACCOUNTING
7979
select HAVE_KERNEL_GZIP
@@ -82,15 +82,15 @@ config ARM
8282
select HAVE_KERNEL_LZO
8383
select HAVE_KERNEL_XZ
8484
select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M
85-
select HAVE_KRETPROBES if (HAVE_KPROBES)
85+
select HAVE_KRETPROBES if HAVE_KPROBES
8686
select HAVE_MOD_ARCH_SPECIFIC
8787
select HAVE_NMI
88-
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
88+
select HAVE_OPROFILE if HAVE_PERF_EVENTS
8989
select HAVE_OPTPROBES if !THUMB2_KERNEL
9090
select HAVE_PERF_EVENTS
9191
select HAVE_PERF_REGS
9292
select HAVE_PERF_USER_STACK_DUMP
93-
select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE)
93+
select HAVE_RCU_TABLE_FREE if SMP && ARM_LPAE
9494
select HAVE_REGS_AND_STACK_ACCESS_API
9595
select HAVE_RSEQ
9696
select HAVE_STACKPROTECTOR
@@ -1738,7 +1738,6 @@ config PARAVIRT
17381738
config PARAVIRT_TIME_ACCOUNTING
17391739
bool "Paravirtual steal time accounting"
17401740
select PARAVIRT
1741-
default n
17421741
help
17431742
Select this option to enable fine granularity task steal time
17441743
accounting. Time spent executing other tasks in parallel with

‎arch/arm/boot/compressed/atags_to_fdt.c‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
9898
setprop_string(fdt, "/chosen", "bootargs", cmdline);
9999
}
100100

101+
static void hex_str(char *out, uint32_t value)
102+
{
103+
uint32_t digit;
104+
int idx;
105+
106+
for (idx = 7; idx >= 0; idx--) {
107+
digit = value >> 28;
108+
value <<= 4;
109+
digit &= 0xf;
110+
if (digit < 10)
111+
digit += '0';
112+
else
113+
digit += 'A'-10;
114+
*out++ = digit;
115+
}
116+
*out = '\0';
117+
}
118+
101119
/*
102120
* Convert and fold provided ATAGs into the provided FDT.
103121
*
@@ -180,6 +198,11 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space)
180198
initrd_start);
181199
setprop_cell(fdt, "/chosen", "linux,initrd-end",
182200
initrd_start + initrd_size);
201+
} else if (atag->hdr.tag == ATAG_SERIAL) {
202+
char serno[16+2];
203+
hex_str(serno, atag->u.serialnr.high);
204+
hex_str(serno+8, atag->u.serialnr.low);
205+
setprop_string(fdt, "/", "serial-number", serno);
183206
}
184207
}
185208

‎arch/arm/common/sa1111.c‎

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,65 +1282,6 @@ int sa1111_get_audio_rate(struct sa1111_dev *sadev)
12821282
}
12831283
EXPORT_SYMBOL(sa1111_get_audio_rate);
12841284

1285-
void sa1111_set_io_dir(struct sa1111_dev *sadev,
1286-
unsigned int bits, unsigned int dir,
1287-
unsigned int sleep_dir)
1288-
{
1289-
struct sa1111 *sachip = sa1111_chip_driver(sadev);
1290-
unsigned long flags;
1291-
unsigned int val;
1292-
void __iomem *gpio = sachip->base + SA1111_GPIO;
1293-
1294-
#define MODIFY_BITS(port, mask, dir) \
1295-
if (mask) { \
1296-
val = readl_relaxed(port); \
1297-
val &= ~(mask); \
1298-
val |= (dir) & (mask); \
1299-
writel_relaxed(val, port); \
1300-
}
1301-
1302-
spin_lock_irqsave(&sachip->lock, flags);
1303-
MODIFY_BITS(gpio + SA1111_GPIO_PADDR, bits & 15, dir);
1304-
MODIFY_BITS(gpio + SA1111_GPIO_PBDDR, (bits >> 8) & 255, dir >> 8);
1305-
MODIFY_BITS(gpio + SA1111_GPIO_PCDDR, (bits >> 16) & 255, dir >> 16);
1306-
1307-
MODIFY_BITS(gpio + SA1111_GPIO_PASDR, bits & 15, sleep_dir);
1308-
MODIFY_BITS(gpio + SA1111_GPIO_PBSDR, (bits >> 8) & 255, sleep_dir >> 8);
1309-
MODIFY_BITS(gpio + SA1111_GPIO_PCSDR, (bits >> 16) & 255, sleep_dir >> 16);
1310-
spin_unlock_irqrestore(&sachip->lock, flags);
1311-
}
1312-
EXPORT_SYMBOL(sa1111_set_io_dir);
1313-
1314-
void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v)
1315-
{
1316-
struct sa1111 *sachip = sa1111_chip_driver(sadev);
1317-
unsigned long flags;
1318-
unsigned int val;
1319-
void __iomem *gpio = sachip->base + SA1111_GPIO;
1320-
1321-
spin_lock_irqsave(&sachip->lock, flags);
1322-
MODIFY_BITS(gpio + SA1111_GPIO_PADWR, bits & 15, v);
1323-
MODIFY_BITS(gpio + SA1111_GPIO_PBDWR, (bits >> 8) & 255, v >> 8);
1324-
MODIFY_BITS(gpio + SA1111_GPIO_PCDWR, (bits >> 16) & 255, v >> 16);
1325-
spin_unlock_irqrestore(&sachip->lock, flags);
1326-
}
1327-
EXPORT_SYMBOL(sa1111_set_io);
1328-
1329-
void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v)
1330-
{
1331-
struct sa1111 *sachip = sa1111_chip_driver(sadev);
1332-
unsigned long flags;
1333-
unsigned int val;
1334-
void __iomem *gpio = sachip->base + SA1111_GPIO;
1335-
1336-
spin_lock_irqsave(&sachip->lock, flags);
1337-
MODIFY_BITS(gpio + SA1111_GPIO_PASSR, bits & 15, v);
1338-
MODIFY_BITS(gpio + SA1111_GPIO_PBSSR, (bits >> 8) & 255, v >> 8);
1339-
MODIFY_BITS(gpio + SA1111_GPIO_PCSSR, (bits >> 16) & 255, v >> 16);
1340-
spin_unlock_irqrestore(&sachip->lock, flags);
1341-
}
1342-
EXPORT_SYMBOL(sa1111_set_sleep_io);
1343-
13441285
/*
13451286
* Individual device operations.
13461287
*/

‎arch/arm/include/asm/assembler.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,15 @@
243243
.endm
244244
#endif
245245

246-
#define USER(x...) \
246+
#define USERL(l, x...) \
247247
9999: x; \
248248
.pushsection __ex_table,"a"; \
249249
.align 3; \
250-
.long 9999b,9001f; \
250+
.long 9999b,l; \
251251
.popsection
252252

253+
#define USER(x...) USERL(9001f, x)
254+
253255
#ifdef CONFIG_SMP
254256
#define ALT_SMP(instr...) \
255257
9998: instr

‎arch/arm/include/asm/hardware/sa1111.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,6 @@ int sa1111_check_dma_bug(dma_addr_t addr);
433433
int sa1111_driver_register(struct sa1111_driver *);
434434
void sa1111_driver_unregister(struct sa1111_driver *);
435435

436-
void sa1111_set_io_dir(struct sa1111_dev *sadev, unsigned int bits, unsigned int dir, unsigned int sleep_dir);
437-
void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
438-
void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
439-
440436
struct sa1111_platform_data {
441437
int irq_base; /* base for cascaded on-chip IRQs */
442438
unsigned disable_devs;

‎arch/arm/include/asm/uaccess.h‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ do { \
349349
#define __get_user_asm_byte(x, addr, err) \
350350
__get_user_asm(x, addr, err, ldrb)
351351

352+
#if __LINUX_ARM_ARCH__ >= 6
353+
354+
#define __get_user_asm_half(x, addr, err) \
355+
__get_user_asm(x, addr, err, ldrh)
356+
357+
#else
358+
352359
#ifndef __ARMEB__
353360
#define __get_user_asm_half(x, __gu_addr, err) \
354361
({ \
@@ -367,6 +374,8 @@ do { \
367374
})
368375
#endif
369376

377+
#endif /* __LINUX_ARM_ARCH__ >= 6 */
378+
370379
#define __get_user_asm_word(x, addr, err) \
371380
__get_user_asm(x, addr, err, ldr)
372381
#endif
@@ -442,6 +451,13 @@ do { \
442451
#define __put_user_asm_byte(x, __pu_addr, err) \
443452
__put_user_asm(x, __pu_addr, err, strb)
444453

454+
#if __LINUX_ARM_ARCH__ >= 6
455+
456+
#define __put_user_asm_half(x, __pu_addr, err) \
457+
__put_user_asm(x, __pu_addr, err, strh)
458+
459+
#else
460+
445461
#ifndef __ARMEB__
446462
#define __put_user_asm_half(x, __pu_addr, err) \
447463
({ \
@@ -458,6 +474,8 @@ do { \
458474
})
459475
#endif
460476

477+
#endif /* __LINUX_ARM_ARCH__ >= 6 */
478+
461479
#define __put_user_asm_word(x, __pu_addr, err) \
462480
__put_user_asm(x, __pu_addr, err, str)
463481

‎arch/arm/kernel/head.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ ENTRY(secondary_startup)
398398
ldmia r4, {r5, r7, r12} @ address to jump to after
399399
sub lr, r4, r5 @ mmu has been enabled
400400
add r3, r7, lr
401-
ldrd r4, [r3, #0] @ get secondary_data.pgdir
401+
ldrd r4, r5, [r3, #0] @ get secondary_data.pgdir
402402
ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE:
403403
ARM_BE8(eor r5, r4, r5) @ it can be done in 3 steps
404404
ARM_BE8(eor r4, r4, r5) @ without using a temp reg.

‎arch/arm/kernel/smp.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,21 @@ void smp_send_stop(void)
724724
pr_warn("SMP: failed to stop secondary CPUs\n");
725725
}
726726

727+
/* In case panic() and panic() called at the same time on CPU1 and CPU2,
728+
* and CPU 1 calls panic_smp_self_stop() before crash_smp_send_stop()
729+
* CPU1 can't receive the ipi irqs from CPU2, CPU1 will be always online,
730+
* kdump fails. So split out the panic_smp_self_stop() and add
731+
* set_cpu_online(smp_processor_id(), false).
732+
*/
733+
void panic_smp_self_stop(void)
734+
{
735+
pr_debug("CPU %u will stop doing anything useful since another CPU has paniced\n",
736+
smp_processor_id());
737+
set_cpu_online(smp_processor_id(), false);
738+
while (1)
739+
cpu_relax();
740+
}
741+
727742
/*
728743
* not supported here
729744
*/

‎arch/arm/lib/copy_from_user.S‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@
3434
* Number of bytes NOT copied.
3535
*/
3636

37+
#ifdef CONFIG_CPU_USE_DOMAINS
38+
3739
#ifndef CONFIG_THUMB2_KERNEL
3840
#define LDR1W_SHIFT 0
3941
#else
4042
#define LDR1W_SHIFT 1
4143
#endif
42-
#define STR1W_SHIFT 0
4344

4445
.macro ldr1w ptr reg abort
4546
ldrusr \reg, \ptr, 4, abort=\abort
@@ -57,10 +58,30 @@
5758
ldr4w \ptr, \reg5, \reg6, \reg7, \reg8, \abort
5859
.endm
5960

61+
#else
62+
63+
#define LDR1W_SHIFT 0
64+
65+
.macro ldr1w ptr reg abort
66+
USERL(\abort, W(ldr) \reg, [\ptr], #4)
67+
.endm
68+
69+
.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
70+
USERL(\abort, ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4})
71+
.endm
72+
73+
.macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
74+
USERL(\abort, ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8})
75+
.endm
76+
77+
#endif /* CONFIG_CPU_USE_DOMAINS */
78+
6079
.macro ldr1b ptr reg cond=al abort
6180
ldrusr \reg, \ptr, 1, \cond, abort=\abort
6281
.endm
6382

83+
#define STR1W_SHIFT 0
84+
6485
.macro str1w ptr reg abort
6586
W(str) \reg, [\ptr], #4
6687
.endm

‎arch/arm/lib/copy_to_user.S‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
*/
3636

3737
#define LDR1W_SHIFT 0
38-
#ifndef CONFIG_THUMB2_KERNEL
39-
#define STR1W_SHIFT 0
40-
#else
41-
#define STR1W_SHIFT 1
42-
#endif
4338

4439
.macro ldr1w ptr reg abort
4540
W(ldr) \reg, [\ptr], #4
@@ -57,6 +52,14 @@
5752
ldr\cond\()b \reg, [\ptr], #1
5853
.endm
5954

55+
#ifdef CONFIG_CPU_USE_DOMAINS
56+
57+
#ifndef CONFIG_THUMB2_KERNEL
58+
#define STR1W_SHIFT 0
59+
#else
60+
#define STR1W_SHIFT 1
61+
#endif
62+
6063
.macro str1w ptr reg abort
6164
strusr \reg, \ptr, 4, abort=\abort
6265
.endm
@@ -72,6 +75,20 @@
7275
str1w \ptr, \reg8, \abort
7376
.endm
7477

78+
#else
79+
80+
#define STR1W_SHIFT 0
81+
82+
.macro str1w ptr reg abort
83+
USERL(\abort, W(str) \reg, [\ptr], #4)
84+
.endm
85+
86+
.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
87+
USERL(\abort, stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8})
88+
.endm
89+
90+
#endif /* CONFIG_CPU_USE_DOMAINS */
91+
7592
.macro str1b ptr reg cond=al abort
7693
strusr \reg, \ptr, 1, \cond, abort=\abort
7794
.endm

0 commit comments

Comments
 (0)