Skip to content

Commit df9ab97

Browse files
author
Russell King
committed
Merge branch 'devel-stable' into for-next
2 parents ed8f8ce + 4e1c066 commit df9ab97

File tree

290 files changed

+3777
-2664
lines changed

Some content is hidden

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

290 files changed

+3777
-2664
lines changed

Documentation/devicetree/bindings/input/gpio-keys.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ Optional properties:
1010
Each button (key) is represented as a sub-node of "gpio-keys":
1111
Subnode properties:
1212

13+
- gpios: OF device-tree gpio specification.
14+
- interrupts: the interrupt line for that input.
1315
- label: Descriptive name of the key.
1416
- linux,code: Keycode to emit.
1517

16-
Required mutual exclusive subnode-properties:
17-
- gpios: OF device-tree gpio specification.
18-
- interrupts: the interrupt line for that input
18+
Note that either "interrupts" or "gpios" properties can be omitted, but not
19+
both at the same time. Specifying both properties is allowed.
1920

2021
Optional subnode-properties:
2122
- linux,input-type: Specify event type this button/key generates.
2223
If not specified defaults to <1> == EV_KEY.
2324
- debounce-interval: Debouncing interval time in milliseconds.
2425
If not specified defaults to 5.
2526
- gpio-key,wakeup: Boolean, button can wake-up the system.
27+
- linux,can-disable: Boolean, indicates that button is connected
28+
to dedicated (not shared) interrupt which can be disabled to
29+
suppress events from the button.
2630

2731
Example nodes:
2832

Documentation/devicetree/bindings/input/stmpe-keypad.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Optional properties:
88
- debounce-interval : Debouncing interval time in milliseconds
99
- st,scan-count : Scanning cycles elapsed before key data is updated
1010
- st,no-autorepeat : If specified device will not autorepeat
11+
- keypad,num-rows : See ./matrix-keymap.txt
12+
- keypad,num-columns : See ./matrix-keymap.txt
1113

1214
Example:
1315

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION = 3
22
PATCHLEVEL = 19
33
SUBLEVEL = 0
4-
EXTRAVERSION = -rc1
4+
EXTRAVERSION = -rc3
55
NAME = Diseased Newt
66

77
# *DOCUMENTATION*

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ config ARM
6161
select HAVE_MEMBLOCK
6262
select HAVE_MOD_ARCH_SPECIFIC if ARM_UNWIND
6363
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
64+
select HAVE_OPTPROBES if !THUMB2_KERNEL
6465
select HAVE_PERF_EVENTS
6566
select HAVE_PERF_REGS
6667
select HAVE_PERF_USER_STACK_DUMP

arch/arm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
266266

267267
# If we have a machine-specific directory, then include it in the build.
268268
core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
269+
core-y += arch/arm/probes/
269270
core-y += arch/arm/net/
270271
core-y += arch/arm/crypto/
271272
core-y += arch/arm/firmware/

arch/arm/boot/dts/armada-370-db.dts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -203,27 +203,3 @@
203203
compatible = "linux,spdif-dir";
204204
};
205205
};
206-
207-
&pinctrl {
208-
/*
209-
* These pins might be muxed as I2S by
210-
* the bootloader, but it conflicts
211-
* with the real I2S pins that are
212-
* muxed using i2s_pins. We must mux
213-
* those pins to a function other than
214-
* I2S.
215-
*/
216-
pinctrl-0 = <&hog_pins1 &hog_pins2>;
217-
pinctrl-names = "default";
218-
219-
hog_pins1: hog-pins1 {
220-
marvell,pins = "mpp6", "mpp8", "mpp10",
221-
"mpp12", "mpp13";
222-
marvell,function = "gpio";
223-
};
224-
225-
hog_pins2: hog-pins2 {
226-
marvell,pins = "mpp5", "mpp7", "mpp9";
227-
marvell,function = "gpo";
228-
};
229-
};

