Skip to content

Commit 02fb638

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - remove a misuse of kernel-doc comment - use "Call trace:" for backtraces like other architectures - implement copy_from_kernel_nofault_allowed() to fix a LKDTM test - add a "cut here" line for prefetch aborts - remove unnecessary Kconfing entry for FRAME_POINTER - remove iwmmxy support for PJ4/PJ4B cores - use bitfield helpers in ptrace to improve readabililty - check if folio is reserved before flushing * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9359/1: flush: check if the folio is reserved for no-mapping addresses ARM: 9354/1: ptrace: Use bitfield helpers ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores ARM: 9353/1: remove unneeded entry for CONFIG_FRAME_POINTER ARM: 9351/1: fault: Add "cut here" line for prefetch aborts ARM: 9350/1: fault: Implement copy_from_kernel_nofault_allowed() ARM: 9349/1: unwind: Add missing "Call trace:" line ARM: 9334/1: mm: init: remove misuse of kernel-doc comment
2 parents b718713 + b42b3ae commit 02fb638

File tree

11 files changed

+33
-184
lines changed

11 files changed

+33
-184
lines changed

arch/arm/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ source "arch/arm/mm/Kconfig"
505505

506506
config IWMMXT
507507
bool "Enable iWMMXt support"
508-
depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B
509-
default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 || CPU_PJ4B
508+
depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK
509+
default y if PXA27x || PXA3xx || ARCH_MMP
510510
help
511511
Enable support for iWMMXt context switching at run time if
512512
running on a CPU that supports it.

arch/arm/Kconfig.debug

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ config BACKTRACE_VERBOSE
9090
In most cases, say N here, unless you are intending to debug the
9191
kernel and have access to the kernel binary image.
9292

93-
config FRAME_POINTER
94-
bool
95-
9693
config DEBUG_USER
9794
bool "Verbose user fault messages"
9895
help

arch/arm/include/asm/ptrace.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <uapi/asm/ptrace.h>
1111

1212
#ifndef __ASSEMBLY__
13+
#include <linux/bitfield.h>
1314
#include <linux/types.h>
1415

