Merge branch 'x86/cleanups' into x86/signal
Conflicts: arch/x86/kernel/signal_64.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -137,14 +137,15 @@ relocated:
|
|||||||
*/
|
*/
|
||||||
movl output_len(%ebx), %eax
|
movl output_len(%ebx), %eax
|
||||||
pushl %eax
|
pushl %eax
|
||||||
|
# push arguments for decompress_kernel:
|
||||||
pushl %ebp # output address
|
pushl %ebp # output address
|
||||||
movl input_len(%ebx), %eax
|
movl input_len(%ebx), %eax
|
||||||
pushl %eax # input_len
|
pushl %eax # input_len
|
||||||
leal input_data(%ebx), %eax
|
leal input_data(%ebx), %eax
|
||||||
pushl %eax # input_data
|
pushl %eax # input_data
|
||||||
leal boot_heap(%ebx), %eax
|
leal boot_heap(%ebx), %eax
|
||||||
pushl %eax # heap area as third argument
|
pushl %eax # heap area
|
||||||
pushl %esi # real mode pointer as second arg
|
pushl %esi # real mode pointer
|
||||||
call decompress_kernel
|
call decompress_kernel
|
||||||
addl $20, %esp
|
addl $20, %esp
|
||||||
popl %ecx
|
popl %ecx
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <linux/linkage.h>
|
#include <linux/linkage.h>
|
||||||
#include <linux/screen_info.h>
|
#include <linux/screen_info.h>
|
||||||
#include <linux/elf.h>
|
#include <linux/elf.h>
|
||||||
#include <asm/io.h>
|
#include <linux/io.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#include <asm/boot.h>
|
#include <asm/boot.h>
|
||||||
#include <asm/bootparam.h>
|
#include <asm/bootparam.h>
|
||||||
@@ -277,7 +277,8 @@ static void *memset(void *s, int c, unsigned n)
|
|||||||
int i;
|
int i;
|
||||||
char *ss = s;
|
char *ss = s;
|
||||||
|
|
||||||
for (i = 0; i < n; i++) ss[i] = c;
|
for (i = 0; i < n; i++)
|
||||||
|
ss[i] = c;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +288,8 @@ static void *memcpy(void *dest, const void *src, unsigned n)
|
|||||||
const char *s = src;
|
const char *s = src;
|
||||||
char *d = dest;
|
char *d = dest;
|
||||||
|
|
||||||
for (i = 0; i < n; i++) d[i] = s[i];
|
for (i = 0; i < n; i++)
|
||||||
|
d[i] = s[i];
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,8 +85,10 @@ static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
|
|||||||
dump->regs.ax = regs->ax;
|
dump->regs.ax = regs->ax;
|
||||||
dump->regs.ds = current->thread.ds;
|
dump->regs.ds = current->thread.ds;
|
||||||
dump->regs.es = current->thread.es;
|
dump->regs.es = current->thread.es;
|
||||||
asm("movl %%fs,%0" : "=r" (fs)); dump->regs.fs = fs;
|
savesegment(fs, fs);
|
||||||
asm("movl %%gs,%0" : "=r" (gs)); dump->regs.gs = gs;
|
dump->regs.fs = fs;
|
||||||
|
savesegment(gs, gs);
|
||||||
|
dump->regs.gs = gs;
|
||||||
dump->regs.orig_ax = regs->orig_ax;
|
dump->regs.orig_ax = regs->orig_ax;
|
||||||
dump->regs.ip = regs->ip;
|
dump->regs.ip = regs->ip;
|
||||||
dump->regs.cs = regs->cs;
|
dump->regs.cs = regs->cs;
|
||||||
@@ -430,8 +432,9 @@ beyond_if:
|
|||||||
current->mm->start_stack =
|
current->mm->start_stack =
|
||||||
(unsigned long)create_aout_tables((char __user *)bprm->p, bprm);
|
(unsigned long)create_aout_tables((char __user *)bprm->p, bprm);
|
||||||
/* start thread */
|
/* start thread */
|
||||||
asm volatile("movl %0,%%fs" :: "r" (0)); \
|
loadsegment(fs, 0);
|
||||||
asm volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS));
|
loadsegment(ds, __USER32_DS);
|
||||||
|
loadsegment(es, __USER32_DS);
|
||||||
load_gs_index(0);
|
load_gs_index(0);
|
||||||
(regs)->ip = ex.a_entry;
|
(regs)->ip = ex.a_entry;
|
||||||
(regs)->sp = current->mm->start_stack;
|
(regs)->sp = current->mm->start_stack;
|
||||||
|
@@ -207,7 +207,7 @@ struct rt_sigframe
|
|||||||
{ unsigned int cur; \
|
{ unsigned int cur; \
|
||||||
unsigned short pre; \
|
unsigned short pre; \
|
||||||
err |= __get_user(pre, &sc->seg); \
|
err |= __get_user(pre, &sc->seg); \
|
||||||
asm volatile("movl %%" #seg ",%0" : "=r" (cur)); \
|
savesegment(seg, cur); \
|
||||||
pre |= mask; \
|
pre |= mask; \
|
||||||
if (pre != cur) loadsegment(seg, pre); }
|
if (pre != cur) loadsegment(seg, pre); }
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
|
|||||||
*/
|
*/
|
||||||
err |= __get_user(gs, &sc->gs);
|
err |= __get_user(gs, &sc->gs);
|
||||||
gs |= 3;
|
gs |= 3;
|
||||||
asm("movl %%gs,%0" : "=r" (oldgs));
|
savesegment(gs, oldgs);
|
||||||
if (gs != oldgs)
|
if (gs != oldgs)
|
||||||
load_gs_index(gs);
|
load_gs_index(gs);
|
||||||
|
|
||||||
@@ -342,14 +342,13 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
|
|||||||
{
|
{
|
||||||
int tmp, err = 0;
|
int tmp, err = 0;
|
||||||
|
|
||||||
tmp = 0;
|
savesegment(gs, tmp);
|
||||||
__asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp));
|
|
||||||
err |= __put_user(tmp, (unsigned int __user *)&sc->gs);
|
err |= __put_user(tmp, (unsigned int __user *)&sc->gs);
|
||||||
__asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp));
|
savesegment(fs, tmp);
|
||||||
err |= __put_user(tmp, (unsigned int __user *)&sc->fs);
|
err |= __put_user(tmp, (unsigned int __user *)&sc->fs);
|
||||||
__asm__("movl %%ds,%0" : "=r"(tmp): "0"(tmp));
|
savesegment(ds, tmp);
|
||||||
err |= __put_user(tmp, (unsigned int __user *)&sc->ds);
|
err |= __put_user(tmp, (unsigned int __user *)&sc->ds);
|
||||||
__asm__("movl %%es,%0" : "=r"(tmp): "0"(tmp));
|
savesegment(es, tmp);
|
||||||
err |= __put_user(tmp, (unsigned int __user *)&sc->es);
|
err |= __put_user(tmp, (unsigned int __user *)&sc->es);
|
||||||
|
|
||||||
err |= __put_user((u32)regs->di, &sc->di);
|
err |= __put_user((u32)regs->di, &sc->di);
|
||||||
@@ -491,8 +490,8 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
|
|||||||
regs->dx = 0;
|
regs->dx = 0;
|
||||||
regs->cx = 0;
|
regs->cx = 0;
|
||||||
|
|
||||||
asm volatile("movl %0,%%ds" :: "r" (__USER32_DS));
|
loadsegment(ds, __USER32_DS);
|
||||||
asm volatile("movl %0,%%es" :: "r" (__USER32_DS));
|
loadsegment(es, __USER32_DS);
|
||||||
|
|
||||||
regs->cs = __USER32_CS;
|
regs->cs = __USER32_CS;
|
||||||
regs->ss = __USER32_DS;
|
regs->ss = __USER32_DS;
|
||||||
@@ -588,8 +587,8 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
|||||||
regs->dx = (unsigned long) &frame->info;
|
regs->dx = (unsigned long) &frame->info;
|
||||||
regs->cx = (unsigned long) &frame->uc;
|
regs->cx = (unsigned long) &frame->uc;
|
||||||
|
|
||||||
asm volatile("movl %0,%%ds" :: "r" (__USER32_DS));
|
loadsegment(ds, __USER32_DS);
|
||||||
asm volatile("movl %0,%%es" :: "r" (__USER32_DS));
|
loadsegment(es, __USER32_DS);
|
||||||
|
|
||||||
regs->cs = __USER32_CS;
|
regs->cs = __USER32_CS;
|
||||||
regs->ss = __USER32_DS;
|
regs->ss = __USER32_DS;
|
||||||
|
@@ -58,7 +58,6 @@ EXPORT_SYMBOL(acpi_disabled);
|
|||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
|
|
||||||
#include <asm/proto.h>
|
#include <asm/proto.h>
|
||||||
#include <asm/genapic.h>
|
|
||||||
|
|
||||||
#else /* X86 */
|
#else /* X86 */
|
||||||
|
|
||||||
@@ -97,8 +96,6 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
|
|||||||
#warning ACPI uses CMPXCHG, i486 and later hardware
|
#warning ACPI uses CMPXCHG, i486 and later hardware
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int acpi_mcfg_64bit_base_addr __initdata = FALSE;
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------
|
||||||
Boot-time Configuration
|
Boot-time Configuration
|
||||||
-------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------- */
|
||||||
@@ -160,6 +157,8 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
|
|||||||
struct acpi_mcfg_allocation *pci_mmcfg_config;
|
struct acpi_mcfg_allocation *pci_mmcfg_config;
|
||||||
int pci_mmcfg_config_num;
|
int pci_mmcfg_config_num;
|
||||||
|
|
||||||
|
static int acpi_mcfg_64bit_base_addr __initdata = FALSE;
|
||||||
|
|
||||||
static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg)
|
static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg)
|
||||||
{
|
{
|
||||||
if (!strcmp(mcfg->header.oem_id, "SGI"))
|
if (!strcmp(mcfg->header.oem_id, "SGI"))
|
||||||
|
@@ -228,7 +228,6 @@
|
|||||||
#include <linux/suspend.h>
|
#include <linux/suspend.h>
|
||||||
#include <linux/kthread.h>
|
#include <linux/kthread.h>
|
||||||
#include <linux/jiffies.h>
|
#include <linux/jiffies.h>
|
||||||
#include <linux/smp_lock.h>
|
|
||||||
|
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#include <linux/smp_lock.h>
|
#include <linux/smp_lock.h>
|
||||||
#include <linux/major.h>
|
#include <linux/major.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/smp_lock.h>
|
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/cpu.h>
|
#include <linux/cpu.h>
|
||||||
#include <linux/notifier.h>
|
#include <linux/notifier.h>
|
||||||
|
@@ -7,9 +7,8 @@
|
|||||||
|
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/crash_dump.h>
|
#include <linux/crash_dump.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
#include <asm/uaccess.h>
|
#include <linux/io.h>
|
||||||
#include <asm/io.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* copy_oldmem_page - copy one page from "oldmem"
|
* copy_oldmem_page - copy one page from "oldmem"
|
||||||
|
@@ -325,7 +325,7 @@ skip:
|
|||||||
for_each_online_cpu(j)
|
for_each_online_cpu(j)
|
||||||
seq_printf(p, "%10u ",
|
seq_printf(p, "%10u ",
|
||||||
per_cpu(irq_stat,j).irq_call_count);
|
per_cpu(irq_stat,j).irq_call_count);
|
||||||
seq_printf(p, " function call interrupts\n");
|
seq_printf(p, " Function call interrupts\n");
|
||||||
seq_printf(p, "TLB: ");
|
seq_printf(p, "TLB: ");
|
||||||
for_each_online_cpu(j)
|
for_each_online_cpu(j)
|
||||||
seq_printf(p, "%10u ",
|
seq_printf(p, "%10u ",
|
||||||
|
@@ -129,7 +129,7 @@ skip:
|
|||||||
seq_printf(p, "CAL: ");
|
seq_printf(p, "CAL: ");
|
||||||
for_each_online_cpu(j)
|
for_each_online_cpu(j)
|
||||||
seq_printf(p, "%10u ", cpu_pda(j)->irq_call_count);
|
seq_printf(p, "%10u ", cpu_pda(j)->irq_call_count);
|
||||||
seq_printf(p, " function call interrupts\n");
|
seq_printf(p, " Function call interrupts\n");
|
||||||
seq_printf(p, "TLB: ");
|
seq_printf(p, "TLB: ");
|
||||||
for_each_online_cpu(j)
|
for_each_online_cpu(j)
|
||||||
seq_printf(p, "%10u ", cpu_pda(j)->irq_tlb_count);
|
seq_printf(p, "%10u ", cpu_pda(j)->irq_tlb_count);
|
||||||
|
@@ -82,7 +82,7 @@ void __init dma32_reserve_bootmem(void)
|
|||||||
* using 512M as goal
|
* using 512M as goal
|
||||||
*/
|
*/
|
||||||
align = 64ULL<<20;
|
align = 64ULL<<20;
|
||||||
size = round_up(dma32_bootmem_size, align);
|
size = roundup(dma32_bootmem_size, align);
|
||||||
dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
|
dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
|
||||||
512ULL<<20);
|
512ULL<<20);
|
||||||
if (dma32_bootmem_ptr)
|
if (dma32_bootmem_ptr)
|
||||||
|
@@ -37,11 +37,11 @@
|
|||||||
#include <linux/kdebug.h>
|
#include <linux/kdebug.h>
|
||||||
#include <linux/tick.h>
|
#include <linux/tick.h>
|
||||||
#include <linux/prctl.h>
|
#include <linux/prctl.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
|
||||||
#include <asm/uaccess.h>
|
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
#include <asm/io.h>
|
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/i387.h>
|
#include <asm/i387.h>
|
||||||
#include <asm/mmu_context.h>
|
#include <asm/mmu_context.h>
|
||||||
@@ -89,7 +89,7 @@ void exit_idle(void)
|
|||||||
#ifdef CONFIG_HOTPLUG_CPU
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
DECLARE_PER_CPU(int, cpu_state);
|
DECLARE_PER_CPU(int, cpu_state);
|
||||||
|
|
||||||
#include <asm/nmi.h>
|
#include <linux/nmi.h>
|
||||||
/* We halt the CPU with physical CPU hotplug */
|
/* We halt the CPU with physical CPU hotplug */
|
||||||
static inline void play_dead(void)
|
static inline void play_dead(void)
|
||||||
{
|
{
|
||||||
@@ -161,24 +161,24 @@ void __show_regs(struct pt_regs * regs)
|
|||||||
|
|
||||||
printk("\n");
|
printk("\n");
|
||||||
print_modules();
|
print_modules();
|
||||||
printk("Pid: %d, comm: %.20s %s %s %.*s\n",
|
printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s\n",
|
||||||
current->pid, current->comm, print_tainted(),
|
current->pid, current->comm, print_tainted(),
|
||||||
init_utsname()->release,
|
init_utsname()->release,
|
||||||
(int)strcspn(init_utsname()->version, " "),
|
(int)strcspn(init_utsname()->version, " "),
|
||||||
init_utsname()->version);
|
init_utsname()->version);
|
||||||
printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
|
printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
|
||||||
printk_address(regs->ip, 1);
|
printk_address(regs->ip, 1);
|
||||||
printk("RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->sp,
|
printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss,
|
||||||
regs->flags);
|
regs->sp, regs->flags);
|
||||||
printk("RAX: %016lx RBX: %016lx RCX: %016lx\n",
|
printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n",
|
||||||
regs->ax, regs->bx, regs->cx);
|
regs->ax, regs->bx, regs->cx);
|
||||||
printk("RDX: %016lx RSI: %016lx RDI: %016lx\n",
|
printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n",
|
||||||
regs->dx, regs->si, regs->di);
|
regs->dx, regs->si, regs->di);
|
||||||
printk("RBP: %016lx R08: %016lx R09: %016lx\n",
|
printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n",
|
||||||
regs->bp, regs->r8, regs->r9);
|
regs->bp, regs->r8, regs->r9);
|
||||||
printk("R10: %016lx R11: %016lx R12: %016lx\n",
|
printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n",
|
||||||
regs->r10, regs->r11, regs->r12);
|
regs->r10, regs->r11, regs->r12);
|
||||||
printk("R13: %016lx R14: %016lx R15: %016lx\n",
|
printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
|
||||||
regs->r13, regs->r14, regs->r15);
|
regs->r13, regs->r14, regs->r15);
|
||||||
|
|
||||||
asm("movl %%ds,%0" : "=r" (ds));
|
asm("movl %%ds,%0" : "=r" (ds));
|
||||||
@@ -196,24 +196,26 @@ void __show_regs(struct pt_regs * regs)
|
|||||||
cr3 = read_cr3();
|
cr3 = read_cr3();
|
||||||
cr4 = read_cr4();
|
cr4 = read_cr4();
|
||||||
|
|
||||||
printk("FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n",
|
printk(KERN_INFO "FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n",
|
||||||
fs, fsindex, gs, gsindex, shadowgs);
|
fs, fsindex, gs, gsindex, shadowgs);
|
||||||
printk("CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds, es, cr0);
|
printk(KERN_INFO "CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds,
|
||||||
printk("CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, cr4);
|
es, cr0);
|
||||||
|
printk(KERN_INFO "CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3,
|
||||||
|
cr4);
|
||||||
|
|
||||||
get_debugreg(d0, 0);
|
get_debugreg(d0, 0);
|
||||||
get_debugreg(d1, 1);
|
get_debugreg(d1, 1);
|
||||||
get_debugreg(d2, 2);
|
get_debugreg(d2, 2);
|
||||||
printk("DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
|
printk(KERN_INFO "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
|
||||||
get_debugreg(d3, 3);
|
get_debugreg(d3, 3);
|
||||||
get_debugreg(d6, 6);
|
get_debugreg(d6, 6);
|
||||||
get_debugreg(d7, 7);
|
get_debugreg(d7, 7);
|
||||||
printk("DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
|
printk(KERN_INFO "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_regs(struct pt_regs *regs)
|
void show_regs(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
printk("CPU %d:", smp_processor_id());
|
printk(KERN_INFO "CPU %d:", smp_processor_id());
|
||||||
__show_regs(regs);
|
__show_regs(regs);
|
||||||
show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
|
show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
|
||||||
}
|
}
|
||||||
@@ -824,8 +826,7 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
|
|||||||
rdmsrl(MSR_KERNEL_GS_BASE, base);
|
rdmsrl(MSR_KERNEL_GS_BASE, base);
|
||||||
else
|
else
|
||||||
base = task->thread.gs;
|
base = task->thread.gs;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
base = task->thread.gs;
|
base = task->thread.gs;
|
||||||
ret = put_user(base, (unsigned long __user *)addr);
|
ret = put_user(base, (unsigned long __user *)addr);
|
||||||
break;
|
break;
|
||||||
|
@@ -34,4 +34,9 @@ struct rt_sigframe {
|
|||||||
struct siginfo info;
|
struct siginfo info;
|
||||||
/* fp state follows here */
|
/* fp state follows here */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
||||||
|
sigset_t *set, struct pt_regs *regs);
|
||||||
|
int ia32_setup_frame(int sig, struct k_sigaction *ka,
|
||||||
|
sigset_t *set, struct pt_regs *regs);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -20,9 +20,10 @@
|
|||||||
#include <linux/stddef.h>
|
#include <linux/stddef.h>
|
||||||
#include <linux/personality.h>
|
#include <linux/personality.h>
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/ucontext.h>
|
#include <asm/ucontext.h>
|
||||||
#include <asm/uaccess.h>
|
|
||||||
#include <asm/i387.h>
|
#include <asm/i387.h>
|
||||||
#include <asm/proto.h>
|
#include <asm/proto.h>
|
||||||
#include <asm/ia32_unistd.h>
|
#include <asm/ia32_unistd.h>
|
||||||
@@ -44,11 +45,6 @@
|
|||||||
# define FIX_EFLAGS __FIX_EFLAGS
|
# define FIX_EFLAGS __FIX_EFLAGS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
|
|
||||||
sigset_t *set, struct pt_regs * regs);
|
|
||||||
int ia32_setup_frame(int sig, struct k_sigaction *ka,
|
|
||||||
sigset_t *set, struct pt_regs * regs);
|
|
||||||
|
|
||||||
asmlinkage long
|
asmlinkage long
|
||||||
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
|
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
|
||||||
struct pt_regs *regs)
|
struct pt_regs *regs)
|
||||||
@@ -68,7 +64,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
|
|||||||
/* Always make any pending restarted system calls return -EINTR */
|
/* Always make any pending restarted system calls return -EINTR */
|
||||||
current_thread_info()->restart_block.fn = do_no_restart_syscall;
|
current_thread_info()->restart_block.fn = do_no_restart_syscall;
|
||||||
|
|
||||||
#define COPY(x) err |= __get_user(regs->x, &sc->x)
|
#define COPY(x) (err |= __get_user(regs->x, &sc->x))
|
||||||
|
|
||||||
COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
|
COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
|
||||||
COPY(dx); COPY(cx); COPY(ip);
|
COPY(dx); COPY(cx); COPY(ip);
|
||||||
@@ -143,7 +139,8 @@ badframe:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask, struct task_struct *me)
|
setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
|
||||||
|
unsigned long mask, struct task_struct *me)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
@@ -468,7 +465,8 @@ void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
|
|||||||
struct task_struct *me = current;
|
struct task_struct *me = current;
|
||||||
if (show_unhandled_signals && printk_ratelimit()) {
|
if (show_unhandled_signals && printk_ratelimit()) {
|
||||||
printk("%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
|
printk("%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
|
||||||
me->comm,me->pid,where,frame,regs->ip,regs->sp,regs->orig_ax);
|
me->comm, me->pid, where, frame, regs->ip,
|
||||||
|
regs->sp, regs->orig_ax);
|
||||||
print_vma_addr(" in ", regs->ip);
|
print_vma_addr(" in ", regs->ip);
|
||||||
printk("\n");
|
printk("\n");
|
||||||
}
|
}
|
||||||
|
@@ -1313,16 +1313,13 @@ __init void prefill_possible_map(void)
|
|||||||
if (!num_processors)
|
if (!num_processors)
|
||||||
num_processors = 1;
|
num_processors = 1;
|
||||||
|
|
||||||
#ifdef CONFIG_HOTPLUG_CPU
|
|
||||||
if (additional_cpus == -1) {
|
if (additional_cpus == -1) {
|
||||||
if (disabled_cpus > 0)
|
if (disabled_cpus > 0)
|
||||||
additional_cpus = disabled_cpus;
|
additional_cpus = disabled_cpus;
|
||||||
else
|
else
|
||||||
additional_cpus = 0;
|
additional_cpus = 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
additional_cpus = 0;
|
|
||||||
#endif
|
|
||||||
possible = num_processors + additional_cpus;
|
possible = num_processors + additional_cpus;
|
||||||
if (possible > NR_CPUS)
|
if (possible > NR_CPUS)
|
||||||
possible = NR_CPUS;
|
possible = NR_CPUS;
|
||||||
|
@@ -13,12 +13,13 @@
|
|||||||
#include <linux/utsname.h>
|
#include <linux/utsname.h>
|
||||||
#include <linux/personality.h>
|
#include <linux/personality.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
#include <asm/uaccess.h>
|
|
||||||
#include <asm/ia32.h>
|
#include <asm/ia32.h>
|
||||||
#include <asm/syscalls.h>
|
#include <asm/syscalls.h>
|
||||||
|
|
||||||
asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags,
|
asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
|
||||||
|
unsigned long prot, unsigned long flags,
|
||||||
unsigned long fd, unsigned long off)
|
unsigned long fd, unsigned long off)
|
||||||
{
|
{
|
||||||
long error;
|
long error;
|
||||||
@@ -178,7 +179,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
|
|||||||
vma = find_vma(mm, addr-len);
|
vma = find_vma(mm, addr-len);
|
||||||
if (!vma || addr <= vma->vm_start)
|
if (!vma || addr <= vma->vm_start)
|
||||||
/* remember the address as a hint for next time */
|
/* remember the address as a hint for next time */
|
||||||
return (mm->free_area_cache = addr-len);
|
return mm->free_area_cache = addr-len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mm->mmap_base < len)
|
if (mm->mmap_base < len)
|
||||||
@@ -195,7 +196,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
|
|||||||
vma = find_vma(mm, addr);
|
vma = find_vma(mm, addr);
|
||||||
if (!vma || addr+len <= vma->vm_start)
|
if (!vma || addr+len <= vma->vm_start)
|
||||||
/* remember the address as a hint for next time */
|
/* remember the address as a hint for next time */
|
||||||
return (mm->free_area_cache = addr);
|
return mm->free_area_cache = addr;
|
||||||
|
|
||||||
/* remember the largest hole we saw so far */
|
/* remember the largest hole we saw so far */
|
||||||
if (addr + mm->cached_hole_size < vma->vm_start)
|
if (addr + mm->cached_hole_size < vma->vm_start)
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
#include <linux/bug.h>
|
#include <linux/bug.h>
|
||||||
#include <linux/nmi.h>
|
#include <linux/nmi.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
|
#include <linux/smp.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
|
||||||
#if defined(CONFIG_EDAC)
|
#if defined(CONFIG_EDAC)
|
||||||
#include <linux/edac.h>
|
#include <linux/edac.h>
|
||||||
@@ -45,9 +47,6 @@
|
|||||||
#include <asm/unwind.h>
|
#include <asm/unwind.h>
|
||||||
#include <asm/desc.h>
|
#include <asm/desc.h>
|
||||||
#include <asm/i387.h>
|
#include <asm/i387.h>
|
||||||
#include <asm/nmi.h>
|
|
||||||
#include <asm/smp.h>
|
|
||||||
#include <asm/io.h>
|
|
||||||
#include <asm/pgalloc.h>
|
#include <asm/pgalloc.h>
|
||||||
#include <asm/proto.h>
|
#include <asm/proto.h>
|
||||||
#include <asm/pda.h>
|
#include <asm/pda.h>
|
||||||
@@ -85,7 +84,8 @@ static inline void preempt_conditional_cli(struct pt_regs *regs)
|
|||||||
|
|
||||||
void printk_address(unsigned long address, int reliable)
|
void printk_address(unsigned long address, int reliable)
|
||||||
{
|
{
|
||||||
printk(" [<%016lx>] %s%pS\n", address, reliable ? "": "? ", (void *) address);
|
printk(" [<%016lx>] %s%pS\n",
|
||||||
|
address, reliable ? "" : "? ", (void *) address);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
|
static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
|
||||||
@@ -98,7 +98,8 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
|
|||||||
[STACKFAULT_STACK - 1] = "#SS",
|
[STACKFAULT_STACK - 1] = "#SS",
|
||||||
[MCE_STACK - 1] = "#MC",
|
[MCE_STACK - 1] = "#MC",
|
||||||
#if DEBUG_STKSZ > EXCEPTION_STKSZ
|
#if DEBUG_STKSZ > EXCEPTION_STKSZ
|
||||||
[N_EXCEPTION_STACKS ... N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
|
[N_EXCEPTION_STACKS ...
|
||||||
|
N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
unsigned k;
|
unsigned k;
|
||||||
@@ -357,11 +358,15 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
|
|||||||
unsigned long *stack;
|
unsigned long *stack;
|
||||||
int i;
|
int i;
|
||||||
const int cpu = smp_processor_id();
|
const int cpu = smp_processor_id();
|
||||||
unsigned long *irqstack_end = (unsigned long *) (cpu_pda(cpu)->irqstackptr);
|
unsigned long *irqstack_end =
|
||||||
unsigned long *irqstack = (unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE);
|
(unsigned long *) (cpu_pda(cpu)->irqstackptr);
|
||||||
|
unsigned long *irqstack =
|
||||||
|
(unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE);
|
||||||
|
|
||||||
// debugging aid: "show_stack(NULL, NULL);" prints the
|
/*
|
||||||
// back trace for this cpu.
|
* debugging aid: "show_stack(NULL, NULL);" prints the
|
||||||
|
* back trace for this cpu.
|
||||||
|
*/
|
||||||
|
|
||||||
if (sp == NULL) {
|
if (sp == NULL) {
|
||||||
if (task)
|
if (task)
|
||||||
@@ -414,7 +419,6 @@ void dump_stack(void)
|
|||||||
init_utsname()->version);
|
init_utsname()->version);
|
||||||
show_trace(NULL, NULL, &stack, bp);
|
show_trace(NULL, NULL, &stack, bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(dump_stack);
|
EXPORT_SYMBOL(dump_stack);
|
||||||
|
|
||||||
void show_registers(struct pt_regs *regs)
|
void show_registers(struct pt_regs *regs)
|
||||||
@@ -780,7 +784,8 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
|
|||||||
static notrace __kprobes void
|
static notrace __kprobes void
|
||||||
unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
|
unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
|
if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) ==
|
||||||
|
NOTIFY_STOP)
|
||||||
return;
|
return;
|
||||||
printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
|
printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
|
||||||
reason);
|
reason);
|
||||||
@@ -1149,8 +1154,10 @@ void __init trap_init(void)
|
|||||||
set_intr_gate(0, ÷_error);
|
set_intr_gate(0, ÷_error);
|
||||||
set_intr_gate_ist(1, &debug, DEBUG_STACK);
|
set_intr_gate_ist(1, &debug, DEBUG_STACK);
|
||||||
set_intr_gate_ist(2, &nmi, NMI_STACK);
|
set_intr_gate_ist(2, &nmi, NMI_STACK);
|
||||||
set_system_gate_ist(3, &int3, DEBUG_STACK); /* int3 can be called from all */
|
/* int3 can be called from all */
|
||||||
set_system_gate(4, &overflow); /* int4 can be called from all */
|
set_system_gate_ist(3, &int3, DEBUG_STACK);
|
||||||
|
/* int4 can be called from all */
|
||||||
|
set_system_gate(4, &overflow);
|
||||||
set_intr_gate(5, &bounds);
|
set_intr_gate(5, &bounds);
|
||||||
set_intr_gate(6, &invalid_op);
|
set_intr_gate(6, &invalid_op);
|
||||||
set_intr_gate(7, &device_not_available);
|
set_intr_gate(7, &device_not_available);
|
||||||
|
@@ -25,45 +25,31 @@
|
|||||||
#include <asm/visws/cobalt.h>
|
#include <asm/visws/cobalt.h>
|
||||||
#include <asm/visws/piix4.h>
|
#include <asm/visws/piix4.h>
|
||||||
#include <asm/arch_hooks.h>
|
#include <asm/arch_hooks.h>
|
||||||
|
#include <asm/io_apic.h>
|
||||||
#include <asm/fixmap.h>
|
#include <asm/fixmap.h>
|
||||||
#include <asm/reboot.h>
|
#include <asm/reboot.h>
|
||||||
#include <asm/setup.h>
|
#include <asm/setup.h>
|
||||||
#include <asm/e820.h>
|
#include <asm/e820.h>
|
||||||
#include <asm/smp.h>
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
#include <mach_ipi.h>
|
#include <mach_ipi.h>
|
||||||
|
|
||||||
#include "mach_apic.h"
|
#include "mach_apic.h"
|
||||||
|
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/smp.h>
|
|
||||||
|
|
||||||
#include <linux/kernel_stat.h>
|
#include <linux/kernel_stat.h>
|
||||||
#include <linux/interrupt.h>
|
|
||||||
#include <linux/init.h>
|
|
||||||
|
|
||||||
#include <asm/io.h>
|
|
||||||
#include <asm/apic.h>
|
|
||||||
#include <asm/i8259.h>
|
#include <asm/i8259.h>
|
||||||
#include <asm/irq_vectors.h>
|
#include <asm/irq_vectors.h>
|
||||||
#include <asm/visws/cobalt.h>
|
|
||||||
#include <asm/visws/lithium.h>
|
#include <asm/visws/lithium.h>
|
||||||
#include <asm/visws/piix4.h>
|
|
||||||
|
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include <linux/pci_ids.h>
|
#include <linux/pci_ids.h>
|
||||||
|
|
||||||
extern int no_broadcast;
|
extern int no_broadcast;
|
||||||
|
|
||||||
#include <asm/io.h>
|
|
||||||
#include <asm/apic.h>
|
#include <asm/apic.h>
|
||||||
#include <asm/arch_hooks.h>
|
|
||||||
#include <asm/visws/cobalt.h>
|
|
||||||
#include <asm/visws/lithium.h>
|
|
||||||
|
|
||||||
char visws_board_type = -1;
|
char visws_board_type = -1;
|
||||||
char visws_board_rev = -1;
|
char visws_board_rev = -1;
|
||||||
|
@@ -16,37 +16,46 @@ static void __rdmsr_on_cpu(void *info)
|
|||||||
rdmsr(rv->msr_no, rv->l, rv->h);
|
rdmsr(rv->msr_no, rv->l, rv->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __rdmsr_safe_on_cpu(void *info)
|
static void __wrmsr_on_cpu(void *info)
|
||||||
{
|
{
|
||||||
struct msr_info *rv = info;
|
struct msr_info *rv = info;
|
||||||
|
|
||||||
rv->err = rdmsr_safe(rv->msr_no, &rv->l, &rv->h);
|
wrmsr(rv->msr_no, rv->l, rv->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h, int safe)
|
int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err;
|
||||||
struct msr_info rv;
|
struct msr_info rv;
|
||||||
|
|
||||||
rv.msr_no = msr_no;
|
rv.msr_no = msr_no;
|
||||||
if (safe) {
|
|
||||||
err = smp_call_function_single(cpu, __rdmsr_safe_on_cpu,
|
|
||||||
&rv, 1);
|
|
||||||
err = err ? err : rv.err;
|
|
||||||
} else {
|
|
||||||
err = smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 1);
|
err = smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 1);
|
||||||
}
|
|
||||||
*l = rv.l;
|
*l = rv.l;
|
||||||
*h = rv.h;
|
*h = rv.h;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __wrmsr_on_cpu(void *info)
|
int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
struct msr_info rv;
|
||||||
|
|
||||||
|
rv.msr_no = msr_no;
|
||||||
|
rv.l = l;
|
||||||
|
rv.h = h;
|
||||||
|
err = smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 1);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* These "safe" variants are slower and should be used when the target MSR
|
||||||
|
may not actually exist. */
|
||||||
|
static void __rdmsr_safe_on_cpu(void *info)
|
||||||
{
|
{
|
||||||
struct msr_info *rv = info;
|
struct msr_info *rv = info;
|
||||||
|
|
||||||
wrmsr(rv->msr_no, rv->l, rv->h);
|
rv->err = rdmsr_safe(rv->msr_no, &rv->l, &rv->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __wrmsr_safe_on_cpu(void *info)
|
static void __wrmsr_safe_on_cpu(void *info)
|
||||||
@@ -56,45 +65,30 @@ static void __wrmsr_safe_on_cpu(void *info)
|
|||||||
rv->err = wrmsr_safe(rv->msr_no, rv->l, rv->h);
|
rv->err = wrmsr_safe(rv->msr_no, rv->l, rv->h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h, int safe)
|
int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err;
|
||||||
|
struct msr_info rv;
|
||||||
|
|
||||||
|
rv.msr_no = msr_no;
|
||||||
|
err = smp_call_function_single(cpu, __rdmsr_safe_on_cpu, &rv, 1);
|
||||||
|
*l = rv.l;
|
||||||
|
*h = rv.h;
|
||||||
|
|
||||||
|
return err ? err : rv.err;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
struct msr_info rv;
|
struct msr_info rv;
|
||||||
|
|
||||||
rv.msr_no = msr_no;
|
rv.msr_no = msr_no;
|
||||||
rv.l = l;
|
rv.l = l;
|
||||||
rv.h = h;
|
rv.h = h;
|
||||||
if (safe) {
|
err = smp_call_function_single(cpu, __wrmsr_safe_on_cpu, &rv, 1);
|
||||||
err = smp_call_function_single(cpu, __wrmsr_safe_on_cpu,
|
|
||||||
&rv, 1);
|
|
||||||
err = err ? err : rv.err;
|
|
||||||
} else {
|
|
||||||
err = smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return err;
|
return err ? err : rv.err;
|
||||||
}
|
|
||||||
|
|
||||||
int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
|
|
||||||
{
|
|
||||||
return _wrmsr_on_cpu(cpu, msr_no, l, h, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
|
|
||||||
{
|
|
||||||
return _rdmsr_on_cpu(cpu, msr_no, l, h, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* These "safe" variants are slower and should be used when the target MSR
|
|
||||||
may not actually exist. */
|
|
||||||
int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
|
|
||||||
{
|
|
||||||
return _wrmsr_on_cpu(cpu, msr_no, l, h, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
|
|
||||||
{
|
|
||||||
return _rdmsr_on_cpu(cpu, msr_no, l, h, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(rdmsr_on_cpu);
|
EXPORT_SYMBOL(rdmsr_on_cpu);
|
||||||
|
@@ -328,7 +328,7 @@ void __init initmem_init(unsigned long start_pfn,
|
|||||||
|
|
||||||
get_memcfg_numa();
|
get_memcfg_numa();
|
||||||
|
|
||||||
kva_pages = round_up(calculate_numa_remap_pages(), PTRS_PER_PTE);
|
kva_pages = roundup(calculate_numa_remap_pages(), PTRS_PER_PTE);
|
||||||
|
|
||||||
kva_target_pfn = round_down(max_low_pfn - kva_pages, PTRS_PER_PTE);
|
kva_target_pfn = round_down(max_low_pfn - kva_pages, PTRS_PER_PTE);
|
||||||
do {
|
do {
|
||||||
|
@@ -148,8 +148,8 @@ static void note_page(struct seq_file *m, struct pg_state *st,
|
|||||||
* we have now. "break" is either changing perms, levels or
|
* we have now. "break" is either changing perms, levels or
|
||||||
* address space marker.
|
* address space marker.
|
||||||
*/
|
*/
|
||||||
prot = pgprot_val(new_prot) & ~(PTE_PFN_MASK);
|
prot = pgprot_val(new_prot) & PTE_FLAGS_MASK;
|
||||||
cur = pgprot_val(st->current_prot) & ~(PTE_PFN_MASK);
|
cur = pgprot_val(st->current_prot) & PTE_FLAGS_MASK;
|
||||||
|
|
||||||
if (!st->level) {
|
if (!st->level) {
|
||||||
/* First entry */
|
/* First entry */
|
||||||
|
@@ -225,7 +225,7 @@ void __init init_extra_mapping_uc(unsigned long phys, unsigned long size)
|
|||||||
void __init cleanup_highmap(void)
|
void __init cleanup_highmap(void)
|
||||||
{
|
{
|
||||||
unsigned long vaddr = __START_KERNEL_map;
|
unsigned long vaddr = __START_KERNEL_map;
|
||||||
unsigned long end = round_up((unsigned long)_end, PMD_SIZE) - 1;
|
unsigned long end = roundup((unsigned long)_end, PMD_SIZE) - 1;
|
||||||
pmd_t *pmd = level2_kernel_pgt;
|
pmd_t *pmd = level2_kernel_pgt;
|
||||||
pmd_t *last_pmd = pmd + PTRS_PER_PMD;
|
pmd_t *last_pmd = pmd + PTRS_PER_PMD;
|
||||||
|
|
||||||
@@ -451,14 +451,14 @@ static void __init find_early_table_space(unsigned long end)
|
|||||||
unsigned long puds, pmds, ptes, tables, start;
|
unsigned long puds, pmds, ptes, tables, start;
|
||||||
|
|
||||||
puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
|
puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
|
||||||
tables = round_up(puds * sizeof(pud_t), PAGE_SIZE);
|
tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
|
||||||
if (direct_gbpages) {
|
if (direct_gbpages) {
|
||||||
unsigned long extra;
|
unsigned long extra;
|
||||||
extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT);
|
extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT);
|
||||||
pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT;
|
pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT;
|
||||||
} else
|
} else
|
||||||
pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
|
pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
|
||||||
tables += round_up(pmds * sizeof(pmd_t), PAGE_SIZE);
|
tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
|
||||||
|
|
||||||
if (cpu_has_pse) {
|
if (cpu_has_pse) {
|
||||||
unsigned long extra;
|
unsigned long extra;
|
||||||
@@ -466,7 +466,7 @@ static void __init find_early_table_space(unsigned long end)
|
|||||||
ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||||
} else
|
} else
|
||||||
ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
|
||||||
tables += round_up(ptes * sizeof(pte_t), PAGE_SIZE);
|
tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RED-PEN putting page tables only on node 0 could
|
* RED-PEN putting page tables only on node 0 could
|
||||||
|
@@ -79,7 +79,7 @@ static int __init allocate_cachealigned_memnodemap(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
addr = 0x8000;
|
addr = 0x8000;
|
||||||
nodemap_size = round_up(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES);
|
nodemap_size = roundup(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES);
|
||||||
nodemap_addr = find_e820_area(addr, max_pfn<<PAGE_SHIFT,
|
nodemap_addr = find_e820_area(addr, max_pfn<<PAGE_SHIFT,
|
||||||
nodemap_size, L1_CACHE_BYTES);
|
nodemap_size, L1_CACHE_BYTES);
|
||||||
if (nodemap_addr == -1UL) {
|
if (nodemap_addr == -1UL) {
|
||||||
@@ -176,10 +176,10 @@ void __init setup_node_bootmem(int nodeid, unsigned long start,
|
|||||||
unsigned long start_pfn, last_pfn, bootmap_pages, bootmap_size;
|
unsigned long start_pfn, last_pfn, bootmap_pages, bootmap_size;
|
||||||
unsigned long bootmap_start, nodedata_phys;
|
unsigned long bootmap_start, nodedata_phys;
|
||||||
void *bootmap;
|
void *bootmap;
|
||||||
const int pgdat_size = round_up(sizeof(pg_data_t), PAGE_SIZE);
|
const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE);
|
||||||
int nid;
|
int nid;
|
||||||
|
|
||||||
start = round_up(start, ZONE_ALIGN);
|
start = roundup(start, ZONE_ALIGN);
|
||||||
|
|
||||||
printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid,
|
printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid,
|
||||||
start, end);
|
start, end);
|
||||||
@@ -210,9 +210,9 @@ void __init setup_node_bootmem(int nodeid, unsigned long start,
|
|||||||
bootmap_pages = bootmem_bootmap_pages(last_pfn - start_pfn);
|
bootmap_pages = bootmem_bootmap_pages(last_pfn - start_pfn);
|
||||||
nid = phys_to_nid(nodedata_phys);
|
nid = phys_to_nid(nodedata_phys);
|
||||||
if (nid == nodeid)
|
if (nid == nodeid)
|
||||||
bootmap_start = round_up(nodedata_phys + pgdat_size, PAGE_SIZE);
|
bootmap_start = roundup(nodedata_phys + pgdat_size, PAGE_SIZE);
|
||||||
else
|
else
|
||||||
bootmap_start = round_up(start, PAGE_SIZE);
|
bootmap_start = roundup(start, PAGE_SIZE);
|
||||||
/*
|
/*
|
||||||
* SMP_CACHE_BYTES could be enough, but init_bootmem_node like
|
* SMP_CACHE_BYTES could be enough, but init_bootmem_node like
|
||||||
* to use that to align to PAGE_SIZE
|
* to use that to align to PAGE_SIZE
|
||||||
|
@@ -84,7 +84,7 @@ static inline unsigned long highmap_start_pfn(void)
|
|||||||
|
|
||||||
static inline unsigned long highmap_end_pfn(void)
|
static inline unsigned long highmap_end_pfn(void)
|
||||||
{
|
{
|
||||||
return __pa(round_up((unsigned long)_end, PMD_SIZE)) >> PAGE_SHIFT;
|
return __pa(roundup((unsigned long)_end, PMD_SIZE)) >> PAGE_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1043,37 +1043,46 @@ static void __init pcibios_fixup_irqs(void)
|
|||||||
if (io_apic_assign_pci_irqs) {
|
if (io_apic_assign_pci_irqs) {
|
||||||
int irq;
|
int irq;
|
||||||
|
|
||||||
if (pin) {
|
if (!pin)
|
||||||
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* interrupt pins are numbered starting
|
* interrupt pins are numbered starting from 1
|
||||||
* from 1
|
|
||||||
*/
|
*/
|
||||||
pin--;
|
pin--;
|
||||||
irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
|
irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
|
||||||
PCI_SLOT(dev->devfn), pin);
|
PCI_SLOT(dev->devfn), pin);
|
||||||
/*
|
/*
|
||||||
* Busses behind bridges are typically not listed in the MP-table.
|
* Busses behind bridges are typically not listed in the
|
||||||
* In this case we have to look up the IRQ based on the parent bus,
|
* MP-table. In this case we have to look up the IRQ
|
||||||
* parent slot, and pin number. The SMP code detects such bridged
|
* based on the parent bus, parent slot, and pin number.
|
||||||
* busses itself so we should get into this branch reliably.
|
* The SMP code detects such bridged busses itself so we
|
||||||
|
* should get into this branch reliably.
|
||||||
*/
|
*/
|
||||||
if (irq < 0 && dev->bus->parent) { /* go back to the bridge */
|
if (irq < 0 && dev->bus->parent) {
|
||||||
|
/* go back to the bridge */
|
||||||
struct pci_dev *bridge = dev->bus->self;
|
struct pci_dev *bridge = dev->bus->self;
|
||||||
|
int bus;
|
||||||
|
|
||||||
pin = (pin + PCI_SLOT(dev->devfn)) % 4;
|
pin = (pin + PCI_SLOT(dev->devfn)) % 4;
|
||||||
irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
|
bus = bridge->bus->number;
|
||||||
|
irq = IO_APIC_get_PCI_irq_vector(bus,
|
||||||
PCI_SLOT(bridge->devfn), pin);
|
PCI_SLOT(bridge->devfn), pin);
|
||||||
if (irq >= 0)
|
if (irq >= 0)
|
||||||
dev_warn(&dev->dev, "using bridge %s INT %c to get IRQ %d\n",
|
dev_warn(&dev->dev,
|
||||||
|
"using bridge %s INT %c to "
|
||||||
|
"get IRQ %d\n",
|
||||||
pci_name(bridge),
|
pci_name(bridge),
|
||||||
'A' + pin, irq);
|
'A' + pin, irq);
|
||||||
}
|
}
|
||||||
if (irq >= 0) {
|
if (irq >= 0) {
|
||||||
dev_info(&dev->dev, "PCI->APIC IRQ transform: INT %c -> IRQ %d\n", 'A' + pin, irq);
|
dev_info(&dev->dev,
|
||||||
|
"PCI->APIC IRQ transform: INT %c "
|
||||||
|
"-> IRQ %d\n",
|
||||||
|
'A' + pin, irq);
|
||||||
dev->irq = irq;
|
dev->irq = irq;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Still no IRQ? Try to lookup one...
|
* Still no IRQ? Try to lookup one...
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
.text
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This may not use any stack, nor any variable that is not "NoSave":
|
* This may not use any stack, nor any variable that is not "NoSave":
|
||||||
*
|
*
|
||||||
@@ -12,17 +10,18 @@
|
|||||||
#include <asm/segment.h>
|
#include <asm/segment.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#include <asm/asm-offsets.h>
|
#include <asm/asm-offsets.h>
|
||||||
|
#include <asm/processor-flags.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
ENTRY(swsusp_arch_suspend)
|
ENTRY(swsusp_arch_suspend)
|
||||||
|
|
||||||
movl %esp, saved_context_esp
|
movl %esp, saved_context_esp
|
||||||
movl %ebx, saved_context_ebx
|
movl %ebx, saved_context_ebx
|
||||||
movl %ebp, saved_context_ebp
|
movl %ebp, saved_context_ebp
|
||||||
movl %esi, saved_context_esi
|
movl %esi, saved_context_esi
|
||||||
movl %edi, saved_context_edi
|
movl %edi, saved_context_edi
|
||||||
pushfl ; popl saved_context_eflags
|
pushfl
|
||||||
|
popl saved_context_eflags
|
||||||
|
|
||||||
call swsusp_save
|
call swsusp_save
|
||||||
ret
|
ret
|
||||||
@@ -59,7 +58,7 @@ done:
|
|||||||
movl mmu_cr4_features, %ecx
|
movl mmu_cr4_features, %ecx
|
||||||
jecxz 1f # cr4 Pentium and higher, skip if zero
|
jecxz 1f # cr4 Pentium and higher, skip if zero
|
||||||
movl %ecx, %edx
|
movl %ecx, %edx
|
||||||
andl $~(1<<7), %edx; # PGE
|
andl $~(X86_CR4_PGE), %edx
|
||||||
movl %edx, %cr4; # turn off PGE
|
movl %edx, %cr4; # turn off PGE
|
||||||
1:
|
1:
|
||||||
movl %cr3, %eax; # flush TLB
|
movl %cr3, %eax; # flush TLB
|
||||||
@@ -74,7 +73,8 @@ done:
|
|||||||
movl saved_context_esi, %esi
|
movl saved_context_esi, %esi
|
||||||
movl saved_context_edi, %edi
|
movl saved_context_edi, %edi
|
||||||
|
|
||||||
pushl saved_context_eflags ; popfl
|
pushl saved_context_eflags
|
||||||
|
popfl
|
||||||
|
|
||||||
xorl %eax, %eax
|
xorl %eax, %eax
|
||||||
|
|
||||||
|
@@ -134,9 +134,7 @@ static inline void ack_x2APIC_irq(void)
|
|||||||
static inline void ack_APIC_irq(void)
|
static inline void ack_APIC_irq(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* ack_APIC_irq() actually gets compiled as a single instruction:
|
* ack_APIC_irq() actually gets compiled as a single instruction
|
||||||
* - a single rmw on Pentium/82489DX
|
|
||||||
* - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
|
|
||||||
* ... yummie.
|
* ... yummie.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -20,17 +20,22 @@
|
|||||||
|
|
||||||
#define _ASM_PTR __ASM_SEL(.long, .quad)
|
#define _ASM_PTR __ASM_SEL(.long, .quad)
|
||||||
#define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8)
|
#define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8)
|
||||||
#define _ASM_MOV_UL __ASM_SIZE(mov)
|
|
||||||
|
|
||||||
|
#define _ASM_MOV __ASM_SIZE(mov)
|
||||||
#define _ASM_INC __ASM_SIZE(inc)
|
#define _ASM_INC __ASM_SIZE(inc)
|
||||||
#define _ASM_DEC __ASM_SIZE(dec)
|
#define _ASM_DEC __ASM_SIZE(dec)
|
||||||
#define _ASM_ADD __ASM_SIZE(add)
|
#define _ASM_ADD __ASM_SIZE(add)
|
||||||
#define _ASM_SUB __ASM_SIZE(sub)
|
#define _ASM_SUB __ASM_SIZE(sub)
|
||||||
#define _ASM_XADD __ASM_SIZE(xadd)
|
#define _ASM_XADD __ASM_SIZE(xadd)
|
||||||
|
|
||||||
#define _ASM_AX __ASM_REG(ax)
|
#define _ASM_AX __ASM_REG(ax)
|
||||||
#define _ASM_BX __ASM_REG(bx)
|
#define _ASM_BX __ASM_REG(bx)
|
||||||
#define _ASM_CX __ASM_REG(cx)
|
#define _ASM_CX __ASM_REG(cx)
|
||||||
#define _ASM_DX __ASM_REG(dx)
|
#define _ASM_DX __ASM_REG(dx)
|
||||||
|
#define _ASM_SP __ASM_REG(sp)
|
||||||
|
#define _ASM_BP __ASM_REG(bp)
|
||||||
|
#define _ASM_SI __ASM_REG(si)
|
||||||
|
#define _ASM_DI __ASM_REG(di)
|
||||||
|
|
||||||
/* Exception table entry */
|
/* Exception table entry */
|
||||||
# define _ASM_EXTABLE(from,to) \
|
# define _ASM_EXTABLE(from,to) \
|
||||||
|
@@ -148,8 +148,9 @@ do { \
|
|||||||
|
|
||||||
static inline void start_ia32_thread(struct pt_regs *regs, u32 ip, u32 sp)
|
static inline void start_ia32_thread(struct pt_regs *regs, u32 ip, u32 sp)
|
||||||
{
|
{
|
||||||
asm volatile("movl %0,%%fs" :: "r" (0));
|
loadsegment(fs, 0);
|
||||||
asm volatile("movl %0,%%es; movl %0,%%ds" : : "r" (__USER32_DS));
|
loadsegment(ds, __USER32_DS);
|
||||||
|
loadsegment(es, __USER32_DS);
|
||||||
load_gs_index(0);
|
load_gs_index(0);
|
||||||
regs->ip = ip;
|
regs->ip = ip;
|
||||||
regs->sp = sp;
|
regs->sp = sp;
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
do { \
|
do { \
|
||||||
if (pm_trace_enabled) { \
|
if (pm_trace_enabled) { \
|
||||||
const void *tracedata; \
|
const void *tracedata; \
|
||||||
asm volatile(_ASM_MOV_UL " $1f,%0\n" \
|
asm volatile(_ASM_MOV " $1f,%0\n" \
|
||||||
".section .tracedata,\"a\"\n" \
|
".section .tracedata,\"a\"\n" \
|
||||||
"1:\t.word %c1\n\t" \
|
"1:\t.word %c1\n\t" \
|
||||||
_ASM_PTR " %c2\n" \
|
_ASM_PTR " %c2\n" \
|
||||||
|
Reference in New Issue
Block a user