arch/arm/configs/multi_v7_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ CONFIG_USB=y
338338
CONFIG_USB_XHCI_HCD=y
339339
CONFIG_USB_XHCI_MVEBU=y
340340
CONFIG_USB_EHCI_HCD=y
341+
CONFIG_USB_EHCI_EXYNOS=y
341342
CONFIG_USB_EHCI_TEGRA=y
342343
CONFIG_USB_EHCI_HCD_STI=y
343344
CONFIG_USB_EHCI_HCD_PLATFORM=y
File renamed without changes.

arch/arm/include/asm/kprobes.h

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#define __ARCH_WANT_KPROBES_INSN_SLOT
2424
#define MAX_INSN_SIZE 2
25-
#define MAX_STACK_SIZE 64 /* 32 would probably be OK */
2625

2726
#define flush_insn_slot(p) do { } while (0)
2827
#define kretprobe_blacklist_size 0
@@ -51,5 +50,37 @@ int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
5150
int kprobe_exceptions_notify(struct notifier_block *self,
5251
unsigned long val, void *data);
5352

53+
/* optinsn template addresses */
54+
extern __visible kprobe_opcode_t optprobe_template_entry;
55+
extern __visible kprobe_opcode_t optprobe_template_val;
56+
extern __visible kprobe_opcode_t optprobe_template_call;
57+
extern __visible kprobe_opcode_t optprobe_template_end;
58+
extern __visible kprobe_opcode_t optprobe_template_sub_sp;
59+
extern __visible kprobe_opcode_t optprobe_template_add_sp;
60+
extern __visible kprobe_opcode_t optprobe_template_restore_begin;
61+
extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn;
62+
extern __visible kprobe_opcode_t optprobe_template_restore_end;
63+
64+
#define MAX_OPTIMIZED_LENGTH 4
65+
#define MAX_OPTINSN_SIZE \
66+
((unsigned long)&optprobe_template_end - \
67+
(unsigned long)&optprobe_template_entry)
68+
#define RELATIVEJUMP_SIZE 4
69+
70+
struct arch_optimized_insn {
71+
/*
72+
* copy of the original instructions.
73+
* Different from x86, ARM kprobe_opcode_t is u32.
74+
*/
75+
#define MAX_COPIED_INSN DIV_ROUND_UP(RELATIVEJUMP_SIZE, sizeof(kprobe_opcode_t))
76+
kprobe_opcode_t copied_insn[MAX_COPIED_INSN];
77+
/* detour code buffer */
78+
kprobe_opcode_t *insn;
79+
/*
80+
* We always copy one instruction on ARM,
81+
* so size will always be 4, and unlike x86, there is no
82+
* need for a size field.
83+
*/
84+
};
5485

5586
#endif /* _ARM_KPROBES_H */
File renamed without changes.

arch/arm/include/asm/probes.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef _ASM_PROBES_H
2020
#define _ASM_PROBES_H
2121

22+
#ifndef __ASSEMBLY__
23+
2224
typedef u32 probes_opcode_t;
2325

2426
struct arch_probes_insn;
@@ -38,6 +40,19 @@ struct arch_probes_insn {
3840
probes_check_cc *insn_check_cc;
3941
probes_insn_singlestep_t *insn_singlestep;
4042
probes_insn_fn_t *insn_fn;
43+
int stack_space;
44+
unsigned long register_usage_flags;
45+
bool kprobe_direct_exec;
4146
};
4247

48+
#endif /* __ASSEMBLY__ */
49+
50+
/*
51+
* We assume one instruction can consume at most 64 bytes stack, which is
52+
* 'push {r0-r15}'. Instructions consume more or unknown stack space like
53+
* 'str r0, [sp, #-80]' and 'str r0, [sp, r1]' should be prohibit to probe.
54+
* Both kprobe and jprobe use this macro.
55+
*/
56+
#define MAX_STACK_SIZE 64
57+
4358
#endif

