Merge branch 'linus' into perf/core
Merge reason: pick up perf fixes Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -1826,7 +1826,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
|
||||
.cpu_features = CPU_FTRS_47X,
|
||||
.cpu_user_features = COMMON_USER_BOOKE |
|
||||
PPC_FEATURE_HAS_FPU,
|
||||
.cpu_user_features = COMMON_USER_BOOKE,
|
||||
.mmu_features = MMU_FTR_TYPE_47x |
|
||||
MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
|
||||
.icache_bsize = 32,
|
||||
|
@@ -402,6 +402,18 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
|
||||
*/
|
||||
hard_irq_disable();
|
||||
|
||||
/*
|
||||
* Make a note of crashing cpu. Will be used in machine_kexec
|
||||
* such that another IPI will not be sent.
|
||||
*/
|
||||
crashing_cpu = smp_processor_id();
|
||||
crash_save_cpu(regs, crashing_cpu);
|
||||
crash_kexec_prepare_cpus(crashing_cpu);
|
||||
cpu_set(crashing_cpu, cpus_in_crash);
|
||||
#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
|
||||
crash_kexec_wait_realmode(crashing_cpu);
|
||||
#endif
|
||||
|
||||
for_each_irq(i) {
|
||||
struct irq_desc *desc = irq_to_desc(i);
|
||||
|
||||
@@ -438,18 +450,8 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
|
||||
crash_shutdown_cpu = -1;
|
||||
__debugger_fault_handler = old_handler;
|
||||
|
||||
/*
|
||||
* Make a note of crashing cpu. Will be used in machine_kexec
|
||||
* such that another IPI will not be sent.
|
||||
*/
|
||||
crashing_cpu = smp_processor_id();
|
||||
crash_save_cpu(regs, crashing_cpu);
|
||||
crash_kexec_prepare_cpus(crashing_cpu);
|
||||
cpu_set(crashing_cpu, cpus_in_crash);
|
||||
crash_kexec_stop_spus();
|
||||
#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
|
||||
crash_kexec_wait_realmode(crashing_cpu);
|
||||
#endif
|
||||
|
||||
if (ppc_md.kexec_cpu_down)
|
||||
ppc_md.kexec_cpu_down(1, 0);
|
||||
}
|
||||
|
@@ -113,6 +113,10 @@ _ENTRY(_start);
|
||||
stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */
|
||||
stw r6, 0(r5)
|
||||
|
||||
/* Clear the Machine Check Syndrome Register */
|
||||
li r0,0
|
||||
mtspr SPRN_MCSR,r0
|
||||
|
||||
/* Let's move on */
|
||||
lis r4,start_kernel@h
|
||||
ori r4,r4,start_kernel@l
|
||||
|
@@ -572,9 +572,6 @@ __secondary_start:
|
||||
/* Set thread priority to MEDIUM */
|
||||
HMT_MEDIUM
|
||||
|
||||
/* Do early setup for that CPU (stab, slb, hash table pointer) */
|
||||
bl .early_setup_secondary
|
||||
|
||||
/* Initialize the kernel stack. Just a repeat for iSeries. */
|
||||
LOAD_REG_ADDR(r3, current_set)
|
||||
sldi r28,r24,3 /* get current_set[cpu#] */
|
||||
@@ -582,6 +579,9 @@ __secondary_start:
|
||||
addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
|
||||
std r1,PACAKSAVE(r13)
|
||||
|
||||
/* Do early setup for that CPU (stab, slb, hash table pointer) */
|
||||
bl .early_setup_secondary
|
||||
|
||||
/* Clear backchain so we get nice backtraces */
|
||||
li r7,0
|
||||
mtlr r7
|
||||
|
@@ -94,9 +94,9 @@ void cpu_idle(void)
|
||||
HMT_medium();
|
||||
ppc64_runlatch_on();
|
||||
tick_nohz_restart_sched_tick();
|
||||
preempt_enable_no_resched();
|
||||
if (cpu_should_die())
|
||||
cpu_die();
|
||||
preempt_enable_no_resched();
|
||||
schedule();
|
||||
preempt_disable();
|
||||
}
|
||||
|
@@ -67,6 +67,7 @@
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/udbg.h>
|
||||
#include <asm/dbell.h>
|
||||
#include <asm/smp.h>
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
#include <asm/paca.h>
|
||||
@@ -446,22 +447,23 @@ struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly;
|
||||
void exc_lvl_ctx_init(void)
|
||||
{
|
||||
struct thread_info *tp;
|
||||
int i;
|
||||
int i, hw_cpu;
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
memset((void *)critirq_ctx[i], 0, THREAD_SIZE);
|
||||
tp = critirq_ctx[i];
|
||||
hw_cpu = get_hard_smp_processor_id(i);
|
||||
memset((void *)critirq_ctx[hw_cpu], 0, THREAD_SIZE);
|
||||
tp = critirq_ctx[hw_cpu];
|
||||
tp->cpu = i;
|
||||
tp->preempt_count = 0;
|
||||
|
||||
#ifdef CONFIG_BOOKE
|
||||
memset((void *)dbgirq_ctx[i], 0, THREAD_SIZE);
|
||||
tp = dbgirq_ctx[i];
|
||||
memset((void *)dbgirq_ctx[hw_cpu], 0, THREAD_SIZE);
|
||||
tp = dbgirq_ctx[hw_cpu];
|
||||
tp->cpu = i;
|
||||
tp->preempt_count = 0;
|
||||
|
||||
memset((void *)mcheckirq_ctx[i], 0, THREAD_SIZE);
|
||||
tp = mcheckirq_ctx[i];
|
||||
memset((void *)mcheckirq_ctx[hw_cpu], 0, THREAD_SIZE);
|
||||
tp = mcheckirq_ctx[hw_cpu];
|
||||
tp->cpu = i;
|
||||
tp->preempt_count = HARDIRQ_OFFSET;
|
||||
#endif
|
||||
|
@@ -336,7 +336,7 @@ static void __devinit __of_scan_bus(struct device_node *node,
|
||||
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
|
||||
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
|
||||
struct device_node *child = pci_device_to_OF_node(dev);
|
||||
if (dev)
|
||||
if (child)
|
||||
of_scan_pci_bridge(child, dev);
|
||||
}
|
||||
}
|
||||
|
@@ -728,7 +728,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
|
||||
p->thread.regs = childregs;
|
||||
if (clone_flags & CLONE_SETTLS) {
|
||||
#ifdef CONFIG_PPC64
|
||||
if (!test_thread_flag(TIF_32BIT))
|
||||
if (!is_32bit_task())
|
||||
childregs->gpr[13] = childregs->gpr[6];
|
||||
else
|
||||
#endif
|
||||
@@ -823,7 +823,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
|
||||
regs->nip = start;
|
||||
regs->msr = MSR_USER;
|
||||
#else
|
||||
if (!test_thread_flag(TIF_32BIT)) {
|
||||
if (!is_32bit_task()) {
|
||||
unsigned long entry, toc;
|
||||
|
||||
/* start is a relocated pointer to the function descriptor for
|
||||
@@ -995,7 +995,7 @@ int sys_clone(unsigned long clone_flags, unsigned long usp,
|
||||
if (usp == 0)
|
||||
usp = regs->gpr[1]; /* stack pointer for child */
|
||||
#ifdef CONFIG_PPC64
|
||||
if (test_thread_flag(TIF_32BIT)) {
|
||||
if (is_32bit_task()) {
|
||||
parent_tidp = TRUNC_PTR(parent_tidp);
|
||||
child_tidp = TRUNC_PTR(child_tidp);
|
||||
}
|
||||
@@ -1034,8 +1034,9 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
|
||||
flush_fp_to_thread(current);
|
||||
flush_altivec_to_thread(current);
|
||||
flush_spe_to_thread(current);
|
||||
error = do_execve(filename, (char __user * __user *) a1,
|
||||
(char __user * __user *) a2, regs);
|
||||
error = do_execve(filename,
|
||||
(const char __user *const __user *) a1,
|
||||
(const char __user *const __user *) a2, regs);
|
||||
putname(filename);
|
||||
out:
|
||||
return error;
|
||||
@@ -1198,19 +1199,17 @@ void ppc64_runlatch_on(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ppc64_runlatch_off(void)
|
||||
void __ppc64_runlatch_off(void)
|
||||
{
|
||||
unsigned long ctrl;
|
||||
|
||||
if (cpu_has_feature(CPU_FTR_CTRL) && test_thread_flag(TIF_RUNLATCH)) {
|
||||
HMT_medium();
|
||||
HMT_medium();
|
||||
|
||||
clear_thread_flag(TIF_RUNLATCH);
|
||||
clear_thread_flag(TIF_RUNLATCH);
|
||||
|
||||
ctrl = mfspr(SPRN_CTRLF);
|
||||
ctrl &= ~CTRL_RUNLATCH;
|
||||
mtspr(SPRN_CTRLT, ctrl);
|
||||
}
|
||||
ctrl = mfspr(SPRN_CTRLF);
|
||||
ctrl &= ~CTRL_RUNLATCH;
|
||||
mtspr(SPRN_CTRLT, ctrl);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -258,17 +258,18 @@ static void __init irqstack_early_init(void)
|
||||
#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
|
||||
static void __init exc_lvl_early_init(void)
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int i, hw_cpu;
|
||||
|
||||
/* interrupt stacks must be in lowmem, we get that for free on ppc32
|
||||
* as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */
|
||||
for_each_possible_cpu(i) {
|
||||
critirq_ctx[i] = (struct thread_info *)
|
||||
hw_cpu = get_hard_smp_processor_id(i);
|
||||
critirq_ctx[hw_cpu] = (struct thread_info *)
|
||||
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
|
||||
#ifdef CONFIG_BOOKE
|
||||
dbgirq_ctx[i] = (struct thread_info *)
|
||||
dbgirq_ctx[hw_cpu] = (struct thread_info *)
|
||||
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
|
||||
mcheckirq_ctx[i] = (struct thread_info *)
|
||||
mcheckirq_ctx[hw_cpu] = (struct thread_info *)
|
||||
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
|
||||
#endif
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ int ucache_bsize;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
static int smt_enabled_cmdline;
|
||||
static char *smt_enabled_cmdline;
|
||||
|
||||
/* Look for ibm,smt-enabled OF option */
|
||||
static void check_smt_enabled(void)
|
||||
@@ -103,37 +103,46 @@ static void check_smt_enabled(void)
|
||||
struct device_node *dn;
|
||||
const char *smt_option;
|
||||
|
||||
/* Default to enabling all threads */
|
||||
smt_enabled_at_boot = threads_per_core;
|
||||
|
||||
/* Allow the command line to overrule the OF option */
|
||||
if (smt_enabled_cmdline)
|
||||
return;
|
||||
if (smt_enabled_cmdline) {
|
||||
if (!strcmp(smt_enabled_cmdline, "on"))
|
||||
smt_enabled_at_boot = threads_per_core;
|
||||
else if (!strcmp(smt_enabled_cmdline, "off"))
|
||||
smt_enabled_at_boot = 0;
|
||||
else {
|
||||
long smt;
|
||||
int rc;
|
||||
|
||||
dn = of_find_node_by_path("/options");
|
||||
rc = strict_strtol(smt_enabled_cmdline, 10, &smt);
|
||||
if (!rc)
|
||||
smt_enabled_at_boot =
|
||||
min(threads_per_core, (int)smt);
|
||||
}
|
||||
} else {
|
||||
dn = of_find_node_by_path("/options");
|
||||
if (dn) {
|
||||
smt_option = of_get_property(dn, "ibm,smt-enabled",
|
||||
NULL);
|
||||
|
||||
if (dn) {
|
||||
smt_option = of_get_property(dn, "ibm,smt-enabled", NULL);
|
||||
if (smt_option) {
|
||||
if (!strcmp(smt_option, "on"))
|
||||
smt_enabled_at_boot = threads_per_core;
|
||||
else if (!strcmp(smt_option, "off"))
|
||||
smt_enabled_at_boot = 0;
|
||||
}
|
||||
|
||||
if (smt_option) {
|
||||
if (!strcmp(smt_option, "on"))
|
||||
smt_enabled_at_boot = 1;
|
||||
else if (!strcmp(smt_option, "off"))
|
||||
smt_enabled_at_boot = 0;
|
||||
}
|
||||
}
|
||||
of_node_put(dn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Look for smt-enabled= cmdline option */
|
||||
static int __init early_smt_enabled(char *p)
|
||||
{
|
||||
smt_enabled_cmdline = 1;
|
||||
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
if (!strcmp(p, "on") || !strcmp(p, "1"))
|
||||
smt_enabled_at_boot = 1;
|
||||
else if (!strcmp(p, "off") || !strcmp(p, "0"))
|
||||
smt_enabled_at_boot = 0;
|
||||
|
||||
smt_enabled_cmdline = p;
|
||||
return 0;
|
||||
}
|
||||
early_param("smt-enabled", early_smt_enabled);
|
||||
@@ -380,8 +389,8 @@ void __init setup_system(void)
|
||||
*/
|
||||
xmon_setup();
|
||||
|
||||
check_smt_enabled();
|
||||
smp_setup_cpu_maps();
|
||||
check_smt_enabled();
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Release secondary cpus out of their spinloops at 0x60 now that
|
||||
|
@@ -427,11 +427,11 @@ int __cpuinit __cpu_up(unsigned int cpu)
|
||||
#endif
|
||||
|
||||
if (!cpu_callin_map[cpu]) {
|
||||
printk("Processor %u is stuck.\n", cpu);
|
||||
printk(KERN_ERR "Processor %u is stuck.\n", cpu);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
printk("Processor %u found.\n", cpu);
|
||||
DBG("Processor %u found.\n", cpu);
|
||||
|
||||
if (smp_ops->give_timebase)
|
||||
smp_ops->give_timebase();
|
||||
|
@@ -616,3 +616,11 @@ asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
|
||||
|
||||
return sys_sync_file_range(fd, offset, nbytes, flags);
|
||||
}
|
||||
|
||||
asmlinkage long compat_sys_fanotify_mark(int fanotify_fd, unsigned int flags,
|
||||
unsigned mask_hi, unsigned mask_lo,
|
||||
int dfd, const char __user *pathname)
|
||||
{
|
||||
u64 mask = ((u64)mask_hi << 32) | mask_lo;
|
||||
return sys_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname);
|
||||
}
|
||||
|
@@ -1059,7 +1059,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
|
||||
if (!dma_window)
|
||||
return NULL;
|
||||
|
||||
tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
|
||||
tbl = kzalloc(sizeof(*tbl), GFP_KERNEL);
|
||||
if (tbl == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -1072,6 +1072,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
|
||||
tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
|
||||
tbl->it_busno = 0;
|
||||
tbl->it_type = TCE_VB;
|
||||
tbl->it_blocksize = 16;
|
||||
|
||||
return iommu_init_table(tbl, -1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user