Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339523
b: refs/heads/master
c: 06c1a12
h: refs/heads/master
i:
  339521: c888cd8
  339519: 63dcdaf
v: v3
  • Loading branch information
Ulf Hansson authored and Russell King committed Oct 18, 2012
1 parent 9b1875a commit bb94343
Show file tree
Hide file tree
Showing 20 changed files with 91 additions and 180 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b10bca0bc699af201770989a88fa293155e9d8de
refs/heads/master: 06c1a121805d7870abbf037d3ccd9a609a5219f2
4 changes: 1 addition & 3 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ config ARM
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select ARCH_HAVE_CUSTOM_GPIO_H
select ARCH_WANT_IPC_PARSE_VERSION
select BUILDTIME_EXTABLE_SORT if MMU
select CPU_PM if (SUSPEND || CPU_IDLE)
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN && MMU
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select GENERIC_IRQ_PROBE
Expand All @@ -22,7 +21,6 @@ config ARM
select HAVE_AOUT
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
select HAVE_ARCH_KGDB
select HAVE_ARCH_SECCOMP_FILTER
select HAVE_ARCH_TRACEHOOK
select HAVE_BPF_JIT
select HAVE_C_RECORDMCOUNT
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ KBUILD_DEFCONFIG := versatile_defconfig
# defines filename extension depending memory management type.
ifeq ($(CONFIG_MMU),)
MMUEXT := -nommu
KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access)
endif

ifeq ($(CONFIG_FRAME_POINTER),y)
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ extern void cpu_die(void);

extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask);

struct smp_operations {
#ifdef CONFIG_SMP
Expand Down
9 changes: 0 additions & 9 deletions trunk/arch/arm/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#ifndef _ASM_ARM_SYSCALL_H
#define _ASM_ARM_SYSCALL_H

#include <linux/audit.h> /* for AUDIT_ARCH_* */
#include <linux/elf.h> /* for ELF_EM */
#include <linux/err.h>
#include <linux/sched.h>

Expand Down Expand Up @@ -97,11 +95,4 @@ static inline void syscall_set_arguments(struct task_struct *task,
memcpy(&regs->ARM_r0 + i, args, n * sizeof(args[0]));
}

static inline int syscall_get_arch(struct task_struct *task,
struct pt_regs *regs)
{
/* ARM tasks don't change audit architectures on the fly. */
return AUDIT_ARCH_ARM;
}

#endif /* _ASM_ARM_SYSCALL_H */
7 changes: 3 additions & 4 deletions trunk/arch/arm/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define TIF_SYSCALL_TRACE 8
#define TIF_SYSCALL_AUDIT 9
#define TIF_SYSCALL_TRACEPOINT 10
#define TIF_SECCOMP 11 /* seccomp syscall filtering active */
#define TIF_USING_IWMMXT 17
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
#define TIF_RESTORE_SIGMASK 20
#define TIF_SECCOMP 21
#define TIF_SWITCH_MM 22 /* deferred switch_mm */

#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
Expand All @@ -163,12 +163,11 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)

/* Checks for any syscall work in entry-common.S */
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
_TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT)

/*
* Change these and you break ASM code in entry-common.S
Expand Down
16 changes: 12 additions & 4 deletions trunk/arch/arm/kernel/entry-common.S
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,16 @@ local_restart:
ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing
stmdb sp!, {r4, r5} @ push fifth and sixth args

#ifdef CONFIG_SECCOMP
tst r10, #_TIF_SECCOMP
beq 1f
mov r0, scno
bl __secure_computing
add r0, sp, #S_R0 + S_OFF @ pointer to regs
ldmia r0, {r0 - r3} @ have to reload r0 - r3
1:
#endif

tst r10, #_TIF_SYSCALL_WORK @ are we tracing syscalls?
bne __sys_trace

Expand Down Expand Up @@ -448,13 +458,11 @@ __sys_trace:
ldmccia r1, {r0 - r6} @ have to reload r0 - r6
stmccia sp, {r4, r5} @ and update the stack args
ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
cmp scno, #-1 @ skip the syscall?
bne 2b
add sp, sp, #S_OFF @ restore stack
b ret_slow_syscall
b 2b

__sys_trace_return:
str r0, [sp, #S_R0 + S_OFF]! @ save returned r0
mov r1, scno
mov r0, sp
bl syscall_trace_exit
b ret_slow_syscall
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/head-nommu.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ __after_proc_init:
* CP15 system control register value returned in r0 from
* the CPU init function.
*/
#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
#ifdef CONFIG_ALIGNMENT_TRAP
orr r0, r0, #CR_A
#else
bic r0, r0, #CR_A
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <linux/leds.h>