arch/arm/kernel/Makefile

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,8 @@ obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o
5151
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o
5252
obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o
5353
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
54-
obj-$(CONFIG_UPROBES) += probes.o probes-arm.o uprobes.o uprobes-arm.o
55-
obj-$(CONFIG_KPROBES) += probes.o kprobes.o kprobes-common.o patch.o
56-
ifdef CONFIG_THUMB2_KERNEL
57-
obj-$(CONFIG_KPROBES) += kprobes-thumb.o probes-thumb.o
58-
else
59-
obj-$(CONFIG_KPROBES) += kprobes-arm.o probes-arm.o
60-
endif
61-
obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o
62-
test-kprobes-objs := kprobes-test.o
63-
ifdef CONFIG_THUMB2_KERNEL
64-
test-kprobes-objs += kprobes-test-thumb.o
65-
else
66-
test-kprobes-objs += kprobes-test-arm.o
67-
endif
54+
# Main staffs in KPROBES are in arch/arm/probes/ .
55+
obj-$(CONFIG_KPROBES) += patch.o insn.o
6856
obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
6957
obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
7058
obj-$(CONFIG_KGDB) += kgdb.o patch.o

arch/arm/kernel/entry-armv.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "entry-header.S"
3333
#include <asm/entry-macro-multi.S>
34+
#include <asm/probes.h>
3435

3536
/*
3637
* Interrupt handling.
@@ -249,7 +250,7 @@ __und_svc:
249250
@ If a kprobe is about to simulate a "stmdb sp..." instruction,
250251
@ it obviously needs free stack space which then will belong to
251252
@ the saved context.
252-
svc_entry 64
253+
svc_entry MAX_STACK_SIZE
253254
#else
254255
svc_entry
255256
#endif

arch/arm/kernel/ftrace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
#include <asm/cacheflush.h>
2121
#include <asm/opcodes.h>
2222
#include <asm/ftrace.h>
23-
24-
#include "insn.h"
23+
#include <asm/insn.h>
2524

2625
#ifdef CONFIG_THUMB2_KERNEL
2726
#define NOP 0xf85deb04 /* pop.w {lr} */

arch/arm/kernel/jump_label.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#include <linux/kernel.h>
22
#include <linux/jump_label.h>
3-
4-
#include "insn.h"
5-
#include "patch.h"
3+
#include <asm/patch.h>
4+
#include <asm/insn.h>
65

76
#ifdef HAVE_JUMP_LABEL
87

arch/arm/kernel/kgdb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
#include <linux/kgdb.h>
1515
#include <linux/uaccess.h>
1616

17+
#include <asm/patch.h>
1718
#include <asm/traps.h>
1819