1516
struct pt_regs {
@@ -35,8 +36,8 @@ struct svc_pt_regs {
3536

3637
#ifndef CONFIG_CPU_V7M
3738
#define isa_mode(regs) \
38-
((((regs)->ARM_cpsr & PSR_J_BIT) >> (__ffs(PSR_J_BIT) - 1)) | \
39-
(((regs)->ARM_cpsr & PSR_T_BIT) >> (__ffs(PSR_T_BIT))))
39+
(FIELD_GET(PSR_J_BIT, (regs)->ARM_cpsr) << 1 | \
40+
FIELD_GET(PSR_T_BIT, (regs)->ARM_cpsr))
4041
#else
4142
#define isa_mode(regs) 1 /* Thumb */
4243
#endif

arch/arm/kernel/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
7676
obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
7777
obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
7878
obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
79-
obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o
80-
obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o
8179
obj-$(CONFIG_IWMMXT) += iwmmxt.o
8280
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
8381
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \

arch/arm/kernel/iwmmxt.S

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@
1818
#include <asm/assembler.h>
1919
#include "iwmmxt.h"
2020

21-
#if defined(CONFIG_CPU_PJ4) || defined(CONFIG_CPU_PJ4B)
22-
#define PJ4(code...) code
23-
#define XSC(code...)
24-
#elif defined(CONFIG_CPU_MOHAWK) || \
25-
defined(CONFIG_CPU_XSC3) || \
26-
defined(CONFIG_CPU_XSCALE)
27-
#define PJ4(code...)
28-
#define XSC(code...) code
29-
#else
30-
#error "Unsupported iWMMXt architecture"
31-
#endif
32-
3321
#define MMX_WR0 (0x00)
3422
#define MMX_WR1 (0x08)
3523
#define MMX_WR2 (0x10)
@@ -81,17 +69,13 @@ ENDPROC(iwmmxt_undef_handler)
8169
ENTRY(iwmmxt_task_enable)
8270
inc_preempt_count r10, r3
8371

84-
XSC(mrc p15, 0, r2, c15, c1, 0)
85-
PJ4(mrc p15, 0, r2, c1, c0, 2)
72+
mrc p15, 0, r2, c15, c1, 0
8673
@ CP0 and CP1 accessible?
87-
XSC(tst r2, #0x3)
88-
PJ4(tst r2, #0xf)
74+
tst r2, #0x3
8975
bne 4f @ if so no business here
9076
@ enable access to CP0 and CP1
91-
XSC(orr r2, r2, #0x3)
92-
XSC(mcr p15, 0, r2, c15, c1, 0)
93-
PJ4(orr r2, r2, #0xf)
94-
PJ4(mcr p15, 0, r2, c1, c0, 2)
77+
orr r2, r2, #0x3
78+
mcr p15, 0, r2, c15, c1, 0
9579

9680
ldr r3, =concan_owner
9781
ldr r2, [r0, #S_PC] @ current task pc value
@@ -218,12 +202,9 @@ ENTRY(iwmmxt_task_disable)
218202
bne 1f @ no: quit
219203

220204
@ enable access to CP0 and CP1
221-
XSC(mrc p15, 0, r4, c15, c1, 0)
222-
XSC(orr r4, r4, #0x3)
223-
XSC(mcr p15, 0, r4, c15, c1, 0)
224-
PJ4(mrc p15, 0, r4, c1, c0, 2)
225-
PJ4(orr r4, r4, #0xf)
226-
PJ4(mcr p15, 0, r4, c1, c0, 2)
205+
mrc p15, 0, r4, c15, c1, 0
206+
orr r4, r4, #0x3
207+
mcr p15, 0, r4, c15, c1, 0
227208

228209
mov r0, #0 @ nothing to load
229210
str r0, [r3] @ no more current owner
@@ -232,10 +213,8 @@ ENTRY(iwmmxt_task_disable)
232213
bl concan_save
233214

234215
@ disable access to CP0 and CP1
235-
XSC(bic r4, r4, #0x3)
236-
XSC(mcr p15, 0, r4, c15, c1, 0)
237-
PJ4(bic r4, r4, #0xf)
238-
PJ4(mcr p15, 0, r4, c1, c0, 2)
216+
bic r4, r4, #0x3
217+
mcr p15, 0, r4, c15, c1, 0
239218

240219
mrc p15, 0, r2, c2, c0, 0
241220
mov r2, r2 @ cpwait
@@ -330,11 +309,9 @@ ENDPROC(iwmmxt_task_restore)
330309
*/
331310
ENTRY(iwmmxt_task_switch)
332311

333-
XSC(mrc p15, 0, r1, c15, c1, 0)
334-
PJ4(mrc p15, 0, r1, c1, c0, 2)
312+
mrc p15, 0, r1, c15, c1, 0
335313
@ CP0 and CP1 accessible?
336-
XSC(tst r1, #0x3)
337-
PJ4(tst r1, #0xf)
314+
tst r1, #0x3
338315
bne 1f @ yes: block them for next task
339316

340317
ldr r2, =concan_owner
@@ -344,10 +321,8 @@ ENTRY(iwmmxt_task_switch)
344321
retne lr @ no: leave Concan disabled
345322

346323
1: @ flip Concan access
347-
XSC(eor r1, r1, #0x3)
348-
XSC(mcr p15, 0, r1, c15, c1, 0)
349-
PJ4(eor r1, r1, #0xf)
350-
PJ4(mcr p15, 0, r1, c1, c0, 2)
324+
eor r1, r1, #0x3
325+
mcr p15, 0, r1, c15, c1, 0
351326

352327
mrc p15, 0, r1, c2, c0, 0
353328
sub pc, lr, r1, lsr #32 @ cpwait and return

arch/arm/kernel/pj4-cp0.c

Lines changed: 0 additions & 135 deletions
This file was deleted.

arch/arm/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
220220
unsigned int fp, mode;
221221
int ok = 1;
222222

223-
printk("%sBacktrace: ", loglvl);
223+
printk("%sCall trace: ", loglvl);
224224

225225
if (!tsk)
226226
tsk = current;

arch/arm/kernel/unwind.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,8 @@ void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk,
524524
{
525525
struct stackframe frame;
526526

527+
printk("%sCall trace: ", loglvl);
528+
527529
pr_debug("%s(regs = %p tsk = %p)\n", __func__, regs, tsk);
528530

529531
if (!tsk)

arch/arm/mm/fault.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525

2626
#include "fault.h"
2727

28+
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
29+
{
30+
unsigned long addr = (unsigned long)unsafe_src;
31+
32+
return addr >= TASK_SIZE && ULONG_MAX - addr >= size;
33+
}
34+
2835
#ifdef CONFIG_MMU
2936

3037
/*
@@ -588,6 +595,7 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs)
588595
if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs))
589596
return;
590597

598+
pr_alert("8<--- cut here ---\n");
591599
pr_alert("Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n",
592600
inf->name, ifsr, addr);
593601

arch/arm/mm/flush.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ void __sync_icache_dcache(pte_t pteval)
296296
return;
297297

298298
folio = page_folio(pfn_to_page(pfn));
299+
if (folio_test_reserved(folio))
300+
return;
301+
299302
if (cache_is_vipt_aliasing())
300303
mapping = folio_flush_mapping(folio);
301304
else

0 commit comments

Comments
 (0)