#include <asm/cacheflush.h>
#include <asm/idmap.h>
#include <asm/processor.h>
#include <asm/thread_notify.h>
#include <asm/stacktrace.h>
Expand All @@ -57,6 +56,8 @@ static const char *isa_modes[] = {
"ARM" , "Thumb" , "Jazelle", "ThumbEE"
};

extern void setup_mm_for_reboot(void);

static volatile int hlt_counter;

void disable_hlt(void)
Expand All @@ -69,7 +70,6 @@ EXPORT_SYMBOL(disable_hlt);
void enable_hlt(void)
{
hlt_counter--;
BUG_ON(hlt_counter < 0);
}

EXPORT_SYMBOL(enable_hlt);
Expand Down
43 changes: 13 additions & 30 deletions trunk/arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,16 @@ enum ptrace_syscall_dir {
PTRACE_SYSCALL_EXIT,
};

static int tracehook_report_syscall(struct pt_regs *regs,
enum ptrace_syscall_dir dir)
static int ptrace_syscall_trace(struct pt_regs *regs, int scno,
enum ptrace_syscall_dir dir)
{
unsigned long ip;

current_thread_info()->syscall = scno;

if (!test_thread_flag(TIF_SYSCALL_TRACE))
return scno;

/*
* IP is used to denote syscall entry/exit:
* IP = 0 -> entry, =1 -> exit
Expand All @@ -939,41 +944,19 @@ static int tracehook_report_syscall(struct pt_regs *regs,

asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)
{
current_thread_info()->syscall = scno;

/* Do the secure computing check first; failures should be fast. */
if (secure_computing(scno) == -1)
return -1;

if (test_thread_flag(TIF_SYSCALL_TRACE))
scno = tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);

scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER);
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
trace_sys_enter(regs, scno);

audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1,
regs->ARM_r2, regs->ARM_r3);

return scno;
}

asmlinkage void syscall_trace_exit(struct pt_regs *regs)
asmlinkage int syscall_trace_exit(struct pt_regs *regs, int scno)
{
/*
* Audit the syscall before anything else, as a debugger may
* come in and change the current registers.
*/
audit_syscall_exit(regs);

/*
* Note that we haven't updated the ->syscall field for the
* current thread. This isn't a problem because it will have
* been set on syscall entry and there hasn't been an opportunity
* for a PTRACE_SET_SYSCALL since then.
*/
scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT);
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
trace_sys_exit(regs, regs_return_value(regs));

if (test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT);
trace_sys_exit(regs, scno);
audit_syscall_exit(regs);
return scno;
}
5 changes: 0 additions & 5 deletions trunk/arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,6 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
smp_cross_call(mask, IPI_CALL_FUNC);
}

void arch_send_wakeup_ipi_mask(const struct cpumask *mask)
{
smp_cross_call(mask, IPI_WAKEUP);
}

void arch_send_call_function_single_ipi(int cpu)
{
smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE);
Expand Down
54 changes: 15 additions & 39 deletions trunk/arch/arm/kernel/smp_twd.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ static void __iomem *twd_base;

static struct clk *twd_clk;
static unsigned long twd_timer_rate;
static bool common_setup_called;
static DEFINE_PER_CPU(bool, percpu_setup_called);

static struct clock_event_device __percpu **twd_evt;
static int twd_ppi;
Expand Down Expand Up @@ -250,9 +248,17 @@ static struct clk *twd_get_clock(void)
return clk;
}

err = clk_prepare_enable(clk);
err = clk_prepare(clk);
if (err) {
pr_err("smp_twd: clock failed to prepare+enable: %d\n", err);
pr_err("smp_twd: clock failed to prepare: %d\n", err);
clk_put(clk);
return ERR_PTR(err);
}