19-
#include "patch.h"
20-
2120
struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] =
2221
{
2322
{ "r0", 4, offsetof(struct pt_regs, ARM_r0)},

arch/arm/kernel/patch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#include <asm/fixmap.h>
99
#include <asm/smp_plat.h>
1010
#include <asm/opcodes.h>
11-
12-
#include "patch.h"
11+
#include <asm/patch.h>
1312

1413
struct patch {
1514
void *addr;

arch/arm/kernel/setup.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,15 @@ static int c_show(struct seq_file *m, void *v)
10491049
seq_printf(m, "model name\t: %s rev %d (%s)\n",
10501050
cpu_name, cpuid & 15, elf_platform);
10511051

1052+
#if defined(CONFIG_SMP)
1053+
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
1054+
per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
1055+
(per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
1056+
#else
1057+
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
1058+
loops_per_jiffy / (500000/HZ),
1059+
(loops_per_jiffy / (5000/HZ)) % 100);
1060+
#endif
10521061
/* dump out the processor features */
10531062
seq_puts(m, "Features\t: ");
10541063

arch/arm/kernel/smp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ asmlinkage void secondary_start_kernel(void)
387387

388388
void __init smp_cpus_done(unsigned int max_cpus)
389389
{
390+
int cpu;
391+
unsigned long bogosum = 0;
392+
393+
for_each_online_cpu(cpu)
394+
bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
395+
396+
printk(KERN_INFO "SMP: Total of %d processors activated "
397+
"(%lu.%02lu BogoMIPS).\n",
398+
num_online_cpus(),
399+
bogosum / (500000/HZ),
400+
(bogosum / (5000/HZ)) % 100);
401+
390402
hyp_mode_check();
391403
}
392404

arch/arm/probes/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
obj-$(CONFIG_UPROBES) += decode.o decode-arm.o uprobes/
2+
obj-$(CONFIG_KPROBES) += decode.o kprobes/
3+
ifdef CONFIG_THUMB2_KERNEL
4+
obj-$(CONFIG_KPROBES) += decode-thumb.o
5+
else
6+
obj-$(CONFIG_KPROBES) += decode-arm.o
7+
endif

arch/arm/kernel/probes-arm.c renamed to arch/arm/probes/decode-arm.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* arch/arm/kernel/probes-arm.c
2+
*
3+
* arch/arm/probes/decode-arm.c
34
*
45
* Some code moved here from arch/arm/kernel/kprobes-arm.c
56
*
@@ -20,8 +21,8 @@
2021
#include <linux/stddef.h>
2122
#include <linux/ptrace.h>
2223

23-
#include "probes.h"
24-
#include "probes-arm.h"
24+
#include "decode.h"
25+
#include "decode-arm.h"
2526

2627
#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
2728

@@ -369,17 +370,17 @@ static const union decode_item arm_cccc_001x_table[] = {
369370

370371
/* MOVW cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */
371372
/* MOVT cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */
372-
DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_DATA_PROCESSING_IMM,
373+
DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_MOV_HALFWORD,
373374
REGS(0, NOPC, 0, 0, 0)),
374375

375376
/* YIELD cccc 0011 0010 0000 xxxx xxxx 0000 0001 */
376377
DECODE_OR (0x0fff00ff, 0x03200001),
377378
/* SEV cccc 0011 0010 0000 xxxx xxxx 0000 0100 */
378-
DECODE_EMULATE (0x0fff00ff, 0x03200004, PROBES_EMULATE_NONE),
379+
DECODE_EMULATE (0x0fff00ff, 0x03200004, PROBES_SEV),
379380
/* NOP cccc 0011 0010 0000 xxxx xxxx 0000 0000 */
380381
/* WFE cccc 0011 0010 0000 xxxx xxxx 0000 0010 */
381382
/* WFI cccc 0011 0010 0000 xxxx xxxx 0000 0011 */
382-
DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_SIMULATE_NOP),
383+
DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_WFE),
383384
/* DBG cccc 0011 0010 0000 xxxx xxxx ffff xxxx */
384385
/* unallocated hints cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */
385386
/* MSR (immediate) cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx */
@@ -725,10 +726,11 @@ static void __kprobes arm_singlestep(probes_opcode_t insn,
725726
*/
726727
enum probes_insn __kprobes
727728
arm_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
728-
bool emulate, const union decode_action *actions)
729+
bool emulate, const union decode_action *actions,
730+
const struct decode_checker *checkers[])
729731
{
730732
asi->insn_singlestep = arm_singlestep;
731733
asi->insn_check_cc = probes_condition_checks[insn>>28];
732734
return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
733-
emulate, actions);
735+
emulate, actions, checkers);
734736
}

arch/arm/kernel/probes-arm.h renamed to arch/arm/probes/decode-arm.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* arch/arm/kernel/probes-arm.h
2+
* arch/arm/probes/decode-arm.h
33
*
44
* Copyright 2013 Linaro Ltd.
55
* Written by: David A. Long
@@ -15,9 +15,9 @@
1515
#ifndef _ARM_KERNEL_PROBES_ARM_H
1616
#define _ARM_KERNEL_PROBES_ARM_H
1717

18+
#include "decode.h"
19+
1820
enum probes_arm_action {
19-
PROBES_EMULATE_NONE,
20-
PROBES_SIMULATE_NOP,
2121
PROBES_PRELOAD_IMM,
2222
PROBES_PRELOAD_REG,
2323
PROBES_BRANCH_IMM,
@@ -68,6 +68,7 @@ extern const union decode_item probes_decode_arm_table[];
6868

6969
enum probes_insn arm_probes_decode_insn(probes_opcode_t,
7070
struct arch_probes_insn *, bool emulate,
71-
const union decode_action *actions);
71+
const union decode_action *actions,
72+
const struct decode_checker *checkers[]);
7273

7374
#endif

0 commit comments

Comments
 (0)