Skip to content

Commit ede1d63

Browse files
committed
Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull second set of ARM changes from Russell King: "This is the remainder of the ARM changes for this merge window. Included in this request are: - fixes for kprobes for big-endian support - fix tracing in soft_restart - avoid phys address overflow in kdump code - fix reporting of read-only pmd bits in kernel page table dump - remove unnecessary (and possibly buggy) call to outer_flush_all() - fix a three sparse warnings (missing header file for function prototypes) - fix pj4 crashing single zImage (thanks to arm-soc merging changes which enables this with knowledge that the corresponding fix had not even been submitted for my tree before the merge window opened) - vfp macro cleanups - dump register state on undefined instruction userspace faults when debugging" * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: Dump the registers on undefined instruction userspace faults ARM: 8018/1: Add {inc,dec}_preempt_count asm macros ARM: 8017/1: Move asm macro get_thread_info to asm/assembler.h ARM: 8016/1: Check cpu id in pj4_cp0_init. ARM: 8015/1: Add cpu_is_pj4 to distinguish PJ4 because it has some differences with V7 ARM: add missing system_misc.h include to process.c ARM: 8009/1: dcscb.c: remove call to outer_flush_all() ARM: 8014/1: mm: fix reporting of read-only PMD bits ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr ARM: 8010/1: avoid tracers in soft_restart ARM: kprobes-test: Workaround GAS .align bug ARM: kprobes-test: use <asm/opcodes.h> for Thumb instruction building ARM: kprobes-test: use <asm/opcodes.h> for ARM instruction building ARM: kprobes-test: use <asm/opcodes.h> for instruction accesses ARM: probes: fix instruction fetch order with <asm/opcodes.h>
2 parents b42e6dc + 98f0701 commit ede1d63

19 files changed

Lines changed: 685 additions & 614 deletions

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <asm/ptrace.h>
2424
#include <asm/domain.h>
2525
#include <asm/opcodes-virt.h>
26+
#include <asm/asm-offsets.h>
2627

2728
#define IOMEM(x) (x)
2829

@@ -174,6 +175,47 @@
174175
restore_irqs_notrace \oldcpsr
175176
.endm
176177

178+
/*
179+
* Get current thread_info.
180+
*/
181+
.macro get_thread_info, rd
182+
ARM( mov \rd, sp, lsr #13 )
183+
THUMB( mov \rd, sp )
184+
THUMB( lsr \rd, \rd, #13 )
185+
mov \rd, \rd, lsl #13
186+
.endm
187+
188+
/*
189+
* Increment/decrement the preempt count.
190+
*/
191+
#ifdef CONFIG_PREEMPT_COUNT
192+
.macro inc_preempt_count, ti, tmp
193+
ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
194+
add \tmp, \tmp, #1 @ increment it
195+
str \tmp, [\ti, #TI_PREEMPT]
196+
.endm
197+
198+
.macro dec_preempt_count, ti, tmp
199+
ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
200+
sub \tmp, \tmp, #1 @ decrement it
201+
str \tmp, [\ti, #TI_PREEMPT]
202+
.endm
203+
204+
.macro dec_preempt_count_ti, ti, tmp
205+
get_thread_info \ti
206+
dec_preempt_count \ti, \tmp
207+
.endm
208+
#else
209+
.macro inc_preempt_count, ti, tmp
210+
.endm
211+
212+
.macro dec_preempt_count, ti, tmp
213+
.endm
214+
215+
.macro dec_preempt_count_ti, ti, tmp
216+
.endm
217+
#endif
218+
177219
#define USER(x...) \
178220
9999: x; \
179221
.pushsection __ex_table,"a"; \

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,23 @@ static inline int cpu_is_xsc3(void)
221221
#define cpu_is_xscale() 1
222222
#endif
223223

224+
/*
225+
* Marvell's PJ4 core is based on V7 version. It has some modification
226+
* for coprocessor setting. For this reason, we need a way to distinguish
227+
* it.
228+
*/
229+
#ifndef CONFIG_CPU_PJ4
230+
#define cpu_is_pj4() 0
231+
#else
232+
static inline int cpu_is_pj4(void)
233+
{
234+
unsigned int id;
235+
236+
id = read_cpuid_id();
237+
if ((id & 0xfffffff0) == 0x562f5840)
238+
return 1;
239+
240+
return 0;
241+
}
242+
#endif
224243
#endif

‎arch/arm/kernel/crash_dump.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
3939
if (!csize)
4040
return 0;
4141

42-
vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
42+
vaddr = ioremap(__pfn_to_phys(pfn), PAGE_SIZE);
4343
if (!vaddr)
4444
return -ENOMEM;
4545

‎arch/arm/kernel/entry-header.S‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,6 @@
236236
movs pc, lr @ return & move spsr_svc into cpsr
237237
.endm
238238

239-
.macro get_thread_info, rd
240-
mov \rd, sp, lsr #13
241-
mov \rd, \rd, lsl #13
242-
.endm
243-
244239
@
245240
@ 32-bit wide "mov pc, reg"
246241
@
@@ -306,12 +301,6 @@
306301
.endm
307302
#endif /* ifdef CONFIG_CPU_V7M / else */
308303

309-
.macro get_thread_info, rd
310-
mov \rd, sp
311-
lsr \rd, \rd, #13
312-
mov \rd, \rd, lsl #13
313-
.endm
314-
315304
@
316305
@ 32-bit wide "mov pc, reg"
317306
@

‎arch/arm/kernel/kprobes-common.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <linux/kernel.h>
1515
#include <linux/kprobes.h>
16+
#include <asm/opcodes.h>
1617

1718
#include "kprobes.h"
1819

@@ -153,7 +154,8 @@ kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_probes_insn *asi,
153154

154155
if (handler) {
155156
/* We can emulate the instruction in (possibly) modified form */
156-
asi->insn[0] = (insn & 0xfff00000) | (rn << 16) | reglist;
157+
asi->insn[0] = __opcode_to_mem_arm((insn & 0xfff00000) |
158+
(rn << 16) | reglist);
157159
asi->insn_handler = handler;
158160
return INSN_GOOD;
159161
}

0 commit comments

Comments
 (0)