err = clk_enable(clk);
if (err) {
pr_err("smp_twd: clock failed to enable: %d\n", err);
clk_unprepare(clk);
clk_put(clk);
return ERR_PTR(err);
}
Expand All @@ -266,45 +272,15 @@ static struct clk *twd_get_clock(void)
static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
{
struct clock_event_device **this_cpu_clk;
int cpu = smp_processor_id();

/*
* If the basic setup for this CPU has been done before don't
* bother with the below.
*/
if (per_cpu(percpu_setup_called, cpu)) {
__raw_writel(0, twd_base + TWD_TIMER_CONTROL);
clockevents_register_device(*__this_cpu_ptr(twd_evt));
enable_percpu_irq(clk->irq, 0);
return 0;
}
per_cpu(percpu_setup_called, cpu) = true;

/*
* This stuff only need to be done once for the entire TWD cluster
* during the runtime of the system.
*/
if (!common_setup_called) {
if (!twd_clk)
twd_clk = twd_get_clock();

/*
* We use IS_ERR_OR_NULL() here, because if the clock stubs
* are active we will get a valid clk reference which is
* however NULL and will return the rate 0. In that case we
* need to calibrate the rate instead.
*/
if (!IS_ERR_OR_NULL(twd_clk))
twd_timer_rate = clk_get_rate(twd_clk);
else
twd_calibrate_rate();

common_setup_called = true;
}
if (!IS_ERR_OR_NULL(twd_clk))
twd_timer_rate = clk_get_rate(twd_clk);
else
twd_calibrate_rate();

/*
* The following is done once per CPU the first time .setup() is
* called.
*/
__raw_writel(0, twd_base + TWD_TIMER_CONTROL);

clk->name = "local_timer";
Expand Down
19 changes: 10 additions & 9 deletions trunk/arch/arm/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ SECTIONS

RO_DATA(PAGE_SIZE)

. = ALIGN(4);
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
#ifdef CONFIG_MMU
*(__ex_table)
#endif
__stop___ex_table = .;
}

#ifdef CONFIG_ARM_UNWIND
/*
* Stack unwinding tables
Expand Down Expand Up @@ -228,6 +219,16 @@ SECTIONS
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
READ_MOSTLY_DATA(L1_CACHE_BYTES)

/*
* The exception fixup table (might need resorting at runtime)
*/
. = ALIGN(4);
__start___ex_table = .;
#ifdef CONFIG_MMU
*(__ex_table)
#endif
__stop___ex_table = .;

/*
* and the usual data section
*/
Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/arm/mach-integrator/impd1.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,9 @@ static int impd1_probe(struct lm_device *dev)

pc_base = dev->resource.start + idev->offset;
snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12);
d = amba_ahb_device_add_res(&dev->dev, devname, pc_base, SZ_4K,
dev->irq, dev->irq,
idev->platform_data, idev->id,
&dev->resource);
d = amba_ahb_device_add(&dev->dev, devname, pc_base, SZ_4K,
dev->irq, dev->irq,
idev->platform_data, idev->id);
if (IS_ERR(d)) {
dev_err(&dev->dev, "unable to register device: %ld\n", PTR_ERR(d));
continue;
Expand Down
14 changes: 4 additions & 10 deletions trunk/arch/arm/mm/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ static int __init init_static_idmap(void)
(long long)idmap_start, (long long)idmap_end);
identity_mapping_add(idmap_pgd, idmap_start, idmap_end);

/* Flush L1 for the hardware to see this page table content */
flush_cache_louis();

return 0;
}
early_initcall(init_static_idmap);
Expand All @@ -106,15 +103,12 @@ early_initcall(init_static_idmap);
*/
void setup_mm_for_reboot(void)
{
/* Clean and invalidate L1. */
flush_cache_all();

/* Switch to the identity mapping. */
cpu_switch_mm(idmap_pgd, &init_mm);

#ifdef CONFIG_CPU_HAS_ASID
/*
* We don't have a clean ASID for the identity mapping, which
* may clash with virtual addresses of the previous page tables
* and therefore potentially in the TLB.
*/
/* Flush the TLB. */
local_flush_tlb_all();
#endif
}
2 changes: 1 addition & 1 deletion trunk/arch/arm/mm/proc-v7.S
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ENTRY(cpu_v7_reset)
THUMB( bic r1, r1, #1 << 30 ) @ SCTLR.TE (Thumb exceptions)
mcr p15, 0, r1, c1, c0, 0 @ disable MMU
isb
bx r0
mov pc, r0
ENDPROC(cpu_v7_reset)
.popsection

Expand Down
Loading

0 comments on commit bb94343

Please sign in to comment.