diff options
| -rw-r--r-- | arch/x86/boot/compressed/head_32.S | 5 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/misc.c | 10 | ||||
| -rw-r--r-- | arch/x86/kernel/acpi/boot.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/bios_uv.c | 10 | ||||
| -rw-r--r-- | arch/x86/kernel/cpuid.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/crash_dump_64.c | 7 | ||||
| -rw-r--r-- | arch/x86/kernel/paravirt_patch_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/pci-dma.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/process_64.c | 131 | ||||
| -rw-r--r-- | arch/x86/kernel/sigframe.h | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/signal_64.c | 62 | ||||
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/sys_x86_64.c | 43 | ||||
| -rw-r--r-- | arch/x86/kernel/traps_64.c | 61 | ||||
| -rw-r--r-- | arch/x86/kernel/visws_quirks.c | 16 | ||||
| -rw-r--r-- | arch/x86/lib/string_32.c | 42 | ||||
| -rw-r--r-- | arch/x86/lib/strstr_32.c | 6 | ||||
| -rw-r--r-- | arch/x86/mm/discontig_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/mm/init_64.c | 8 | ||||
| -rw-r--r-- | arch/x86/mm/numa_64.c | 10 | ||||
| -rw-r--r-- | arch/x86/mm/pageattr.c | 2 | ||||
| -rw-r--r-- | include/asm-x86/apic.h | 4 | ||||
| -rw-r--r-- | include/asm-x86/asm.h | 7 | ||||
| -rw-r--r-- | include/asm-x86/resume-trace.h | 2 |
24 files changed, 221 insertions, 223 deletions
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index ba7736cf2ec7..29c5fbf08392 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
| @@ -137,14 +137,15 @@ relocated: | |||
| 137 | */ | 137 | */ |
| 138 | movl output_len(%ebx), %eax | 138 | movl output_len(%ebx), %eax |
| 139 | pushl %eax | 139 | pushl %eax |
| 140 | # push arguments for decompress_kernel: | ||
| 140 | pushl %ebp # output address | 141 | pushl %ebp # output address |
| 141 | movl input_len(%ebx), %eax | 142 | movl input_len(%ebx), %eax |
| 142 | pushl %eax # input_len | 143 | pushl %eax # input_len |
| 143 | leal input_data(%ebx), %eax | 144 | leal input_data(%ebx), %eax |
| 144 | pushl %eax # input_data | 145 | pushl %eax # input_data |
| 145 | leal boot_heap(%ebx), %eax | 146 | leal boot_heap(%ebx), %eax |
| 146 | pushl %eax # heap area as third argument | 147 | pushl %eax # heap area |
| 147 | pushl %esi # real mode pointer as second arg | 148 | pushl %esi # real mode pointer |
| 148 | call decompress_kernel | 149 | call decompress_kernel |
| 149 | addl $20, %esp | 150 | addl $20, %esp |
| 150 | popl %ecx | 151 | popl %ecx |
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c index 9fea73706479..2a3f77e52e2d 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | #include <linux/linkage.h> | 27 | #include <linux/linkage.h> |
| 28 | #include <linux/screen_info.h> | 28 | #include <linux/screen_info.h> |
| 29 | #include <linux/elf.h> | 29 | #include <linux/elf.h> |
| 30 | #include <asm/io.h> | 30 | #include <linux/io.h> |
| 31 | #include <asm/page.h> | 31 | #include <asm/page.h> |
| 32 | #include <asm/boot.h> | 32 | #include <asm/boot.h> |
| 33 | #include <asm/bootparam.h> | 33 | #include <asm/bootparam.h> |
| @@ -251,7 +251,7 @@ static void __putstr(int error, const char *s) | |||
| 251 | y--; | 251 | y--; |
| 252 | } | 252 | } |
| 253 | } else { | 253 | } else { |
| 254 | vidmem [(x + cols * y) * 2] = c; | 254 | vidmem[(x + cols * y) * 2] = c; |
| 255 | if (++x >= cols) { | 255 | if (++x >= cols) { |
| 256 | x = 0; | 256 | x = 0; |
| 257 | if (++y >= lines) { | 257 | if (++y >= lines) { |
| @@ -277,7 +277,8 @@ static void *memset(void *s, int c, unsigned n) | |||
| 277 | int i; | 277 | int i; |
| 278 | char *ss = s; | 278 | char *ss = s; |
| 279 | 279 | ||
| 280 | for (i = 0; i < n; i++) ss[i] = c; | 280 | for (i = 0; i < n; i++) |
| 281 | ss[i] = c; | ||
| 281 | return s; | 282 | return s; |
| 282 | } | 283 | } |
| 283 | 284 | ||
| @@ -287,7 +288,8 @@ static void *memcpy(void *dest, const void *src, unsigned n) | |||
| 287 | const char *s = src; | 288 | const char *s = src; |
| 288 | char *d = dest; | 289 | char *d = dest; |
| 289 | 290 | ||
| 290 | for (i = 0; i < n; i++) d[i] = s[i]; | 291 | for (i = 0; i < n; i++) |
| 292 | d[i] = s[i]; | ||
| 291 | return dest; | 293 | return dest; |
| 292 | } | 294 | } |
| 293 | 295 | ||
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index bfd10fd211cd..f20470823d38 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -58,7 +58,6 @@ EXPORT_SYMBOL(acpi_disabled); | |||
| 58 | #ifdef CONFIG_X86_64 | 58 | #ifdef CONFIG_X86_64 |
| 59 | 59 | ||
| 60 | #include <asm/proto.h> | 60 | #include <asm/proto.h> |
| 61 | #include <asm/genapic.h> | ||
| 62 | 61 | ||
| 63 | #else /* X86 */ | 62 | #else /* X86 */ |
| 64 | 63 | ||
diff --git a/arch/x86/kernel/bios_uv.c b/arch/x86/kernel/bios_uv.c index c639bd55391c..fdd585f9c53d 100644 --- a/arch/x86/kernel/bios_uv.c +++ b/arch/x86/kernel/bios_uv.c | |||
| @@ -25,11 +25,11 @@ x86_bios_strerror(long status) | |||
| 25 | { | 25 | { |
| 26 | const char *str; | 26 | const char *str; |
| 27 | switch (status) { | 27 | switch (status) { |
| 28 | case 0: str = "Call completed without error"; break; | 28 | case 0: str = "Call completed without error"; break; |
| 29 | case -1: str = "Not implemented"; break; | 29 | case -1: str = "Not implemented"; break; |
| 30 | case -2: str = "Invalid argument"; break; | 30 | case -2: str = "Invalid argument"; break; |
| 31 | case -3: str = "Call completed with error"; break; | 31 | case -3: str = "Call completed with error"; break; |
| 32 | default: str = "Unknown BIOS status code"; break; | 32 | default: str = "Unknown BIOS status code"; break; |
| 33 | } | 33 | } |
| 34 | return str; | 34 | return str; |
| 35 | } | 35 | } |
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 14b11b3be31c..3fa4e926b510 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | #include <linux/smp_lock.h> | 36 | #include <linux/smp_lock.h> |
| 37 | #include <linux/major.h> | 37 | #include <linux/major.h> |
| 38 | #include <linux/fs.h> | 38 | #include <linux/fs.h> |
| 39 | #include <linux/smp_lock.h> | ||
| 40 | #include <linux/device.h> | 39 | #include <linux/device.h> |
| 41 | #include <linux/cpu.h> | 40 | #include <linux/cpu.h> |
| 42 | #include <linux/notifier.h> | 41 | #include <linux/notifier.h> |
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c index 15e6c6bc4a46..d3e524c84527 100644 --- a/arch/x86/kernel/crash_dump_64.c +++ b/arch/x86/kernel/crash_dump_64.c | |||
| @@ -7,9 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
| 9 | #include <linux/crash_dump.h> | 9 | #include <linux/crash_dump.h> |
| 10 | 10 | #include <linux/uaccess.h> | |
| 11 | #include <asm/uaccess.h> | 11 | #include <linux/io.h> |
| 12 | #include <asm/io.h> | ||
| 13 | 12 | ||
| 14 | /** | 13 | /** |
| 15 | * copy_oldmem_page - copy one page from "oldmem" | 14 | * copy_oldmem_page - copy one page from "oldmem" |
| @@ -25,7 +24,7 @@ | |||
| 25 | * in the current kernel. We stitch up a pte, similar to kmap_atomic. | 24 | * in the current kernel. We stitch up a pte, similar to kmap_atomic. |
| 26 | */ | 25 | */ |
| 27 | ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | 26 | ssize_t copy_oldmem_page(unsigned long pfn, char *buf, |
| 28 | size_t csize, unsigned long offset, int userbuf) | 27 | size_t csize, unsigned long offset, int userbuf) |
| 29 | { | 28 | { |
| 30 | void *vaddr; | 29 | void *vaddr; |
| 31 | 30 | ||
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c index 58262218781b..9fe644f4861d 100644 --- a/arch/x86/kernel/paravirt_patch_32.c +++ b/arch/x86/kernel/paravirt_patch_32.c | |||
| @@ -23,7 +23,7 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf, | |||
| 23 | start = start_##ops##_##x; \ | 23 | start = start_##ops##_##x; \ |
| 24 | end = end_##ops##_##x; \ | 24 | end = end_##ops##_##x; \ |
| 25 | goto patch_site | 25 | goto patch_site |
| 26 | switch(type) { | 26 | switch (type) { |
| 27 | PATCH_SITE(pv_irq_ops, irq_disable); | 27 | PATCH_SITE(pv_irq_ops, irq_disable); |
| 28 | PATCH_SITE(pv_irq_ops, irq_enable); | 28 | PATCH_SITE(pv_irq_ops, irq_enable); |
| 29 | PATCH_SITE(pv_irq_ops, restore_fl); | 29 | PATCH_SITE(pv_irq_ops, restore_fl); |
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 87d4d6964ec2..f704cb51ff82 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
| @@ -82,7 +82,7 @@ void __init dma32_reserve_bootmem(void) | |||
| 82 | * using 512M as goal | 82 | * using 512M as goal |
| 83 | */ | 83 | */ |
| 84 | align = 64ULL<<20; | 84 | align = 64ULL<<20; |
| 85 | size = round_up(dma32_bootmem_size, align); | 85 | size = roundup(dma32_bootmem_size, align); |
| 86 | dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align, | 86 | dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align, |
| 87 | 512ULL<<20); | 87 | 512ULL<<20); |
| 88 | if (dma32_bootmem_ptr) | 88 | if (dma32_bootmem_ptr) |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 71553b664e2a..e04134a80c22 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
| @@ -37,11 +37,11 @@ | |||
| 37 | #include <linux/kdebug.h> | 37 | #include <linux/kdebug.h> |
| 38 | #include <linux/tick.h> | 38 | #include <linux/tick.h> |
| 39 | #include <linux/prctl.h> | 39 | #include <linux/prctl.h> |
| 40 | #include <linux/uaccess.h> | ||
| 41 | #include <linux/io.h> | ||
| 40 | 42 | ||
| 41 | #include <asm/uaccess.h> | ||
| 42 | #include <asm/pgtable.h> | 43 | #include <asm/pgtable.h> |
| 43 | #include <asm/system.h> | 44 | #include <asm/system.h> |
| 44 | #include <asm/io.h> | ||
| 45 | #include <asm/processor.h> | 45 | #include <asm/processor.h> |
| 46 | #include <asm/i387.h> | 46 | #include <asm/i387.h> |
| 47 | #include <asm/mmu_context.h> | 47 | #include <asm/mmu_context.h> |
| @@ -88,7 +88,7 @@ void exit_idle(void) | |||
| 88 | #ifdef CONFIG_HOTPLUG_CPU | 88 | #ifdef CONFIG_HOTPLUG_CPU |
| 89 | DECLARE_PER_CPU(int, cpu_state); | 89 | DECLARE_PER_CPU(int, cpu_state); |
| 90 | 90 | ||
| 91 | #include <asm/nmi.h> | 91 | #include <linux/nmi.h> |
| 92 | /* We halt the CPU with physical CPU hotplug */ | 92 | /* We halt the CPU with physical CPU hotplug */ |
| 93 | static inline void play_dead(void) | 93 | static inline void play_dead(void) |
| 94 | { | 94 | { |
| @@ -151,7 +151,7 @@ void cpu_idle(void) | |||
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | /* Prints also some state that isn't saved in the pt_regs */ | 153 | /* Prints also some state that isn't saved in the pt_regs */ |
| 154 | void __show_regs(struct pt_regs * regs) | 154 | void __show_regs(struct pt_regs *regs) |
| 155 | { | 155 | { |
| 156 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L, fs, gs, shadowgs; | 156 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L, fs, gs, shadowgs; |
| 157 | unsigned long d0, d1, d2, d3, d6, d7; | 157 | unsigned long d0, d1, d2, d3, d6, d7; |
| @@ -160,59 +160,61 @@ void __show_regs(struct pt_regs * regs) | |||
| 160 | 160 | ||
| 161 | printk("\n"); | 161 | printk("\n"); |
| 162 | print_modules(); | 162 | print_modules(); |
| 163 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", | 163 | printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s\n", |
| 164 | current->pid, current->comm, print_tainted(), | 164 | current->pid, current->comm, print_tainted(), |
| 165 | init_utsname()->release, | 165 | init_utsname()->release, |
| 166 | (int)strcspn(init_utsname()->version, " "), | 166 | (int)strcspn(init_utsname()->version, " "), |
| 167 | init_utsname()->version); | 167 | init_utsname()->version); |
| 168 | printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); | 168 | printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); |
| 169 | printk_address(regs->ip, 1); | 169 | printk_address(regs->ip, 1); |
| 170 | printk("RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->sp, | 170 | printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, |
| 171 | regs->flags); | 171 | regs->sp, regs->flags); |
| 172 | printk("RAX: %016lx RBX: %016lx RCX: %016lx\n", | 172 | printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n", |
| 173 | regs->ax, regs->bx, regs->cx); | 173 | regs->ax, regs->bx, regs->cx); |
| 174 | printk("RDX: %016lx RSI: %016lx RDI: %016lx\n", | 174 | printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n", |
| 175 | regs->dx, regs->si, regs->di); | 175 | regs->dx, regs->si, regs->di); |
| 176 | printk("RBP: %016lx R08: %016lx R09: %016lx\n", | 176 | printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n", |
| 177 | regs->bp, regs->r8, regs->r9); | 177 | regs->bp, regs->r8, regs->r9); |
| 178 | printk("R10: %016lx R11: %016lx R12: %016lx\n", | 178 | printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n", |
| 179 | regs->r10, regs->r11, regs->r12); | 179 | regs->r10, regs->r11, regs->r12); |
| 180 | printk("R13: %016lx R14: %016lx R15: %016lx\n", | 180 | printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n", |
| 181 | regs->r13, regs->r14, regs->r15); | 181 | regs->r13, regs->r14, regs->r15); |
| 182 | 182 | ||
| 183 | asm("movl %%ds,%0" : "=r" (ds)); | 183 | asm("movl %%ds,%0" : "=r" (ds)); |
| 184 | asm("movl %%cs,%0" : "=r" (cs)); | 184 | asm("movl %%cs,%0" : "=r" (cs)); |
| 185 | asm("movl %%es,%0" : "=r" (es)); | 185 | asm("movl %%es,%0" : "=r" (es)); |
| 186 | asm("movl %%fs,%0" : "=r" (fsindex)); | 186 | asm("movl %%fs,%0" : "=r" (fsindex)); |
| 187 | asm("movl %%gs,%0" : "=r" (gsindex)); | 187 | asm("movl %%gs,%0" : "=r" (gsindex)); |
| 188 | 188 | ||
| 189 | rdmsrl(MSR_FS_BASE, fs); | 189 | rdmsrl(MSR_FS_BASE, fs); |
| 190 | rdmsrl(MSR_GS_BASE, gs); | 190 | rdmsrl(MSR_GS_BASE, gs); |
| 191 | rdmsrl(MSR_KERNEL_GS_BASE, shadowgs); | 191 | rdmsrl(MSR_KERNEL_GS_BASE, shadowgs); |
| 192 | 192 | ||
| 193 | cr0 = read_cr0(); | 193 | cr0 = read_cr0(); |
| 194 | cr2 = read_cr2(); | 194 | cr2 = read_cr2(); |
| 195 | cr3 = read_cr3(); | 195 | cr3 = read_cr3(); |
| 196 | cr4 = read_cr4(); | 196 | cr4 = read_cr4(); |
| 197 | 197 | ||
| 198 | printk("FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", | 198 | printk(KERN_INFO "FS: %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n", |
| 199 | fs,fsindex,gs,gsindex,shadowgs); | 199 | fs, fsindex, gs, gsindex, shadowgs); |
| 200 | printk("CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds, es, cr0); | 200 | printk(KERN_INFO "CS: %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds, |
| 201 | printk("CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, cr4); | 201 | es, cr0); |
| 202 | printk(KERN_INFO "CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, | ||
| 203 | cr4); | ||
| 202 | 204 | ||
| 203 | get_debugreg(d0, 0); | 205 | get_debugreg(d0, 0); |
| 204 | get_debugreg(d1, 1); | 206 | get_debugreg(d1, 1); |
| 205 | get_debugreg(d2, 2); | 207 | get_debugreg(d2, 2); |
| 206 | printk("DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2); | 208 | printk(KERN_INFO "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2); |
| 207 | get_debugreg(d3, 3); | 209 | get_debugreg(d3, 3); |
| 208 | get_debugreg(d6, 6); | 210 | get_debugreg(d6, 6); |
| 209 | get_debugreg(d7, 7); | 211 | get_debugreg(d7, 7); |
| 210 | printk("DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); | 212 | printk(KERN_INFO "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7); |
| 211 | } | 213 | } |
| 212 | 214 | ||
| 213 | void show_regs(struct pt_regs *regs) | 215 | void show_regs(struct pt_regs *regs) |
| 214 | { | 216 | { |
| 215 | printk("CPU %d:", smp_processor_id()); | 217 | printk(KERN_INFO "CPU %d:", smp_processor_id()); |
| 216 | __show_regs(regs); | 218 | __show_regs(regs); |
| 217 | show_trace(NULL, regs, (void *)(regs + 1), regs->bp); | 219 | show_trace(NULL, regs, (void *)(regs + 1), regs->bp); |
| 218 | } | 220 | } |
| @@ -313,10 +315,10 @@ void prepare_to_copy(struct task_struct *tsk) | |||
| 313 | 315 | ||
| 314 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 316 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, |
| 315 | unsigned long unused, | 317 | unsigned long unused, |
| 316 | struct task_struct * p, struct pt_regs * regs) | 318 | struct task_struct *p, struct pt_regs *regs) |
| 317 | { | 319 | { |
| 318 | int err; | 320 | int err; |
| 319 | struct pt_regs * childregs; | 321 | struct pt_regs *childregs; |
| 320 | struct task_struct *me = current; | 322 | struct task_struct *me = current; |
| 321 | 323 | ||
| 322 | childregs = ((struct pt_regs *) | 324 | childregs = ((struct pt_regs *) |
| @@ -361,10 +363,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
| 361 | if (test_thread_flag(TIF_IA32)) | 363 | if (test_thread_flag(TIF_IA32)) |
| 362 | err = do_set_thread_area(p, -1, | 364 | err = do_set_thread_area(p, -1, |
| 363 | (struct user_desc __user *)childregs->si, 0); | 365 | (struct user_desc __user *)childregs->si, 0); |
| 364 | else | 366 | else |
| 365 | #endif | 367 | #endif |
| 366 | err = do_arch_prctl(p, ARCH_SET_FS, childregs->r8); | 368 | err = do_arch_prctl(p, ARCH_SET_FS, childregs->r8); |
| 367 | if (err) | 369 | if (err) |
| 368 | goto out; | 370 | goto out; |
| 369 | } | 371 | } |
| 370 | err = 0; | 372 | err = 0; |
| @@ -543,7 +545,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
| 543 | unsigned fsindex, gsindex; | 545 | unsigned fsindex, gsindex; |
| 544 | 546 | ||
| 545 | /* we're going to use this soon, after a few expensive things */ | 547 | /* we're going to use this soon, after a few expensive things */ |
| 546 | if (next_p->fpu_counter>5) | 548 | if (next_p->fpu_counter > 5) |
| 547 | prefetch(next->xstate); | 549 | prefetch(next->xstate); |
| 548 | 550 | ||
| 549 | /* | 551 | /* |
| @@ -551,13 +553,13 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
| 551 | */ | 553 | */ |
| 552 | load_sp0(tss, next); | 554 | load_sp0(tss, next); |
| 553 | 555 | ||
| 554 | /* | 556 | /* |
| 555 | * Switch DS and ES. | 557 | * Switch DS and ES. |
| 556 | * This won't pick up thread selector changes, but I guess that is ok. | 558 | * This won't pick up thread selector changes, but I guess that is ok. |
| 557 | */ | 559 | */ |
| 558 | savesegment(es, prev->es); | 560 | savesegment(es, prev->es); |
| 559 | if (unlikely(next->es | prev->es)) | 561 | if (unlikely(next->es | prev->es)) |
| 560 | loadsegment(es, next->es); | 562 | loadsegment(es, next->es); |
| 561 | 563 | ||
| 562 | savesegment(ds, prev->ds); | 564 | savesegment(ds, prev->ds); |
| 563 | if (unlikely(next->ds | prev->ds)) | 565 | if (unlikely(next->ds | prev->ds)) |
| @@ -583,7 +585,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
| 583 | */ | 585 | */ |
| 584 | arch_leave_lazy_cpu_mode(); | 586 | arch_leave_lazy_cpu_mode(); |
| 585 | 587 | ||
| 586 | /* | 588 | /* |
| 587 | * Switch FS and GS. | 589 | * Switch FS and GS. |
| 588 | * | 590 | * |
| 589 | * Segment register != 0 always requires a reload. Also | 591 | * Segment register != 0 always requires a reload. Also |
| @@ -592,13 +594,13 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
| 592 | */ | 594 | */ |
| 593 | if (unlikely(fsindex | next->fsindex | prev->fs)) { | 595 | if (unlikely(fsindex | next->fsindex | prev->fs)) { |
| 594 | loadsegment(fs, next->fsindex); | 596 | loadsegment(fs, next->fsindex); |
| 595 | /* | 597 | /* |
| 596 | * Check if the user used a selector != 0; if yes | 598 | * Check if the user used a selector != 0; if yes |
| 597 | * clear 64bit base, since overloaded base is always | 599 | * clear 64bit base, since overloaded base is always |
| 598 | * mapped to the Null selector | 600 | * mapped to the Null selector |
| 599 | */ | 601 | */ |
| 600 | if (fsindex) | 602 | if (fsindex) |
| 601 | prev->fs = 0; | 603 | prev->fs = 0; |
| 602 | } | 604 | } |
| 603 | /* when next process has a 64bit base use it */ | 605 | /* when next process has a 64bit base use it */ |
| 604 | if (next->fs) | 606 | if (next->fs) |
| @@ -608,7 +610,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
| 608 | if (unlikely(gsindex | next->gsindex | prev->gs)) { | 610 | if (unlikely(gsindex | next->gsindex | prev->gs)) { |
| 609 | load_gs_index(next->gsindex); | 611 | load_gs_index(next->gsindex); |
| 610 | if (gsindex) | 612 | if (gsindex) |
| 611 | prev->gs = 0; | 613 | prev->gs = 0; |
| 612 | } | 614 | } |
| 613 | if (next->gs) | 615 | if (next->gs) |
| 614 | wrmsrl(MSR_KERNEL_GS_BASE, next->gs); | 616 | wrmsrl(MSR_KERNEL_GS_BASE, next->gs); |
| @@ -617,12 +619,12 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
| 617 | /* Must be after DS reload */ | 619 | /* Must be after DS reload */ |
| 618 | unlazy_fpu(prev_p); | 620 | unlazy_fpu(prev_p); |
| 619 | 621 | ||
| 620 | /* | 622 | /* |
| 621 | * Switch the PDA and FPU contexts. | 623 | * Switch the PDA and FPU contexts. |
| 622 | */ | 624 | */ |
| 623 | prev->usersp = read_pda(oldrsp); | 625 | prev->usersp = read_pda(oldrsp); |
| 624 | write_pda(oldrsp, next->usersp); | 626 | write_pda(oldrsp, next->usersp); |
| 625 | write_pda(pcurrent, next_p); | 627 | write_pda(pcurrent, next_p); |
| 626 | 628 | ||
| 627 | write_pda(kernelstack, | 629 | write_pda(kernelstack, |
| 628 | (unsigned long)task_stack_page(next_p) + | 630 | (unsigned long)task_stack_page(next_p) + |
| @@ -663,7 +665,7 @@ long sys_execve(char __user *name, char __user * __user *argv, | |||
| 663 | char __user * __user *envp, struct pt_regs *regs) | 665 | char __user * __user *envp, struct pt_regs *regs) |
| 664 | { | 666 | { |
| 665 | long error; | 667 | long error; |
| 666 | char * filename; | 668 | char *filename; |
| 667 | 669 | ||
| 668 | filename = getname(name); | 670 | filename = getname(name); |
| 669 | error = PTR_ERR(filename); | 671 | error = PTR_ERR(filename); |
| @@ -721,55 +723,55 @@ asmlinkage long sys_vfork(struct pt_regs *regs) | |||
| 721 | unsigned long get_wchan(struct task_struct *p) | 723 | unsigned long get_wchan(struct task_struct *p) |
| 722 | { | 724 | { |
| 723 | unsigned long stack; | 725 | unsigned long stack; |
| 724 | u64 fp,ip; | 726 | u64 fp, ip; |
| 725 | int count = 0; | 727 | int count = 0; |
| 726 | 728 | ||
| 727 | if (!p || p == current || p->state==TASK_RUNNING) | 729 | if (!p || p == current || p->state == TASK_RUNNING) |
| 728 | return 0; | 730 | return 0; |
| 729 | stack = (unsigned long)task_stack_page(p); | 731 | stack = (unsigned long)task_stack_page(p); |
| 730 | if (p->thread.sp < stack || p->thread.sp > stack+THREAD_SIZE) | 732 | if (p->thread.sp < stack || p->thread.sp > stack+THREAD_SIZE) |
| 731 | return 0; | 733 | return 0; |
| 732 | fp = *(u64 *)(p->thread.sp); | 734 | fp = *(u64 *)(p->thread.sp); |
| 733 | do { | 735 | do { |
| 734 | if (fp < (unsigned long)stack || | 736 | if (fp < (unsigned long)stack || |
| 735 | fp > (unsigned long)stack+THREAD_SIZE) | 737 | fp > (unsigned long)stack+THREAD_SIZE) |
| 736 | return 0; | 738 | return 0; |
| 737 | ip = *(u64 *)(fp+8); | 739 | ip = *(u64 *)(fp+8); |
| 738 | if (!in_sched_functions(ip)) | 740 | if (!in_sched_functions(ip)) |
| 739 | return ip; | 741 | return ip; |
| 740 | fp = *(u64 *)fp; | 742 | fp = *(u64 *)fp; |
| 741 | } while (count++ < 16); | 743 | } while (count++ < 16); |
| 742 | return 0; | 744 | return 0; |
| 743 | } | 745 | } |
| 744 | 746 | ||
| 745 | long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) | 747 | long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) |
| 746 | { | 748 | { |
| 747 | int ret = 0; | 749 | int ret = 0; |
| 748 | int doit = task == current; | 750 | int doit = task == current; |
| 749 | int cpu; | 751 | int cpu; |
| 750 | 752 | ||
| 751 | switch (code) { | 753 | switch (code) { |
| 752 | case ARCH_SET_GS: | 754 | case ARCH_SET_GS: |
| 753 | if (addr >= TASK_SIZE_OF(task)) | 755 | if (addr >= TASK_SIZE_OF(task)) |
| 754 | return -EPERM; | 756 | return -EPERM; |
| 755 | cpu = get_cpu(); | 757 | cpu = get_cpu(); |
| 756 | /* handle small bases via the GDT because that's faster to | 758 | /* handle small bases via the GDT because that's faster to |
| 757 | switch. */ | 759 | switch. */ |
| 758 | if (addr <= 0xffffffff) { | 760 | if (addr <= 0xffffffff) { |
| 759 | set_32bit_tls(task, GS_TLS, addr); | 761 | set_32bit_tls(task, GS_TLS, addr); |
| 760 | if (doit) { | 762 | if (doit) { |
| 761 | load_TLS(&task->thread, cpu); | 763 | load_TLS(&task->thread, cpu); |
| 762 | load_gs_index(GS_TLS_SEL); | 764 | load_gs_index(GS_TLS_SEL); |
| 763 | } | 765 | } |
| 764 | task->thread.gsindex = GS_TLS_SEL; | 766 | task->thread.gsindex = GS_TLS_SEL; |
| 765 | task->thread.gs = 0; | 767 | task->thread.gs = 0; |
| 766 | } else { | 768 | } else { |
| 767 | task->thread.gsindex = 0; | 769 | task->thread.gsindex = 0; |
| 768 | task->thread.gs = addr; | 770 | task->thread.gs = addr; |
| 769 | if (doit) { | 771 | if (doit) { |
| 770 | load_gs_index(0); | 772 | load_gs_index(0); |
| 771 | ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); | 773 | ret = checking_wrmsrl(MSR_KERNEL_GS_BASE, addr); |
| 772 | } | 774 | } |
| 773 | } | 775 | } |
| 774 | put_cpu(); | 776 | put_cpu(); |
| 775 | break; | 777 | break; |
| @@ -823,8 +825,7 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) | |||
| 823 | rdmsrl(MSR_KERNEL_GS_BASE, base); | 825 | rdmsrl(MSR_KERNEL_GS_BASE, base); |
| 824 | else | 826 | else |
| 825 | base = task->thread.gs; | 827 | base = task->thread.gs; |
| 826 | } | 828 | } else |
| 827 | else | ||
| 828 | base = task->thread.gs; | 829 | base = task->thread.gs; |
| 829 | ret = put_user(base, (unsigned long __user *)addr); | 830 | ret = put_user(base, (unsigned long __user *)addr); |
| 830 | break; | 831 | break; |
diff --git a/arch/x86/kernel/sigframe.h b/arch/x86/kernel/sigframe.h index 72bbb519d2dc..8b4956e800ac 100644 --- a/arch/x86/kernel/sigframe.h +++ b/arch/x86/kernel/sigframe.h | |||
| @@ -24,4 +24,9 @@ struct rt_sigframe { | |||
| 24 | struct ucontext uc; | 24 | struct ucontext uc; |
| 25 | struct siginfo info; | 25 | struct siginfo info; |
| 26 | }; | 26 | }; |
| 27 | |||
| 28 | int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | ||
| 29 | sigset_t *set, struct pt_regs *regs); | ||
| 30 | int ia32_setup_frame(int sig, struct k_sigaction *ka, | ||
| 31 | sigset_t *set, struct pt_regs *regs); | ||
| 27 | #endif | 32 | #endif |
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c index ca316b5b742c..162da796a323 100644 --- a/arch/x86/kernel/signal_64.c +++ b/arch/x86/kernel/signal_64.c | |||
| @@ -19,9 +19,10 @@ | |||
| 19 | #include <linux/stddef.h> | 19 | #include <linux/stddef.h> |
| 20 | #include <linux/personality.h> | 20 | #include <linux/personality.h> |
| 21 | #include <linux/compiler.h> | 21 | #include <linux/compiler.h> |
| 22 | #include <linux/uaccess.h> | ||
| 23 | |||
| 22 | #include <asm/processor.h> | 24 | #include <asm/processor.h> |
| 23 | #include <asm/ucontext.h> | 25 | #include <asm/ucontext.h> |
| 24 | #include <asm/uaccess.h> | ||
| 25 | #include <asm/i387.h> | 26 | #include <asm/i387.h> |
| 26 | #include <asm/proto.h> | 27 | #include <asm/proto.h> |
| 27 | #include <asm/ia32_unistd.h> | 28 | #include <asm/ia32_unistd.h> |
| @@ -41,11 +42,6 @@ | |||
| 41 | # define FIX_EFLAGS __FIX_EFLAGS | 42 | # define FIX_EFLAGS __FIX_EFLAGS |
| 42 | #endif | 43 | #endif |
| 43 | 44 | ||
| 44 | int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | ||
| 45 | sigset_t *set, struct pt_regs * regs); | ||
| 46 | int ia32_setup_frame(int sig, struct k_sigaction *ka, | ||
| 47 | sigset_t *set, struct pt_regs * regs); | ||
| 48 | |||
| 49 | asmlinkage long | 45 | asmlinkage long |
| 50 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 46 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
| 51 | struct pt_regs *regs) | 47 | struct pt_regs *regs) |
| @@ -128,7 +124,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, | |||
| 128 | /* Always make any pending restarted system calls return -EINTR */ | 124 | /* Always make any pending restarted system calls return -EINTR */ |
| 129 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | 125 | current_thread_info()->restart_block.fn = do_no_restart_syscall; |
| 130 | 126 | ||
| 131 | #define COPY(x) err |= __get_user(regs->x, &sc->x) | 127 | #define COPY(x) (err |= __get_user(regs->x, &sc->x)) |
| 132 | 128 | ||
| 133 | COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); | 129 | COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); |
| 134 | COPY(dx); COPY(cx); COPY(ip); | 130 | COPY(dx); COPY(cx); COPY(ip); |
| @@ -158,7 +154,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, | |||
| 158 | } | 154 | } |
| 159 | 155 | ||
| 160 | { | 156 | { |
| 161 | struct _fpstate __user * buf; | 157 | struct _fpstate __user *buf; |
| 162 | err |= __get_user(buf, &sc->fpstate); | 158 | err |= __get_user(buf, &sc->fpstate); |
| 163 | 159 | ||
| 164 | if (buf) { | 160 | if (buf) { |
| @@ -198,7 +194,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) | |||
| 198 | current->blocked = set; | 194 | current->blocked = set; |
| 199 | recalc_sigpending(); | 195 | recalc_sigpending(); |
| 200 | spin_unlock_irq(¤t->sighand->siglock); | 196 | spin_unlock_irq(¤t->sighand->siglock); |
| 201 | 197 | ||
| 202 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) | 198 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) |
| 203 | goto badframe; | 199 | goto badframe; |
| 204 | 200 | ||
| @@ -208,16 +204,17 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) | |||
| 208 | return ax; | 204 | return ax; |
| 209 | 205 | ||
| 210 | badframe: | 206 | badframe: |
| 211 | signal_fault(regs,frame,"sigreturn"); | 207 | signal_fault(regs, frame, "sigreturn"); |
| 212 | return 0; | 208 | return 0; |
| 213 | } | 209 | } |
| 214 | 210 | ||
| 215 | /* | 211 | /* |
| 216 | * Set up a signal frame. | 212 | * Set up a signal frame. |
| 217 | */ | 213 | */ |
| 218 | 214 | ||
| 219 | static inline int | 215 | static inline int |
| 220 | setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask, struct task_struct *me) | 216 | setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, |
| 217 | unsigned long mask, struct task_struct *me) | ||
| 221 | { | 218 | { |
| 222 | int err = 0; | 219 | int err = 0; |
| 223 | 220 | ||
| @@ -273,35 +270,35 @@ get_stack(struct k_sigaction *ka, struct pt_regs *regs, unsigned long size) | |||
| 273 | } | 270 | } |
| 274 | 271 | ||
| 275 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | 272 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, |
| 276 | sigset_t *set, struct pt_regs * regs) | 273 | sigset_t *set, struct pt_regs *regs) |
| 277 | { | 274 | { |
| 278 | struct rt_sigframe __user *frame; | 275 | struct rt_sigframe __user *frame; |
| 279 | struct _fpstate __user *fp = NULL; | 276 | struct _fpstate __user *fp = NULL; |
| 280 | int err = 0; | 277 | int err = 0; |
| 281 | struct task_struct *me = current; | 278 | struct task_struct *me = current; |
| 282 | 279 | ||
| 283 | if (used_math()) { | 280 | if (used_math()) { |
| 284 | fp = get_stack(ka, regs, sizeof(struct _fpstate)); | 281 | fp = get_stack(ka, regs, sizeof(struct _fpstate)); |
| 285 | frame = (void __user *)round_down( | 282 | frame = (void __user *)round_down( |
| 286 | (unsigned long)fp - sizeof(struct rt_sigframe), 16) - 8; | 283 | (unsigned long)fp - sizeof(struct rt_sigframe), 16) - 8; |
| 287 | 284 | ||
| 288 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) | 285 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) |
| 289 | goto give_sigsegv; | 286 | goto give_sigsegv; |
| 290 | 287 | ||
| 291 | if (save_i387(fp) < 0) | 288 | if (save_i387(fp) < 0) |
| 292 | err |= -1; | 289 | err |= -1; |
| 293 | } else | 290 | } else |
| 294 | frame = get_stack(ka, regs, sizeof(struct rt_sigframe)) - 8; | 291 | frame = get_stack(ka, regs, sizeof(struct rt_sigframe)) - 8; |
| 295 | 292 | ||
| 296 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 293 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
| 297 | goto give_sigsegv; | 294 | goto give_sigsegv; |
| 298 | 295 | ||
| 299 | if (ka->sa.sa_flags & SA_SIGINFO) { | 296 | if (ka->sa.sa_flags & SA_SIGINFO) { |
| 300 | err |= copy_siginfo_to_user(&frame->info, info); | 297 | err |= copy_siginfo_to_user(&frame->info, info); |
| 301 | if (err) | 298 | if (err) |
| 302 | goto give_sigsegv; | 299 | goto give_sigsegv; |
| 303 | } | 300 | } |
| 304 | 301 | ||
| 305 | /* Create the ucontext. */ | 302 | /* Create the ucontext. */ |
| 306 | err |= __put_user(0, &frame->uc.uc_flags); | 303 | err |= __put_user(0, &frame->uc.uc_flags); |
| 307 | err |= __put_user(0, &frame->uc.uc_link); | 304 | err |= __put_user(0, &frame->uc.uc_link); |
| @@ -311,9 +308,9 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 311 | err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size); | 308 | err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size); |
| 312 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0], me); | 309 | err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0], me); |
| 313 | err |= __put_user(fp, &frame->uc.uc_mcontext.fpstate); | 310 | err |= __put_user(fp, &frame->uc.uc_mcontext.fpstate); |
| 314 | if (sizeof(*set) == 16) { | 311 | if (sizeof(*set) == 16) { |
| 315 | __put_user(set->sig[0], &frame->uc.uc_sigmask.sig[0]); | 312 | __put_user(set->sig[0], &frame->uc.uc_sigmask.sig[0]); |
| 316 | __put_user(set->sig[1], &frame->uc.uc_sigmask.sig[1]); | 313 | __put_user(set->sig[1], &frame->uc.uc_sigmask.sig[1]); |
| 317 | } else | 314 | } else |
| 318 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); | 315 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
| 319 | 316 | ||
| @@ -324,7 +321,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 324 | err |= __put_user(ka->sa.sa_restorer, &frame->pretcode); | 321 | err |= __put_user(ka->sa.sa_restorer, &frame->pretcode); |
| 325 | } else { | 322 | } else { |
| 326 | /* could use a vstub here */ | 323 | /* could use a vstub here */ |
| 327 | goto give_sigsegv; | 324 | goto give_sigsegv; |
| 328 | } | 325 | } |
| 329 | 326 | ||
| 330 | if (err) | 327 | if (err) |
| @@ -332,7 +329,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 332 | 329 | ||
| 333 | /* Set up registers for signal handler */ | 330 | /* Set up registers for signal handler */ |
| 334 | regs->di = sig; | 331 | regs->di = sig; |
| 335 | /* In case the signal handler was declared without prototypes */ | 332 | /* In case the signal handler was declared without prototypes */ |
| 336 | regs->ax = 0; | 333 | regs->ax = 0; |
| 337 | 334 | ||
| 338 | /* This also works for non SA_SIGINFO handlers because they expect the | 335 | /* This also works for non SA_SIGINFO handlers because they expect the |
| @@ -385,7 +382,7 @@ static long current_syscall_ret(struct pt_regs *regs) | |||
| 385 | 382 | ||
| 386 | /* | 383 | /* |
| 387 | * OK, we're invoking a handler | 384 | * OK, we're invoking a handler |
| 388 | */ | 385 | */ |
| 389 | 386 | ||
| 390 | static int | 387 | static int |
| 391 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | 388 | handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, |
| @@ -429,7 +426,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
| 429 | ret = ia32_setup_rt_frame(sig, ka, info, oldset, regs); | 426 | ret = ia32_setup_rt_frame(sig, ka, info, oldset, regs); |
| 430 | else | 427 | else |
| 431 | ret = ia32_setup_frame(sig, ka, oldset, regs); | 428 | ret = ia32_setup_frame(sig, ka, oldset, regs); |
| 432 | } else | 429 | } else |
| 433 | #endif | 430 | #endif |
| 434 | ret = setup_rt_frame(sig, ka, info, oldset, regs); | 431 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
| 435 | 432 | ||
| @@ -457,9 +454,9 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
| 457 | ptrace_notify(SIGTRAP); | 454 | ptrace_notify(SIGTRAP); |
| 458 | 455 | ||
| 459 | spin_lock_irq(¤t->sighand->siglock); | 456 | spin_lock_irq(¤t->sighand->siglock); |
| 460 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | 457 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); |
| 461 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 458 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
| 462 | sigaddset(¤t->blocked,sig); | 459 | sigaddset(¤t->blocked, sig); |
| 463 | recalc_sigpending(); | 460 | recalc_sigpending(); |
| 464 | spin_unlock_irq(¤t->sighand->siglock); | 461 | spin_unlock_irq(¤t->sighand->siglock); |
| 465 | } | 462 | } |
| @@ -561,14 +558,15 @@ void do_notify_resume(struct pt_regs *regs, void *unused, | |||
| 561 | } | 558 | } |
| 562 | 559 | ||
| 563 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where) | 560 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where) |
| 564 | { | 561 | { |
| 565 | struct task_struct *me = current; | 562 | struct task_struct *me = current; |
| 566 | if (show_unhandled_signals && printk_ratelimit()) { | 563 | if (show_unhandled_signals && printk_ratelimit()) { |
| 567 | printk("%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx", | 564 | printk("%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx", |
| 568 | me->comm,me->pid,where,frame,regs->ip,regs->sp,regs->orig_ax); | 565 | me->comm, me->pid, where, frame, regs->ip, |
| 566 | regs->sp, regs->orig_ax); | ||
| 569 | print_vma_addr(" in ", regs->ip); | 567 | print_vma_addr(" in ", regs->ip); |
| 570 | printk("\n"); | 568 | printk("\n"); |
| 571 | } | 569 | } |
| 572 | 570 | ||
| 573 | force_sig(SIGSEGV, me); | 571 | force_sig(SIGSEGV, me); |
| 574 | } | 572 | } |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index e139e617f422..18a2350deacd 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -1310,16 +1310,13 @@ __init void prefill_possible_map(void) | |||
| 1310 | if (!num_processors) | 1310 | if (!num_processors) |
| 1311 | num_processors = 1; | 1311 | num_processors = 1; |
| 1312 | 1312 | ||
| 1313 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 1314 | if (additional_cpus == -1) { | 1313 | if (additional_cpus == -1) { |
| 1315 | if (disabled_cpus > 0) | 1314 | if (disabled_cpus > 0) |
| 1316 | additional_cpus = disabled_cpus; | 1315 | additional_cpus = disabled_cpus; |
| 1317 | else | 1316 | else |
| 1318 | additional_cpus = 0; | 1317 | additional_cpus = 0; |
| 1319 | } | 1318 | } |
| 1320 | #else | 1319 | |
| 1321 | additional_cpus = 0; | ||
| 1322 | #endif | ||
| 1323 | possible = num_processors + additional_cpus; | 1320 | possible = num_processors + additional_cpus; |
| 1324 | if (possible > NR_CPUS) | 1321 | if (possible > NR_CPUS) |
| 1325 | possible = NR_CPUS; | 1322 | possible = NR_CPUS; |
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c index 3b360ef33817..56eb8f916e9f 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c | |||
| @@ -13,15 +13,16 @@ | |||
| 13 | #include <linux/utsname.h> | 13 | #include <linux/utsname.h> |
| 14 | #include <linux/personality.h> | 14 | #include <linux/personality.h> |
| 15 | #include <linux/random.h> | 15 | #include <linux/random.h> |
| 16 | #include <linux/uaccess.h> | ||
| 16 | 17 | ||
| 17 | #include <asm/uaccess.h> | ||
| 18 | #include <asm/ia32.h> | 18 | #include <asm/ia32.h> |
| 19 | 19 | ||
| 20 | asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, | 20 | asmlinkage long sys_mmap(unsigned long addr, unsigned long len, |
| 21 | unsigned long fd, unsigned long off) | 21 | unsigned long prot, unsigned long flags, |
| 22 | unsigned long fd, unsigned long off) | ||
| 22 | { | 23 | { |
| 23 | long error; | 24 | long error; |
| 24 | struct file * file; | 25 | struct file *file; |
| 25 | 26 | ||
| 26 | error = -EINVAL; | 27 | error = -EINVAL; |
| 27 | if (off & ~PAGE_MASK) | 28 | if (off & ~PAGE_MASK) |
| @@ -56,9 +57,9 @@ static void find_start_end(unsigned long flags, unsigned long *begin, | |||
| 56 | unmapped base down for this case. This can give | 57 | unmapped base down for this case. This can give |
| 57 | conflicts with the heap, but we assume that glibc | 58 | conflicts with the heap, but we assume that glibc |
| 58 | malloc knows how to fall back to mmap. Give it 1GB | 59 | malloc knows how to fall back to mmap. Give it 1GB |
| 59 | of playground for now. -AK */ | 60 | of playground for now. -AK */ |
| 60 | *begin = 0x40000000; | 61 | *begin = 0x40000000; |
| 61 | *end = 0x80000000; | 62 | *end = 0x80000000; |
| 62 | if (current->flags & PF_RANDOMIZE) { | 63 | if (current->flags & PF_RANDOMIZE) { |
| 63 | new_begin = randomize_range(*begin, *begin + 0x02000000, 0); | 64 | new_begin = randomize_range(*begin, *begin + 0x02000000, 0); |
| 64 | if (new_begin) | 65 | if (new_begin) |
| @@ -66,9 +67,9 @@ static void find_start_end(unsigned long flags, unsigned long *begin, | |||
| 66 | } | 67 | } |
| 67 | } else { | 68 | } else { |
| 68 | *begin = TASK_UNMAPPED_BASE; | 69 | *begin = TASK_UNMAPPED_BASE; |
| 69 | *end = TASK_SIZE; | 70 | *end = TASK_SIZE; |
| 70 | } | 71 | } |
| 71 | } | 72 | } |
| 72 | 73 | ||
| 73 | unsigned long | 74 | unsigned long |
| 74 | arch_get_unmapped_area(struct file *filp, unsigned long addr, | 75 | arch_get_unmapped_area(struct file *filp, unsigned long addr, |
| @@ -78,11 +79,11 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
| 78 | struct vm_area_struct *vma; | 79 | struct vm_area_struct *vma; |
| 79 | unsigned long start_addr; | 80 | unsigned long start_addr; |
| 80 | unsigned long begin, end; | 81 | unsigned long begin, end; |
| 81 | 82 | ||
| 82 | if (flags & MAP_FIXED) | 83 | if (flags & MAP_FIXED) |
| 83 | return addr; | 84 | return addr; |
| 84 | 85 | ||
| 85 | find_start_end(flags, &begin, &end); | 86 | find_start_end(flags, &begin, &end); |
| 86 | 87 | ||
| 87 | if (len > end) | 88 | if (len > end) |
| 88 | return -ENOMEM; | 89 | return -ENOMEM; |
| @@ -96,12 +97,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
| 96 | } | 97 | } |
| 97 | if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32)) | 98 | if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32)) |
| 98 | && len <= mm->cached_hole_size) { | 99 | && len <= mm->cached_hole_size) { |
| 99 | mm->cached_hole_size = 0; | 100 | mm->cached_hole_size = 0; |
| 100 | mm->free_area_cache = begin; | 101 | mm->free_area_cache = begin; |
| 101 | } | 102 | } |
| 102 | addr = mm->free_area_cache; | 103 | addr = mm->free_area_cache; |
| 103 | if (addr < begin) | 104 | if (addr < begin) |
| 104 | addr = begin; | 105 | addr = begin; |
| 105 | start_addr = addr; | 106 | start_addr = addr; |
| 106 | 107 | ||
| 107 | full_search: | 108 | full_search: |
| @@ -127,7 +128,7 @@ full_search: | |||
| 127 | return addr; | 128 | return addr; |
| 128 | } | 129 | } |
| 129 | if (addr + mm->cached_hole_size < vma->vm_start) | 130 | if (addr + mm->cached_hole_size < vma->vm_start) |
| 130 | mm->cached_hole_size = vma->vm_start - addr; | 131 | mm->cached_hole_size = vma->vm_start - addr; |
| 131 | 132 | ||
| 132 | addr = vma->vm_end; | 133 | addr = vma->vm_end; |
| 133 | } | 134 | } |
| @@ -177,7 +178,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, | |||
| 177 | vma = find_vma(mm, addr-len); | 178 | vma = find_vma(mm, addr-len); |
| 178 | if (!vma || addr <= vma->vm_start) | 179 | if (!vma || addr <= vma->vm_start) |
| 179 | /* remember the address as a hint for next time */ | 180 | /* remember the address as a hint for next time */ |
| 180 | return (mm->free_area_cache = addr-len); | 181 | return mm->free_area_cache = addr-len; |
| 181 | } | 182 | } |
| 182 | 183 | ||
| 183 | if (mm->mmap_base < len) | 184 | if (mm->mmap_base < len) |
| @@ -194,7 +195,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, | |||
| 194 | vma = find_vma(mm, addr); | 195 | vma = find_vma(mm, addr); |
| 195 | if (!vma || addr+len <= vma->vm_start) | 196 | if (!vma || addr+len <= vma->vm_start) |
| 196 | /* remember the address as a hint for next time */ | 197 | /* remember the address as a hint for next time */ |
| 197 | return (mm->free_area_cache = addr); | 198 | return mm->free_area_cache = addr; |
| 198 | 199 | ||
| 199 | /* remember the largest hole we saw so far */ | 200 | /* remember the largest hole we saw so far */ |
| 200 | if (addr + mm->cached_hole_size < vma->vm_start) | 201 | if (addr + mm->cached_hole_size < vma->vm_start) |
| @@ -224,13 +225,13 @@ bottomup: | |||
| 224 | } | 225 | } |
| 225 | 226 | ||
| 226 | 227 | ||
| 227 | asmlinkage long sys_uname(struct new_utsname __user * name) | 228 | asmlinkage long sys_uname(struct new_utsname __user *name) |
| 228 | { | 229 | { |
| 229 | int err; | 230 | int err; |
| 230 | down_read(&uts_sem); | 231 | down_read(&uts_sem); |
| 231 | err = copy_to_user(name, utsname(), sizeof (*name)); | 232 | err = copy_to_user(name, utsname(), sizeof(*name)); |
| 232 | up_read(&uts_sem); | 233 | up_read(&uts_sem); |
| 233 | if (personality(current->personality) == PER_LINUX32) | 234 | if (personality(current->personality) == PER_LINUX32) |
| 234 | err |= copy_to_user(&name->machine, "i686", 5); | 235 | err |= copy_to_user(&name->machine, "i686", 5); |
| 235 | return err ? -EFAULT : 0; | 236 | return err ? -EFAULT : 0; |
| 236 | } | 237 | } |
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index 513caaca7115..d4fb6c15dc45 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
| @@ -32,6 +32,8 @@ | |||
| 32 | #include <linux/bug.h> | 32 | #include <linux/bug.h> |
| 33 | #include <linux/nmi.h> | 33 | #include <linux/nmi.h> |
| 34 | #include <linux/mm.h> | 34 | #include <linux/mm.h> |
| 35 | #include <linux/smp.h> | ||
| 36 | #include <linux/io.h> | ||
| 35 | 37 | ||
| 36 | #if defined(CONFIG_EDAC) | 38 | #if defined(CONFIG_EDAC) |
| 37 | #include <linux/edac.h> | 39 | #include <linux/edac.h> |
| @@ -45,9 +47,6 @@ | |||
| 45 | #include <asm/unwind.h> | 47 | #include <asm/unwind.h> |
| 46 | #include <asm/desc.h> | 48 | #include <asm/desc.h> |
| 47 | #include <asm/i387.h> | 49 | #include <asm/i387.h> |
| 48 | #include <asm/nmi.h> | ||
| 49 | #include <asm/smp.h> | ||
| 50 | #include <asm/io.h> | ||
| 51 | #include <asm/pgalloc.h> | 50 | #include <asm/pgalloc.h> |
| 52 | #include <asm/proto.h> | 51 | #include <asm/proto.h> |
| 53 | #include <asm/pda.h> | 52 | #include <asm/pda.h> |
| @@ -85,7 +84,8 @@ static inline void preempt_conditional_cli(struct pt_regs *regs) | |||
| 85 | 84 | ||
| 86 | void printk_address(unsigned long address, int reliable) | 85 | void printk_address(unsigned long address, int reliable) |
| 87 | { | 86 | { |
| 88 | printk(" [<%016lx>] %s%pS\n", address, reliable ? "": "? ", (void *) address); | 87 | printk(" [<%016lx>] %s%pS\n", |
| 88 | address, reliable ? "" : "? ", (void *) address); | ||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, | 91 | 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, | |||
| 98 | [STACKFAULT_STACK - 1] = "#SS", | 98 | [STACKFAULT_STACK - 1] = "#SS", |
| 99 | [MCE_STACK - 1] = "#MC", | 99 | [MCE_STACK - 1] = "#MC", |
| 100 | #if DEBUG_STKSZ > EXCEPTION_STKSZ | 100 | #if DEBUG_STKSZ > EXCEPTION_STKSZ |
| 101 | [N_EXCEPTION_STACKS ... N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]" | 101 | [N_EXCEPTION_STACKS ... |
| 102 | N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]" | ||
| 102 | #endif | 103 | #endif |
| 103 | }; | 104 | }; |
| 104 | unsigned k; | 105 | unsigned k; |
| @@ -163,7 +164,7 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, | |||
| 163 | } | 164 | } |
| 164 | 165 | ||
| 165 | /* | 166 | /* |
| 166 | * x86-64 can have up to three kernel stacks: | 167 | * x86-64 can have up to three kernel stacks: |
| 167 | * process stack | 168 | * process stack |
| 168 | * interrupt stack | 169 | * interrupt stack |
| 169 | * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack | 170 | * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack |
| @@ -219,7 +220,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 219 | const struct stacktrace_ops *ops, void *data) | 220 | const struct stacktrace_ops *ops, void *data) |
| 220 | { | 221 | { |
| 221 | const unsigned cpu = get_cpu(); | 222 | const unsigned cpu = get_cpu(); |
| 222 | unsigned long *irqstack_end = (unsigned long*)cpu_pda(cpu)->irqstackptr; | 223 | unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; |
| 223 | unsigned used = 0; | 224 | unsigned used = 0; |
| 224 | struct thread_info *tinfo; | 225 | struct thread_info *tinfo; |
| 225 | 226 | ||
| @@ -237,7 +238,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 237 | if (!bp) { | 238 | if (!bp) { |
| 238 | if (task == current) { | 239 | if (task == current) { |
| 239 | /* Grab bp right from our regs */ | 240 | /* Grab bp right from our regs */ |
| 240 | asm("movq %%rbp, %0" : "=r" (bp) :); | 241 | asm("movq %%rbp, %0" : "=r" (bp) : ); |
| 241 | } else { | 242 | } else { |
| 242 | /* bp is the last reg pushed by switch_to */ | 243 | /* bp is the last reg pushed by switch_to */ |
| 243 | bp = *(unsigned long *) task->thread.sp; | 244 | bp = *(unsigned long *) task->thread.sp; |
| @@ -357,11 +358,15 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
| 357 | unsigned long *stack; | 358 | unsigned long *stack; |
| 358 | int i; | 359 | int i; |
| 359 | const int cpu = smp_processor_id(); | 360 | const int cpu = smp_processor_id(); |
| 360 | unsigned long *irqstack_end = (unsigned long *) (cpu_pda(cpu)->irqstackptr); | 361 | unsigned long *irqstack_end = |
| 361 | unsigned long *irqstack = (unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE); | 362 | (unsigned long *) (cpu_pda(cpu)->irqstackptr); |
| 363 | unsigned long *irqstack = | ||
| 364 | (unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE); | ||
| 362 | 365 | ||
| 363 | // debugging aid: "show_stack(NULL, NULL);" prints the | 366 | /* |
| 364 | // back trace for this cpu. | 367 | * debugging aid: "show_stack(NULL, NULL);" prints the |
| 368 | * back trace for this cpu. | ||
| 369 | */ | ||
| 365 | 370 | ||
| 366 | if (sp == NULL) { | 371 | if (sp == NULL) { |
| 367 | if (task) | 372 | if (task) |
| @@ -404,7 +409,7 @@ void dump_stack(void) | |||
| 404 | 409 | ||
| 405 | #ifdef CONFIG_FRAME_POINTER | 410 | #ifdef CONFIG_FRAME_POINTER |
| 406 | if (!bp) | 411 | if (!bp) |
| 407 | asm("movq %%rbp, %0" : "=r" (bp):); | 412 | asm("movq %%rbp, %0" : "=r" (bp) : ); |
| 408 | #endif | 413 | #endif |
| 409 | 414 | ||
| 410 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", | 415 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", |
| @@ -414,7 +419,6 @@ void dump_stack(void) | |||
| 414 | init_utsname()->version); | 419 | init_utsname()->version); |
| 415 | show_trace(NULL, NULL, &stack, bp); | 420 | show_trace(NULL, NULL, &stack, bp); |
| 416 | } | 421 | } |
| 417 | |||
| 418 | EXPORT_SYMBOL(dump_stack); | 422 | EXPORT_SYMBOL(dump_stack); |
| 419 | 423 | ||
| 420 | void show_registers(struct pt_regs *regs) | 424 | void show_registers(struct pt_regs *regs) |
| @@ -493,7 +497,7 @@ unsigned __kprobes long oops_begin(void) | |||
| 493 | raw_local_irq_save(flags); | 497 | raw_local_irq_save(flags); |
| 494 | cpu = smp_processor_id(); | 498 | cpu = smp_processor_id(); |
| 495 | if (!__raw_spin_trylock(&die_lock)) { | 499 | if (!__raw_spin_trylock(&die_lock)) { |
| 496 | if (cpu == die_owner) | 500 | if (cpu == die_owner) |
| 497 | /* nested oops. should stop eventually */; | 501 | /* nested oops. should stop eventually */; |
| 498 | else | 502 | else |
| 499 | __raw_spin_lock(&die_lock); | 503 | __raw_spin_lock(&die_lock); |
| @@ -638,7 +642,7 @@ kernel_trap: | |||
| 638 | } | 642 | } |
| 639 | 643 | ||
| 640 | #define DO_ERROR(trapnr, signr, str, name) \ | 644 | #define DO_ERROR(trapnr, signr, str, name) \ |
| 641 | asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ | 645 | asmlinkage void do_##name(struct pt_regs *regs, long error_code) \ |
| 642 | { \ | 646 | { \ |
| 643 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ | 647 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ |
| 644 | == NOTIFY_STOP) \ | 648 | == NOTIFY_STOP) \ |
| @@ -648,7 +652,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ | |||
| 648 | } | 652 | } |
| 649 | 653 | ||
| 650 | #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ | 654 | #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ |
| 651 | asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ | 655 | asmlinkage void do_##name(struct pt_regs *regs, long error_code) \ |
| 652 | { \ | 656 | { \ |
| 653 | siginfo_t info; \ | 657 | siginfo_t info; \ |
| 654 | info.si_signo = signr; \ | 658 | info.si_signo = signr; \ |
| @@ -683,7 +687,7 @@ asmlinkage void do_stack_segment(struct pt_regs *regs, long error_code) | |||
| 683 | preempt_conditional_cli(regs); | 687 | preempt_conditional_cli(regs); |
| 684 | } | 688 | } |
| 685 | 689 | ||
| 686 | asmlinkage void do_double_fault(struct pt_regs * regs, long error_code) | 690 | asmlinkage void do_double_fault(struct pt_regs *regs, long error_code) |
| 687 | { | 691 | { |
| 688 | static const char str[] = "double fault"; | 692 | static const char str[] = "double fault"; |
| 689 | struct task_struct *tsk = current; | 693 | struct task_struct *tsk = current; |
| @@ -778,9 +782,10 @@ io_check_error(unsigned char reason, struct pt_regs *regs) | |||
| 778 | } | 782 | } |
| 779 | 783 | ||
| 780 | static notrace __kprobes void | 784 | static notrace __kprobes void |
| 781 | unknown_nmi_error(unsigned char reason, struct pt_regs * regs) | 785 | unknown_nmi_error(unsigned char reason, struct pt_regs *regs) |
| 782 | { | 786 | { |
| 783 | if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP) | 787 | if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == |
| 788 | NOTIFY_STOP) | ||
| 784 | return; | 789 | return; |
| 785 | printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n", | 790 | printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n", |
| 786 | reason); | 791 | reason); |
| @@ -882,7 +887,7 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) | |||
| 882 | else if (user_mode(eregs)) | 887 | else if (user_mode(eregs)) |
| 883 | regs = task_pt_regs(current); | 888 | regs = task_pt_regs(current); |
| 884 | /* Exception from kernel and interrupts are enabled. Move to | 889 | /* Exception from kernel and interrupts are enabled. Move to |
| 885 | kernel process stack. */ | 890 | kernel process stack. */ |
| 886 | else if (eregs->flags & X86_EFLAGS_IF) | 891 | else if (eregs->flags & X86_EFLAGS_IF) |
| 887 | regs = (struct pt_regs *)(eregs->sp -= sizeof(struct pt_regs)); | 892 | regs = (struct pt_regs *)(eregs->sp -= sizeof(struct pt_regs)); |
| 888 | if (eregs != regs) | 893 | if (eregs != regs) |
| @@ -891,7 +896,7 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) | |||
| 891 | } | 896 | } |
| 892 | 897 | ||
| 893 | /* runs on IST stack. */ | 898 | /* runs on IST stack. */ |
| 894 | asmlinkage void __kprobes do_debug(struct pt_regs * regs, | 899 | asmlinkage void __kprobes do_debug(struct pt_regs *regs, |
| 895 | unsigned long error_code) | 900 | unsigned long error_code) |
| 896 | { | 901 | { |
| 897 | struct task_struct *tsk = current; | 902 | struct task_struct *tsk = current; |
| @@ -1035,7 +1040,7 @@ asmlinkage void do_coprocessor_error(struct pt_regs *regs) | |||
| 1035 | 1040 | ||
| 1036 | asmlinkage void bad_intr(void) | 1041 | asmlinkage void bad_intr(void) |
| 1037 | { | 1042 | { |
| 1038 | printk("bad interrupt"); | 1043 | printk("bad interrupt"); |
| 1039 | } | 1044 | } |
| 1040 | 1045 | ||
| 1041 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs) | 1046 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs) |
| @@ -1047,7 +1052,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs) | |||
| 1047 | 1052 | ||
| 1048 | conditional_sti(regs); | 1053 | conditional_sti(regs); |
| 1049 | if (!user_mode(regs) && | 1054 | if (!user_mode(regs) && |
| 1050 | kernel_math_error(regs, "kernel simd math error", 19)) | 1055 | kernel_math_error(regs, "kernel simd math error", 19)) |
| 1051 | return; | 1056 | return; |
| 1052 | 1057 | ||
| 1053 | /* | 1058 | /* |
| @@ -1092,7 +1097,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs) | |||
| 1092 | force_sig_info(SIGFPE, &info, task); | 1097 | force_sig_info(SIGFPE, &info, task); |
| 1093 | } | 1098 | } |
| 1094 | 1099 | ||
| 1095 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs) | 1100 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs) |
| 1096 | { | 1101 | { |
| 1097 | } | 1102 | } |
| 1098 | 1103 | ||
| @@ -1149,8 +1154,10 @@ void __init trap_init(void) | |||
| 1149 | set_intr_gate(0, ÷_error); | 1154 | set_intr_gate(0, ÷_error); |
| 1150 | set_intr_gate_ist(1, &debug, DEBUG_STACK); | 1155 | set_intr_gate_ist(1, &debug, DEBUG_STACK); |
| 1151 | set_intr_gate_ist(2, &nmi, NMI_STACK); | 1156 | set_intr_gate_ist(2, &nmi, NMI_STACK); |
| 1152 | set_system_gate_ist(3, &int3, DEBUG_STACK); /* int3 can be called from all */ | 1157 | /* int3 can be called from all */ |
| 1153 | set_system_gate(4, &overflow); /* int4 can be called from all */ | 1158 | set_system_gate_ist(3, &int3, DEBUG_STACK); |
| 1159 | /* int4 can be called from all */ | ||
| 1160 | set_system_gate(4, &overflow); | ||
| 1154 | set_intr_gate(5, &bounds); | 1161 | set_intr_gate(5, &bounds); |
| 1155 | set_intr_gate(6, &invalid_op); | 1162 | set_intr_gate(6, &invalid_op); |
| 1156 | set_intr_gate(7, &device_not_available); | 1163 | set_intr_gate(7, &device_not_available); |
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c index 594ef47f0a63..61a97e616f70 100644 --- a/arch/x86/kernel/visws_quirks.c +++ b/arch/x86/kernel/visws_quirks.c | |||
| @@ -25,45 +25,31 @@ | |||
| 25 | #include <asm/visws/cobalt.h> | 25 | #include <asm/visws/cobalt.h> |
| 26 | #include <asm/visws/piix4.h> | 26 | #include <asm/visws/piix4.h> |
| 27 | #include <asm/arch_hooks.h> | 27 | #include <asm/arch_hooks.h> |
| 28 | #include <asm/io_apic.h> | ||
| 28 | #include <asm/fixmap.h> | 29 | #include <asm/fixmap.h> |
| 29 | #include <asm/reboot.h> | 30 | #include <asm/reboot.h> |
| 30 | #include <asm/setup.h> | 31 | #include <asm/setup.h> |
| 31 | #include <asm/e820.h> | 32 | #include <asm/e820.h> |
| 32 | #include <asm/smp.h> | ||
| 33 | #include <asm/io.h> | 33 | #include <asm/io.h> |
| 34 | 34 | ||
| 35 | #include <mach_ipi.h> | 35 | #include <mach_ipi.h> |
| 36 | 36 | ||
| 37 | #include "mach_apic.h" | 37 | #include "mach_apic.h" |
| 38 | 38 | ||
| 39 | #include <linux/init.h> | ||
| 40 | #include <linux/smp.h> | ||
| 41 | |||
| 42 | #include <linux/kernel_stat.h> | 39 | #include <linux/kernel_stat.h> |
| 43 | #include <linux/interrupt.h> | ||
| 44 | #include <linux/init.h> | ||
| 45 | 40 | ||
| 46 | #include <asm/io.h> | ||
| 47 | #include <asm/apic.h> | ||
| 48 | #include <asm/i8259.h> | 41 | #include <asm/i8259.h> |
| 49 | #include <asm/irq_vectors.h> | 42 | #include <asm/irq_vectors.h> |
| 50 | #include <asm/visws/cobalt.h> | ||
| 51 | #include <asm/visws/lithium.h> | 43 | #include <asm/visws/lithium.h> |
| 52 | #include <asm/visws/piix4.h> | ||
| 53 | 44 | ||
| 54 | #include <linux/sched.h> | 45 | #include <linux/sched.h> |
| 55 | #include <linux/kernel.h> | 46 | #include <linux/kernel.h> |
| 56 | #include <linux/init.h> | ||
| 57 | #include <linux/pci.h> | 47 | #include <linux/pci.h> |
| 58 | #include <linux/pci_ids.h> | 48 | #include <linux/pci_ids.h> |
| 59 | 49 | ||
| 60 | extern int no_broadcast; | 50 | extern int no_broadcast; |
| 61 | 51 | ||
| 62 | #include <asm/io.h> | ||
| 63 | #include <asm/apic.h> | 52 | #include <asm/apic.h> |
| 64 | #include <asm/arch_hooks.h> | ||
| 65 | #include <asm/visws/cobalt.h> | ||
| 66 | #include <asm/visws/lithium.h> | ||
| 67 | 53 | ||
| 68 | char visws_board_type = -1; | 54 | char visws_board_type = -1; |
| 69 | char visws_board_rev = -1; | 55 | char visws_board_rev = -1; |
diff --git a/arch/x86/lib/string_32.c b/arch/x86/lib/string_32.c index 94972e7c094d..82004d2bf05e 100644 --- a/arch/x86/lib/string_32.c +++ b/arch/x86/lib/string_32.c | |||
| @@ -22,7 +22,7 @@ char *strcpy(char *dest, const char *src) | |||
| 22 | "testb %%al,%%al\n\t" | 22 | "testb %%al,%%al\n\t" |
| 23 | "jne 1b" | 23 | "jne 1b" |
| 24 | : "=&S" (d0), "=&D" (d1), "=&a" (d2) | 24 | : "=&S" (d0), "=&D" (d1), "=&a" (d2) |
| 25 | :"0" (src), "1" (dest) : "memory"); | 25 | : "0" (src), "1" (dest) : "memory"); |
| 26 | return dest; | 26 | return dest; |
| 27 | } | 27 | } |
| 28 | EXPORT_SYMBOL(strcpy); | 28 | EXPORT_SYMBOL(strcpy); |
| @@ -42,7 +42,7 @@ char *strncpy(char *dest, const char *src, size_t count) | |||
| 42 | "stosb\n" | 42 | "stosb\n" |
| 43 | "2:" | 43 | "2:" |
| 44 | : "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3) | 44 | : "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3) |
| 45 | :"0" (src), "1" (dest), "2" (count) : "memory"); | 45 | : "0" (src), "1" (dest), "2" (count) : "memory"); |
| 46 | return dest; | 46 | return dest; |
| 47 | } | 47 | } |
| 48 | EXPORT_SYMBOL(strncpy); | 48 | EXPORT_SYMBOL(strncpy); |
| @@ -60,7 +60,7 @@ char *strcat(char *dest, const char *src) | |||
| 60 | "testb %%al,%%al\n\t" | 60 | "testb %%al,%%al\n\t" |
| 61 | "jne 1b" | 61 | "jne 1b" |
| 62 | : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3) | 62 | : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3) |
| 63 | : "0" (src), "1" (dest), "2" (0), "3" (0xffffffffu): "memory"); | 63 | : "0" (src), "1" (dest), "2" (0), "3" (0xffffffffu) : "memory"); |
| 64 | return dest; | 64 | return dest; |
| 65 | } | 65 | } |
| 66 | EXPORT_SYMBOL(strcat); | 66 | EXPORT_SYMBOL(strcat); |
| @@ -105,9 +105,9 @@ int strcmp(const char *cs, const char *ct) | |||
| 105 | "2:\tsbbl %%eax,%%eax\n\t" | 105 | "2:\tsbbl %%eax,%%eax\n\t" |
| 106 | "orb $1,%%al\n" | 106 | "orb $1,%%al\n" |
| 107 | "3:" | 107 | "3:" |
| 108 | :"=a" (res), "=&S" (d0), "=&D" (d1) | 108 | : "=a" (res), "=&S" (d0), "=&D" (d1) |
| 109 | :"1" (cs), "2" (ct) | 109 | : "1" (cs), "2" (ct) |
| 110 | :"memory"); | 110 | : "memory"); |
| 111 | return res; | 111 | return res; |
| 112 | } | 112 | } |
| 113 | EXPORT_SYMBOL(strcmp); | 113 | EXPORT_SYMBOL(strcmp); |
| @@ -130,9 +130,9 @@ int strncmp(const char *cs, const char *ct, size_t count) | |||
| 130 | "3:\tsbbl %%eax,%%eax\n\t" | 130 | "3:\tsbbl %%eax,%%eax\n\t" |
| 131 | "orb $1,%%al\n" | 131 | "orb $1,%%al\n" |
| 132 | "4:" | 132 | "4:" |
| 133 | :"=a" (res), "=&S" (d0), "=&D" (d1), "=&c" (d2) | 133 | : "=a" (res), "=&S" (d0), "=&D" (d1), "=&c" (d2) |
| 134 | :"1" (cs), "2" (ct), "3" (count) | 134 | : "1" (cs), "2" (ct), "3" (count) |
| 135 | :"memory"); | 135 | : "memory"); |
| 136 | return res; | 136 | return res; |
| 137 | } | 137 | } |
| 138 | EXPORT_SYMBOL(strncmp); | 138 | EXPORT_SYMBOL(strncmp); |
| @@ -152,9 +152,9 @@ char *strchr(const char *s, int c) | |||
| 152 | "movl $1,%1\n" | 152 | "movl $1,%1\n" |
| 153 | "2:\tmovl %1,%0\n\t" | 153 | "2:\tmovl %1,%0\n\t" |
| 154 | "decl %0" | 154 | "decl %0" |
| 155 | :"=a" (res), "=&S" (d0) | 155 | : "=a" (res), "=&S" (d0) |
| 156 | :"1" (s), "0" (c) | 156 | : "1" (s), "0" (c) |
| 157 | :"memory"); | 157 | : "memory"); |
| 158 | return res; | 158 | return res; |
| 159 | } | 159 | } |
| 160 | EXPORT_SYMBOL(strchr); | 160 | EXPORT_SYMBOL(strchr); |
| @@ -169,9 +169,9 @@ size_t strlen(const char *s) | |||
| 169 | "scasb\n\t" | 169 | "scasb\n\t" |
| 170 | "notl %0\n\t" | 170 | "notl %0\n\t" |
| 171 | "decl %0" | 171 | "decl %0" |
| 172 | :"=c" (res), "=&D" (d0) | 172 | : "=c" (res), "=&D" (d0) |
| 173 | :"1" (s), "a" (0), "0" (0xffffffffu) | 173 | : "1" (s), "a" (0), "0" (0xffffffffu) |
| 174 | :"memory"); | 174 | : "memory"); |
| 175 | return res; | 175 | return res; |
| 176 | } | 176 | } |
| 177 | EXPORT_SYMBOL(strlen); | 177 | EXPORT_SYMBOL(strlen); |
| @@ -189,9 +189,9 @@ void *memchr(const void *cs, int c, size_t count) | |||
| 189 | "je 1f\n\t" | 189 | "je 1f\n\t" |
| 190 | "movl $1,%0\n" | 190 | "movl $1,%0\n" |
| 191 | "1:\tdecl %0" | 191 | "1:\tdecl %0" |
| 192 | :"=D" (res), "=&c" (d0) | 192 | : "=D" (res), "=&c" (d0) |
| 193 | :"a" (c), "0" (cs), "1" (count) | 193 | : "a" (c), "0" (cs), "1" (count) |
| 194 | :"memory"); | 194 | : "memory"); |
| 195 | return res; | 195 | return res; |
| 196 | } | 196 | } |
| 197 | EXPORT_SYMBOL(memchr); | 197 | EXPORT_SYMBOL(memchr); |
| @@ -228,9 +228,9 @@ size_t strnlen(const char *s, size_t count) | |||
| 228 | "cmpl $-1,%1\n\t" | 228 | "cmpl $-1,%1\n\t" |
| 229 | "jne 1b\n" | 229 | "jne 1b\n" |
| 230 | "3:\tsubl %2,%0" | 230 | "3:\tsubl %2,%0" |
| 231 | :"=a" (res), "=&d" (d0) | 231 | : "=a" (res), "=&d" (d0) |
| 232 | :"c" (s), "1" (count) | 232 | : "c" (s), "1" (count) |
| 233 | :"memory"); | 233 | : "memory"); |
| 234 | return res; | 234 | return res; |
| 235 | } | 235 | } |
| 236 | EXPORT_SYMBOL(strnlen); | 236 | EXPORT_SYMBOL(strnlen); |
diff --git a/arch/x86/lib/strstr_32.c b/arch/x86/lib/strstr_32.c index 42e8a50303f3..8e2d55f754bf 100644 --- a/arch/x86/lib/strstr_32.c +++ b/arch/x86/lib/strstr_32.c | |||
| @@ -23,9 +23,9 @@ __asm__ __volatile__( | |||
| 23 | "jne 1b\n\t" | 23 | "jne 1b\n\t" |
| 24 | "xorl %%eax,%%eax\n\t" | 24 | "xorl %%eax,%%eax\n\t" |
| 25 | "2:" | 25 | "2:" |
| 26 | :"=a" (__res), "=&c" (d0), "=&S" (d1) | 26 | : "=a" (__res), "=&c" (d0), "=&S" (d1) |
| 27 | :"0" (0), "1" (0xffffffff), "2" (cs), "g" (ct) | 27 | : "0" (0), "1" (0xffffffff), "2" (cs), "g" (ct) |
| 28 | :"dx", "di"); | 28 | : "dx", "di"); |
| 29 | return __res; | 29 | return __res; |
| 30 | } | 30 | } |
| 31 | 31 | ||
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c index 62fa440678d8..847c164725f4 100644 --- a/arch/x86/mm/discontig_32.c +++ b/arch/x86/mm/discontig_32.c | |||
| @@ -328,7 +328,7 @@ void __init initmem_init(unsigned long start_pfn, | |||
| 328 | 328 | ||
| 329 | get_memcfg_numa(); | 329 | get_memcfg_numa(); |
| 330 | 330 | ||
| 331 | kva_pages = round_up(calculate_numa_remap_pages(), PTRS_PER_PTE); | 331 | kva_pages = roundup(calculate_numa_remap_pages(), PTRS_PER_PTE); |
| 332 | 332 | ||
| 333 | kva_target_pfn = round_down(max_low_pfn - kva_pages, PTRS_PER_PTE); | 333 | kva_target_pfn = round_down(max_low_pfn - kva_pages, PTRS_PER_PTE); |
| 334 | do { | 334 | do { |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index a87ea0e4b3dc..5f47fde5fa9e 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
| @@ -225,7 +225,7 @@ void __init init_extra_mapping_uc(unsigned long phys, unsigned long size) | |||
| 225 | void __init cleanup_highmap(void) | 225 | void __init cleanup_highmap(void) |
| 226 | { | 226 | { |
| 227 | unsigned long vaddr = __START_KERNEL_map; | 227 | unsigned long vaddr = __START_KERNEL_map; |
| 228 | unsigned long end = round_up((unsigned long)_end, PMD_SIZE) - 1; | 228 | unsigned long end = roundup((unsigned long)_end, PMD_SIZE) - 1; |
| 229 | pmd_t *pmd = level2_kernel_pgt; | 229 | pmd_t *pmd = level2_kernel_pgt; |
| 230 | pmd_t *last_pmd = pmd + PTRS_PER_PMD; | 230 | pmd_t *last_pmd = pmd + PTRS_PER_PMD; |
| 231 | 231 | ||
| @@ -445,14 +445,14 @@ static void __init find_early_table_space(unsigned long end) | |||
| 445 | unsigned long puds, pmds, ptes, tables, start; | 445 | unsigned long puds, pmds, ptes, tables, start; |
| 446 | 446 | ||
| 447 | puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; | 447 | puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; |
| 448 | tables = round_up(puds * sizeof(pud_t), PAGE_SIZE); | 448 | tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); |
| 449 | if (direct_gbpages) { | 449 | if (direct_gbpages) { |
| 450 | unsigned long extra; | 450 | unsigned long extra; |
| 451 | extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT); | 451 | extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT); |
| 452 | pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT; | 452 | pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT; |
| 453 | } else | 453 | } else |
| 454 | pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; | 454 | pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; |
| 455 | tables += round_up(pmds * sizeof(pmd_t), PAGE_SIZE); | 455 | tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); |
| 456 | 456 | ||
| 457 | if (cpu_has_pse) { | 457 | if (cpu_has_pse) { |
| 458 | unsigned long extra; | 458 | unsigned long extra; |
| @@ -460,7 +460,7 @@ static void __init find_early_table_space(unsigned long end) | |||
| 460 | ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; | 460 | ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; |
| 461 | } else | 461 | } else |
| 462 | ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT; | 462 | ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT; |
| 463 | tables += round_up(ptes * sizeof(pte_t), PAGE_SIZE); | 463 | tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE); |
| 464 | 464 | ||
| 465 | /* | 465 | /* |
| 466 | * RED-PEN putting page tables only on node 0 could | 466 | * RED-PEN putting page tables only on node 0 could |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index a4dd793d6003..cebcbf152d46 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
| @@ -79,7 +79,7 @@ static int __init allocate_cachealigned_memnodemap(void) | |||
| 79 | return 0; | 79 | return 0; |
| 80 | 80 | ||
| 81 | addr = 0x8000; | 81 | addr = 0x8000; |
| 82 | nodemap_size = round_up(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES); | 82 | nodemap_size = roundup(sizeof(s16) * memnodemapsize, L1_CACHE_BYTES); |
| 83 | nodemap_addr = find_e820_area(addr, max_pfn<<PAGE_SHIFT, | 83 | nodemap_addr = find_e820_area(addr, max_pfn<<PAGE_SHIFT, |
| 84 | nodemap_size, L1_CACHE_BYTES); | 84 | nodemap_size, L1_CACHE_BYTES); |
| 85 | if (nodemap_addr == -1UL) { | 85 | if (nodemap_addr == -1UL) { |
| @@ -176,10 +176,10 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, | |||
| 176 | unsigned long start_pfn, last_pfn, bootmap_pages, bootmap_size; | 176 | unsigned long start_pfn, last_pfn, bootmap_pages, bootmap_size; |
| 177 | unsigned long bootmap_start, nodedata_phys; | 177 | unsigned long bootmap_start, nodedata_phys; |
| 178 | void *bootmap; | 178 | void *bootmap; |
| 179 | const int pgdat_size = round_up(sizeof(pg_data_t), PAGE_SIZE); | 179 | const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE); |
| 180 | int nid; | 180 | int nid; |
| 181 | 181 | ||
| 182 | start = round_up(start, ZONE_ALIGN); | 182 | start = roundup(start, ZONE_ALIGN); |
| 183 | 183 | ||
| 184 | printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid, | 184 | printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid, |
| 185 | start, end); | 185 | start, end); |
| @@ -210,9 +210,9 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, | |||
| 210 | bootmap_pages = bootmem_bootmap_pages(last_pfn - start_pfn); | 210 | bootmap_pages = bootmem_bootmap_pages(last_pfn - start_pfn); |
| 211 | nid = phys_to_nid(nodedata_phys); | 211 | nid = phys_to_nid(nodedata_phys); |
| 212 | if (nid == nodeid) | 212 | if (nid == nodeid) |
| 213 | bootmap_start = round_up(nodedata_phys + pgdat_size, PAGE_SIZE); | 213 | bootmap_start = roundup(nodedata_phys + pgdat_size, PAGE_SIZE); |
| 214 | else | 214 | else |
| 215 | bootmap_start = round_up(start, PAGE_SIZE); | 215 | bootmap_start = roundup(start, PAGE_SIZE); |
| 216 | /* | 216 | /* |
| 217 | * SMP_CACHE_BYTES could be enough, but init_bootmem_node like | 217 | * SMP_CACHE_BYTES could be enough, but init_bootmem_node like |
| 218 | * to use that to align to PAGE_SIZE | 218 | * to use that to align to PAGE_SIZE |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index f5f5154ea11e..1b87b76e2d04 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
| @@ -84,7 +84,7 @@ static inline unsigned long highmap_start_pfn(void) | |||
| 84 | 84 | ||
| 85 | static inline unsigned long highmap_end_pfn(void) | 85 | static inline unsigned long highmap_end_pfn(void) |
| 86 | { | 86 | { |
| 87 | return __pa(round_up((unsigned long)_end, PMD_SIZE)) >> PAGE_SHIFT; | 87 | return __pa(roundup((unsigned long)_end, PMD_SIZE)) >> PAGE_SHIFT; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | #endif | 90 | #endif |
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h index 133c998161ca..e9e09b2ee7cd 100644 --- a/include/asm-x86/apic.h +++ b/include/asm-x86/apic.h | |||
| @@ -76,9 +76,7 @@ extern int get_physical_broadcast(void); | |||
| 76 | static inline void ack_APIC_irq(void) | 76 | static inline void ack_APIC_irq(void) |
| 77 | { | 77 | { |
| 78 | /* | 78 | /* |
| 79 | * ack_APIC_irq() actually gets compiled as a single instruction: | 79 | * ack_APIC_irq() actually gets compiled as a single instruction |
| 80 | * - a single rmw on Pentium/82489DX | ||
| 81 | * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC) | ||
| 82 | * ... yummie. | 80 | * ... yummie. |
| 83 | */ | 81 | */ |
| 84 | 82 | ||
diff --git a/include/asm-x86/asm.h b/include/asm-x86/asm.h index 97220321f39d..56be78f582f0 100644 --- a/include/asm-x86/asm.h +++ b/include/asm-x86/asm.h | |||
| @@ -20,17 +20,22 @@ | |||
| 20 | 20 | ||
| 21 | #define _ASM_PTR __ASM_SEL(.long, .quad) | 21 | #define _ASM_PTR __ASM_SEL(.long, .quad) |
| 22 | #define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) | 22 | #define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) |
| 23 | #define _ASM_MOV_UL __ASM_SIZE(mov) | ||
| 24 | 23 | ||
| 24 | #define _ASM_MOV __ASM_SIZE(mov) | ||
| 25 | #define _ASM_INC __ASM_SIZE(inc) | 25 | #define _ASM_INC __ASM_SIZE(inc) |
| 26 | #define _ASM_DEC __ASM_SIZE(dec) | 26 | #define _ASM_DEC __ASM_SIZE(dec) |
| 27 | #define _ASM_ADD __ASM_SIZE(add) | 27 | #define _ASM_ADD __ASM_SIZE(add) |
| 28 | #define _ASM_SUB __ASM_SIZE(sub) | 28 | #define _ASM_SUB __ASM_SIZE(sub) |
| 29 | #define _ASM_XADD __ASM_SIZE(xadd) | 29 | #define _ASM_XADD __ASM_SIZE(xadd) |
| 30 | |||
| 30 | #define _ASM_AX __ASM_REG(ax) | 31 | #define _ASM_AX __ASM_REG(ax) |
| 31 | #define _ASM_BX __ASM_REG(bx) | 32 | #define _ASM_BX __ASM_REG(bx) |
| 32 | #define _ASM_CX __ASM_REG(cx) | 33 | #define _ASM_CX __ASM_REG(cx) |
| 33 | #define _ASM_DX __ASM_REG(dx) | 34 | #define _ASM_DX __ASM_REG(dx) |
| 35 | #define _ASM_SP __ASM_REG(sp) | ||
| 36 | #define _ASM_BP __ASM_REG(bp) | ||
| 37 | #define _ASM_SI __ASM_REG(si) | ||
| 38 | #define _ASM_DI __ASM_REG(di) | ||
| 34 | 39 | ||
| 35 | /* Exception table entry */ | 40 | /* Exception table entry */ |
| 36 | # define _ASM_EXTABLE(from,to) \ | 41 | # define _ASM_EXTABLE(from,to) \ |
diff --git a/include/asm-x86/resume-trace.h b/include/asm-x86/resume-trace.h index 8d9f0b41ee86..e219b4c91193 100644 --- a/include/asm-x86/resume-trace.h +++ b/include/asm-x86/resume-trace.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | do { \ | 7 | do { \ |
| 8 | if (pm_trace_enabled) { \ | 8 | if (pm_trace_enabled) { \ |
| 9 | const void *tracedata; \ | 9 | const void *tracedata; \ |
| 10 | asm volatile(_ASM_MOV_UL " $1f,%0\n" \ | 10 | asm volatile(_ASM_MOV " $1f,%0\n" \ |
| 11 | ".section .tracedata,\"a\"\n" \ | 11 | ".section .tracedata,\"a\"\n" \ |
| 12 | "1:\t.word %c1\n\t" \ | 12 | "1:\t.word %c1\n\t" \ |
| 13 | _ASM_PTR " %c2\n" \ | 13 | _ASM_PTR " %c2\n" \ |
