diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_64.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes_64.c | 47 | ||||
-rw-r--r-- | arch/x86/kernel/process_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/setup_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_32.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/suspend_64.c | 39 | ||||
-rw-r--r-- | arch/x86/kernel/traps_32.c | 7 | ||||
-rw-r--r-- | arch/x86/oprofile/op_model_athlon.c | 22 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 2 |
14 files changed, 79 insertions, 89 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 96986b46bc85..edb5108e5d0e 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -849,7 +849,7 @@ void __init init_bsp_APIC(void) | |||
849 | /** | 849 | /** |
850 | * setup_local_APIC - setup the local APIC | 850 | * setup_local_APIC - setup the local APIC |
851 | */ | 851 | */ |
852 | void __devinit setup_local_APIC(void) | 852 | void __cpuinit setup_local_APIC(void) |
853 | { | 853 | { |
854 | unsigned long oldvalue, value, maxlvt, integrated; | 854 | unsigned long oldvalue, value, maxlvt, integrated; |
855 | int i, j; | 855 | int i, j; |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 606fe4d55a91..9f530ff43c21 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -49,6 +49,7 @@ static struct _cache_table cache_table[] __cpuinitdata = | |||
49 | { 0x3c, LVL_2, 256 }, /* 4-way set assoc, sectored cache, 64 byte line size */ | 49 | { 0x3c, LVL_2, 256 }, /* 4-way set assoc, sectored cache, 64 byte line size */ |
50 | { 0x3d, LVL_2, 384 }, /* 6-way set assoc, sectored cache, 64 byte line size */ | 50 | { 0x3d, LVL_2, 384 }, /* 6-way set assoc, sectored cache, 64 byte line size */ |
51 | { 0x3e, LVL_2, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */ | 51 | { 0x3e, LVL_2, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */ |
52 | { 0x3f, LVL_2, 256 }, /* 2-way set assoc, 64 byte line size */ | ||
52 | { 0x41, LVL_2, 128 }, /* 4-way set assoc, 32 byte line size */ | 53 | { 0x41, LVL_2, 128 }, /* 4-way set assoc, 32 byte line size */ |
53 | { 0x42, LVL_2, 256 }, /* 4-way set assoc, 32 byte line size */ | 54 | { 0x42, LVL_2, 256 }, /* 4-way set assoc, 32 byte line size */ |
54 | { 0x43, LVL_2, 512 }, /* 4-way set assoc, 32 byte line size */ | 55 | { 0x43, LVL_2, 512 }, /* 4-way set assoc, 32 byte line size */ |
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index 6cf27319a91c..c3a565bba106 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -1882,13 +1882,16 @@ __setup("no_timer_check", notimercheck); | |||
1882 | static int __init timer_irq_works(void) | 1882 | static int __init timer_irq_works(void) |
1883 | { | 1883 | { |
1884 | unsigned long t1 = jiffies; | 1884 | unsigned long t1 = jiffies; |
1885 | unsigned long flags; | ||
1885 | 1886 | ||
1886 | if (no_timer_check) | 1887 | if (no_timer_check) |
1887 | return 1; | 1888 | return 1; |
1888 | 1889 | ||
1890 | local_save_flags(flags); | ||
1889 | local_irq_enable(); | 1891 | local_irq_enable(); |
1890 | /* Let ten ticks pass... */ | 1892 | /* Let ten ticks pass... */ |
1891 | mdelay((10 * 1000) / HZ); | 1893 | mdelay((10 * 1000) / HZ); |
1894 | local_irq_restore(flags); | ||
1892 | 1895 | ||
1893 | /* | 1896 | /* |
1894 | * Expect a few ticks at least, to be sure some possible | 1897 | * Expect a few ticks at least, to be sure some possible |
@@ -2167,6 +2170,9 @@ static inline void __init check_timer(void) | |||
2167 | int apic1, pin1, apic2, pin2; | 2170 | int apic1, pin1, apic2, pin2; |
2168 | int vector; | 2171 | int vector; |
2169 | unsigned int ver; | 2172 | unsigned int ver; |
2173 | unsigned long flags; | ||
2174 | |||
2175 | local_irq_save(flags); | ||
2170 | 2176 | ||
2171 | ver = apic_read(APIC_LVR); | 2177 | ver = apic_read(APIC_LVR); |
2172 | ver = GET_APIC_VERSION(ver); | 2178 | ver = GET_APIC_VERSION(ver); |
@@ -2219,7 +2225,7 @@ static inline void __init check_timer(void) | |||
2219 | } | 2225 | } |
2220 | if (disable_timer_pin_1 > 0) | 2226 | if (disable_timer_pin_1 > 0) |
2221 | clear_IO_APIC_pin(0, pin1); | 2227 | clear_IO_APIC_pin(0, pin1); |
2222 | return; | 2228 | goto out; |
2223 | } | 2229 | } |
2224 | clear_IO_APIC_pin(apic1, pin1); | 2230 | clear_IO_APIC_pin(apic1, pin1); |
2225 | printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to " | 2231 | printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to " |
@@ -2242,7 +2248,7 @@ static inline void __init check_timer(void) | |||
2242 | if (nmi_watchdog == NMI_IO_APIC) { | 2248 | if (nmi_watchdog == NMI_IO_APIC) { |
2243 | setup_nmi(); | 2249 | setup_nmi(); |
2244 | } | 2250 | } |
2245 | return; | 2251 | goto out; |
2246 | } | 2252 | } |
2247 | /* | 2253 | /* |
2248 | * Cleanup, just in case ... | 2254 | * Cleanup, just in case ... |
@@ -2266,7 +2272,7 @@ static inline void __init check_timer(void) | |||
2266 | 2272 | ||
2267 | if (timer_irq_works()) { | 2273 | if (timer_irq_works()) { |
2268 | printk(" works.\n"); | 2274 | printk(" works.\n"); |
2269 | return; | 2275 | goto out; |
2270 | } | 2276 | } |
2271 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector); | 2277 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector); |
2272 | printk(" failed.\n"); | 2278 | printk(" failed.\n"); |
@@ -2282,11 +2288,13 @@ static inline void __init check_timer(void) | |||
2282 | 2288 | ||
2283 | if (timer_irq_works()) { | 2289 | if (timer_irq_works()) { |
2284 | printk(" works.\n"); | 2290 | printk(" works.\n"); |
2285 | return; | 2291 | goto out; |
2286 | } | 2292 | } |
2287 | printk(" failed :(.\n"); | 2293 | printk(" failed :(.\n"); |
2288 | panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a " | 2294 | panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a " |
2289 | "report. Then try booting with the 'noapic' option"); | 2295 | "report. Then try booting with the 'noapic' option"); |
2296 | out: | ||
2297 | local_irq_restore(flags); | ||
2290 | } | 2298 | } |
2291 | 2299 | ||
2292 | /* | 2300 | /* |
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index 435a8c9b55f8..cbac1670c7c3 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -1281,10 +1281,13 @@ void disable_IO_APIC(void) | |||
1281 | static int __init timer_irq_works(void) | 1281 | static int __init timer_irq_works(void) |
1282 | { | 1282 | { |
1283 | unsigned long t1 = jiffies; | 1283 | unsigned long t1 = jiffies; |
1284 | unsigned long flags; | ||
1284 | 1285 | ||
1286 | local_save_flags(flags); | ||
1285 | local_irq_enable(); | 1287 | local_irq_enable(); |
1286 | /* Let ten ticks pass... */ | 1288 | /* Let ten ticks pass... */ |
1287 | mdelay((10 * 1000) / HZ); | 1289 | mdelay((10 * 1000) / HZ); |
1290 | local_irq_restore(flags); | ||
1288 | 1291 | ||
1289 | /* | 1292 | /* |
1290 | * Expect a few ticks at least, to be sure some possible | 1293 | * Expect a few ticks at least, to be sure some possible |
@@ -1655,6 +1658,9 @@ static inline void check_timer(void) | |||
1655 | { | 1658 | { |
1656 | struct irq_cfg *cfg = irq_cfg + 0; | 1659 | struct irq_cfg *cfg = irq_cfg + 0; |
1657 | int apic1, pin1, apic2, pin2; | 1660 | int apic1, pin1, apic2, pin2; |
1661 | unsigned long flags; | ||
1662 | |||
1663 | local_irq_save(flags); | ||
1658 | 1664 | ||
1659 | /* | 1665 | /* |
1660 | * get/set the timer IRQ vector: | 1666 | * get/set the timer IRQ vector: |
@@ -1696,7 +1702,7 @@ static inline void check_timer(void) | |||
1696 | } | 1702 | } |
1697 | if (disable_timer_pin_1 > 0) | 1703 | if (disable_timer_pin_1 > 0) |
1698 | clear_IO_APIC_pin(0, pin1); | 1704 | clear_IO_APIC_pin(0, pin1); |
1699 | return; | 1705 | goto out; |
1700 | } | 1706 | } |
1701 | clear_IO_APIC_pin(apic1, pin1); | 1707 | clear_IO_APIC_pin(apic1, pin1); |
1702 | apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not " | 1708 | apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not " |
@@ -1718,7 +1724,7 @@ static inline void check_timer(void) | |||
1718 | if (nmi_watchdog == NMI_IO_APIC) { | 1724 | if (nmi_watchdog == NMI_IO_APIC) { |
1719 | setup_nmi(); | 1725 | setup_nmi(); |
1720 | } | 1726 | } |
1721 | return; | 1727 | goto out; |
1722 | } | 1728 | } |
1723 | /* | 1729 | /* |
1724 | * Cleanup, just in case ... | 1730 | * Cleanup, just in case ... |
@@ -1741,7 +1747,7 @@ static inline void check_timer(void) | |||
1741 | 1747 | ||
1742 | if (timer_irq_works()) { | 1748 | if (timer_irq_works()) { |
1743 | apic_printk(APIC_VERBOSE," works.\n"); | 1749 | apic_printk(APIC_VERBOSE," works.\n"); |
1744 | return; | 1750 | goto out; |
1745 | } | 1751 | } |
1746 | apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector); | 1752 | apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector); |
1747 | apic_printk(APIC_VERBOSE," failed.\n"); | 1753 | apic_printk(APIC_VERBOSE," failed.\n"); |
@@ -1756,10 +1762,12 @@ static inline void check_timer(void) | |||
1756 | 1762 | ||
1757 | if (timer_irq_works()) { | 1763 | if (timer_irq_works()) { |
1758 | apic_printk(APIC_VERBOSE," works.\n"); | 1764 | apic_printk(APIC_VERBOSE," works.\n"); |
1759 | return; | 1765 | goto out; |
1760 | } | 1766 | } |
1761 | apic_printk(APIC_VERBOSE," failed :(.\n"); | 1767 | apic_printk(APIC_VERBOSE," failed :(.\n"); |
1762 | panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n"); | 1768 | panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n"); |
1769 | out: | ||
1770 | local_irq_restore(flags); | ||
1763 | } | 1771 | } |
1764 | 1772 | ||
1765 | static int __init notimercheck(char *s) | 1773 | static int __init notimercheck(char *s) |
diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c index d87a523070d1..3a020f79f82b 100644 --- a/arch/x86/kernel/kprobes_32.c +++ b/arch/x86/kernel/kprobes_32.c | |||
@@ -727,9 +727,7 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) | |||
727 | 727 | ||
728 | if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) { | 728 | if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) { |
729 | if (®s->esp != kcb->jprobe_saved_esp) { | 729 | if (®s->esp != kcb->jprobe_saved_esp) { |
730 | struct pt_regs *saved_regs = | 730 | struct pt_regs *saved_regs = &kcb->jprobe_saved_regs; |
731 | container_of(kcb->jprobe_saved_esp, | ||
732 | struct pt_regs, esp); | ||
733 | printk("current esp %p does not match saved esp %p\n", | 731 | printk("current esp %p does not match saved esp %p\n", |
734 | ®s->esp, kcb->jprobe_saved_esp); | 732 | ®s->esp, kcb->jprobe_saved_esp); |
735 | printk("Saved registers for jprobe %p\n", jp); | 733 | printk("Saved registers for jprobe %p\n", jp); |
diff --git a/arch/x86/kernel/kprobes_64.c b/arch/x86/kernel/kprobes_64.c index 0c467644589c..5df19a9f9239 100644 --- a/arch/x86/kernel/kprobes_64.c +++ b/arch/x86/kernel/kprobes_64.c | |||
@@ -485,7 +485,6 @@ static void __kprobes resume_execution(struct kprobe *p, | |||
485 | struct pt_regs *regs, struct kprobe_ctlblk *kcb) | 485 | struct pt_regs *regs, struct kprobe_ctlblk *kcb) |
486 | { | 486 | { |
487 | unsigned long *tos = (unsigned long *)regs->rsp; | 487 | unsigned long *tos = (unsigned long *)regs->rsp; |
488 | unsigned long next_rip = 0; | ||
489 | unsigned long copy_rip = (unsigned long)p->ainsn.insn; | 488 | unsigned long copy_rip = (unsigned long)p->ainsn.insn; |
490 | unsigned long orig_rip = (unsigned long)p->addr; | 489 | unsigned long orig_rip = (unsigned long)p->addr; |
491 | kprobe_opcode_t *insn = p->ainsn.insn; | 490 | kprobe_opcode_t *insn = p->ainsn.insn; |
@@ -494,46 +493,42 @@ static void __kprobes resume_execution(struct kprobe *p, | |||
494 | if (*insn >= 0x40 && *insn <= 0x4f) | 493 | if (*insn >= 0x40 && *insn <= 0x4f) |
495 | insn++; | 494 | insn++; |
496 | 495 | ||
496 | regs->eflags &= ~TF_MASK; | ||
497 | switch (*insn) { | 497 | switch (*insn) { |
498 | case 0x9c: /* pushfl */ | 498 | case 0x9c: /* pushfl */ |
499 | *tos &= ~(TF_MASK | IF_MASK); | 499 | *tos &= ~(TF_MASK | IF_MASK); |
500 | *tos |= kcb->kprobe_old_rflags; | 500 | *tos |= kcb->kprobe_old_rflags; |
501 | break; | 501 | break; |
502 | case 0xc3: /* ret/lret */ | 502 | case 0xc2: /* iret/ret/lret */ |
503 | case 0xcb: | 503 | case 0xc3: |
504 | case 0xc2: | ||
505 | case 0xca: | 504 | case 0xca: |
506 | regs->eflags &= ~TF_MASK; | 505 | case 0xcb: |
507 | /* rip is already adjusted, no more changes required*/ | 506 | case 0xcf: |
508 | return; | 507 | case 0xea: /* jmp absolute -- ip is correct */ |
509 | case 0xe8: /* call relative - Fix return addr */ | 508 | /* ip is already adjusted, no more changes required */ |
509 | goto no_change; | ||
510 | case 0xe8: /* call relative - Fix return addr */ | ||
510 | *tos = orig_rip + (*tos - copy_rip); | 511 | *tos = orig_rip + (*tos - copy_rip); |
511 | break; | 512 | break; |
512 | case 0xff: | 513 | case 0xff: |
513 | if ((insn[1] & 0x30) == 0x10) { | 514 | if ((insn[1] & 0x30) == 0x10) { |
514 | /* call absolute, indirect */ | 515 | /* call absolute, indirect */ |
515 | /* Fix return addr; rip is correct. */ | 516 | /* Fix return addr; ip is correct. */ |
516 | next_rip = regs->rip; | ||
517 | *tos = orig_rip + (*tos - copy_rip); | 517 | *tos = orig_rip + (*tos - copy_rip); |
518 | goto no_change; | ||
518 | } else if (((insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */ | 519 | } else if (((insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */ |
519 | ((insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */ | 520 | ((insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */ |
520 | /* rip is correct. */ | 521 | /* ip is correct. */ |
521 | next_rip = regs->rip; | 522 | goto no_change; |
522 | } | 523 | } |
523 | break; | ||
524 | case 0xea: /* jmp absolute -- rip is correct */ | ||
525 | next_rip = regs->rip; | ||
526 | break; | ||
527 | default: | 524 | default: |
528 | break; | 525 | break; |
529 | } | 526 | } |
530 | 527 | ||
531 | regs->eflags &= ~TF_MASK; | 528 | regs->rip = orig_rip + (regs->rip - copy_rip); |
532 | if (next_rip) { | 529 | no_change: |
533 | regs->rip = next_rip; | 530 | |
534 | } else { | 531 | return; |
535 | regs->rip = orig_rip + (regs->rip - copy_rip); | ||
536 | } | ||
537 | } | 532 | } |
538 | 533 | ||
539 | int __kprobes post_kprobe_handler(struct pt_regs *regs) | 534 | int __kprobes post_kprobe_handler(struct pt_regs *regs) |
@@ -716,10 +711,8 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) | |||
716 | struct jprobe *jp = container_of(p, struct jprobe, kp); | 711 | struct jprobe *jp = container_of(p, struct jprobe, kp); |
717 | 712 | ||
718 | if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) { | 713 | if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) { |
719 | if ((long *)regs->rsp != kcb->jprobe_saved_rsp) { | 714 | if ((unsigned long *)regs->rsp != kcb->jprobe_saved_rsp) { |
720 | struct pt_regs *saved_regs = | 715 | struct pt_regs *saved_regs = &kcb->jprobe_saved_regs; |
721 | container_of(kcb->jprobe_saved_rsp, | ||
722 | struct pt_regs, rsp); | ||
723 | printk("current rsp %p does not match saved rsp %p\n", | 716 | printk("current rsp %p does not match saved rsp %p\n", |
724 | (long *)regs->rsp, kcb->jprobe_saved_rsp); | 717 | (long *)regs->rsp, kcb->jprobe_saved_rsp); |
725 | printk("Saved registers for jprobe %p\n", jp); | 718 | printk("Saved registers for jprobe %p\n", jp); |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 7b899584d290..9663c2a74830 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -261,7 +261,7 @@ static void mwait_idle(void) | |||
261 | mwait_idle_with_hints(0, 0); | 261 | mwait_idle_with_hints(0, 0); |
262 | } | 262 | } |
263 | 263 | ||
264 | void __devinit select_idle_routine(const struct cpuinfo_x86 *c) | 264 | void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) |
265 | { | 265 | { |
266 | if (cpu_has(c, X86_FEATURE_MWAIT)) { | 266 | if (cpu_has(c, X86_FEATURE_MWAIT)) { |
267 | printk("monitor/mwait feature present.\n"); | 267 | printk("monitor/mwait feature present.\n"); |
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index e1e18c34c821..9c24b45b513c 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -67,7 +67,7 @@ | |||
67 | address, and must not be in the .bss segment! */ | 67 | address, and must not be in the .bss segment! */ |
68 | unsigned long init_pg_tables_end __initdata = ~0UL; | 68 | unsigned long init_pg_tables_end __initdata = ~0UL; |
69 | 69 | ||
70 | int disable_pse __devinitdata = 0; | 70 | int disable_pse __cpuinitdata = 0; |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * Machine setup.. | 73 | * Machine setup.. |
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index ef0f34ede1ab..4ea80cbe52e5 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -60,7 +60,7 @@ | |||
60 | #include <asm/mtrr.h> | 60 | #include <asm/mtrr.h> |
61 | 61 | ||
62 | /* Set if we find a B stepping CPU */ | 62 | /* Set if we find a B stepping CPU */ |
63 | static int __devinitdata smp_b_stepping; | 63 | static int __cpuinitdata smp_b_stepping; |
64 | 64 | ||
65 | /* Number of siblings per CPU package */ | 65 | /* Number of siblings per CPU package */ |
66 | int smp_num_siblings = 1; | 66 | int smp_num_siblings = 1; |
@@ -745,8 +745,8 @@ static inline int alloc_cpu_id(void) | |||
745 | } | 745 | } |
746 | 746 | ||
747 | #ifdef CONFIG_HOTPLUG_CPU | 747 | #ifdef CONFIG_HOTPLUG_CPU |
748 | static struct task_struct * __devinitdata cpu_idle_tasks[NR_CPUS]; | 748 | static struct task_struct * __cpuinitdata cpu_idle_tasks[NR_CPUS]; |
749 | static inline struct task_struct * alloc_idle_task(int cpu) | 749 | static inline struct task_struct * __cpuinit alloc_idle_task(int cpu) |
750 | { | 750 | { |
751 | struct task_struct *idle; | 751 | struct task_struct *idle; |
752 | 752 | ||
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index 500670c93d81..594889521da1 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c | |||
@@ -141,8 +141,8 @@ static void __cpuinit smp_store_cpu_info(int id) | |||
141 | struct cpuinfo_x86 *c = &cpu_data(id); | 141 | struct cpuinfo_x86 *c = &cpu_data(id); |
142 | 142 | ||
143 | *c = boot_cpu_data; | 143 | *c = boot_cpu_data; |
144 | c->cpu_index = id; | ||
145 | identify_cpu(c); | 144 | identify_cpu(c); |
145 | c->cpu_index = id; | ||
146 | print_cpu_info(c); | 146 | print_cpu_info(c); |
147 | } | 147 | } |
148 | 148 | ||
diff --git a/arch/x86/kernel/suspend_64.c b/arch/x86/kernel/suspend_64.c index db284ef44d53..2e5efaaf8800 100644 --- a/arch/x86/kernel/suspend_64.c +++ b/arch/x86/kernel/suspend_64.c | |||
@@ -192,42 +192,25 @@ static int res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long en | |||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |
194 | 194 | ||
195 | static int res_kernel_text_pud_init(pud_t *pud, unsigned long start) | ||
196 | { | ||
197 | pmd_t *pmd; | ||
198 | unsigned long paddr; | ||
199 | |||
200 | pmd = (pmd_t *)get_safe_page(GFP_ATOMIC); | ||
201 | if (!pmd) | ||
202 | return -ENOMEM; | ||
203 | set_pud(pud + pud_index(start), __pud(__pa(pmd) | _KERNPG_TABLE)); | ||
204 | for (paddr = 0; paddr < KERNEL_TEXT_SIZE; pmd++, paddr += PMD_SIZE) { | ||
205 | unsigned long pe; | ||
206 | |||
207 | pe = __PAGE_KERNEL_LARGE_EXEC | _PAGE_GLOBAL | paddr; | ||
208 | pe &= __supported_pte_mask; | ||
209 | set_pmd(pmd, __pmd(pe)); | ||
210 | } | ||
211 | |||
212 | return 0; | ||
213 | } | ||
214 | |||
215 | static int set_up_temporary_mappings(void) | 195 | static int set_up_temporary_mappings(void) |
216 | { | 196 | { |
217 | unsigned long start, end, next; | 197 | unsigned long start, end, next; |
218 | pud_t *pud; | ||
219 | int error; | 198 | int error; |
220 | 199 | ||
221 | temp_level4_pgt = (pgd_t *)get_safe_page(GFP_ATOMIC); | 200 | temp_level4_pgt = (pgd_t *)get_safe_page(GFP_ATOMIC); |
222 | if (!temp_level4_pgt) | 201 | if (!temp_level4_pgt) |
223 | return -ENOMEM; | 202 | return -ENOMEM; |
224 | 203 | ||
204 | /* It is safe to reuse the original kernel mapping */ | ||
205 | set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map), | ||
206 | init_level4_pgt[pgd_index(__START_KERNEL_map)]); | ||
207 | |||
225 | /* Set up the direct mapping from scratch */ | 208 | /* Set up the direct mapping from scratch */ |
226 | start = (unsigned long)pfn_to_kaddr(0); | 209 | start = (unsigned long)pfn_to_kaddr(0); |
227 | end = (unsigned long)pfn_to_kaddr(end_pfn); | 210 | end = (unsigned long)pfn_to_kaddr(end_pfn); |
228 | 211 | ||
229 | for (; start < end; start = next) { | 212 | for (; start < end; start = next) { |
230 | pud = (pud_t *)get_safe_page(GFP_ATOMIC); | 213 | pud_t *pud = (pud_t *)get_safe_page(GFP_ATOMIC); |
231 | if (!pud) | 214 | if (!pud) |
232 | return -ENOMEM; | 215 | return -ENOMEM; |
233 | next = start + PGDIR_SIZE; | 216 | next = start + PGDIR_SIZE; |
@@ -238,17 +221,7 @@ static int set_up_temporary_mappings(void) | |||
238 | set_pgd(temp_level4_pgt + pgd_index(start), | 221 | set_pgd(temp_level4_pgt + pgd_index(start), |
239 | mk_kernel_pgd(__pa(pud))); | 222 | mk_kernel_pgd(__pa(pud))); |
240 | } | 223 | } |
241 | 224 | return 0; | |
242 | /* Set up the kernel text mapping from scratch */ | ||
243 | pud = (pud_t *)get_safe_page(GFP_ATOMIC); | ||
244 | if (!pud) | ||
245 | return -ENOMEM; | ||
246 | error = res_kernel_text_pud_init(pud, __START_KERNEL_map); | ||
247 | if (!error) | ||
248 | set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map), | ||
249 | __pgd(__pa(pud) | _PAGE_TABLE)); | ||
250 | |||
251 | return error; | ||
252 | } | 225 | } |
253 | 226 | ||
254 | int swsusp_arch_resume(void) | 227 | int swsusp_arch_resume(void) |
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index ef6010262597..c88bbffcaa03 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -373,14 +373,13 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
373 | 373 | ||
374 | if (die.lock_owner != raw_smp_processor_id()) { | 374 | if (die.lock_owner != raw_smp_processor_id()) { |
375 | console_verbose(); | 375 | console_verbose(); |
376 | raw_local_irq_save(flags); | ||
376 | __raw_spin_lock(&die.lock); | 377 | __raw_spin_lock(&die.lock); |
377 | raw_local_save_flags(flags); | ||
378 | die.lock_owner = smp_processor_id(); | 378 | die.lock_owner = smp_processor_id(); |
379 | die.lock_owner_depth = 0; | 379 | die.lock_owner_depth = 0; |
380 | bust_spinlocks(1); | 380 | bust_spinlocks(1); |
381 | } | 381 | } else |
382 | else | 382 | raw_local_irq_save(flags); |
383 | raw_local_save_flags(flags); | ||
384 | 383 | ||
385 | if (++die.lock_owner_depth < 3) { | 384 | if (++die.lock_owner_depth < 3) { |
386 | unsigned long esp; | 385 | unsigned long esp; |
diff --git a/arch/x86/oprofile/op_model_athlon.c b/arch/x86/oprofile/op_model_athlon.c index 3057a19e4641..c3ee43333f26 100644 --- a/arch/x86/oprofile/op_model_athlon.c +++ b/arch/x86/oprofile/op_model_athlon.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /** | 1 | /** |
2 | * @file op_model_athlon.h | 2 | * @file op_model_athlon.h |
3 | * athlon / K7 model-specific MSR operations | 3 | * athlon / K7 / K8 / Family 10h model-specific MSR operations |
4 | * | 4 | * |
5 | * @remark Copyright 2002 OProfile authors | 5 | * @remark Copyright 2002 OProfile authors |
6 | * @remark Read the file COPYING | 6 | * @remark Read the file COPYING |
@@ -31,12 +31,16 @@ | |||
31 | #define CTRL_WRITE(l,h,msrs,c) do {wrmsr(msrs->controls[(c)].addr, (l), (h));} while (0) | 31 | #define CTRL_WRITE(l,h,msrs,c) do {wrmsr(msrs->controls[(c)].addr, (l), (h));} while (0) |
32 | #define CTRL_SET_ACTIVE(n) (n |= (1<<22)) | 32 | #define CTRL_SET_ACTIVE(n) (n |= (1<<22)) |
33 | #define CTRL_SET_INACTIVE(n) (n &= ~(1<<22)) | 33 | #define CTRL_SET_INACTIVE(n) (n &= ~(1<<22)) |
34 | #define CTRL_CLEAR(x) (x &= (1<<21)) | 34 | #define CTRL_CLEAR_LO(x) (x &= (1<<21)) |
35 | #define CTRL_CLEAR_HI(x) (x &= 0xfffffcf0) | ||
35 | #define CTRL_SET_ENABLE(val) (val |= 1<<20) | 36 | #define CTRL_SET_ENABLE(val) (val |= 1<<20) |
36 | #define CTRL_SET_USR(val,u) (val |= ((u & 1) << 16)) | 37 | #define CTRL_SET_USR(val,u) (val |= ((u & 1) << 16)) |
37 | #define CTRL_SET_KERN(val,k) (val |= ((k & 1) << 17)) | 38 | #define CTRL_SET_KERN(val,k) (val |= ((k & 1) << 17)) |
38 | #define CTRL_SET_UM(val, m) (val |= (m << 8)) | 39 | #define CTRL_SET_UM(val, m) (val |= (m << 8)) |
39 | #define CTRL_SET_EVENT(val, e) (val |= e) | 40 | #define CTRL_SET_EVENT_LOW(val, e) (val |= (e & 0xff)) |
41 | #define CTRL_SET_EVENT_HIGH(val, e) (val |= ((e >> 8) & 0xf)) | ||
42 | #define CTRL_SET_HOST_ONLY(val, h) (val |= ((h & 1) << 9)) | ||
43 | #define CTRL_SET_GUEST_ONLY(val, h) (val |= ((h & 1) << 8)) | ||
40 | 44 | ||
41 | static unsigned long reset_value[NUM_COUNTERS]; | 45 | static unsigned long reset_value[NUM_COUNTERS]; |
42 | 46 | ||
@@ -70,7 +74,8 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs) | |||
70 | if (unlikely(!CTRL_IS_RESERVED(msrs,i))) | 74 | if (unlikely(!CTRL_IS_RESERVED(msrs,i))) |
71 | continue; | 75 | continue; |
72 | CTRL_READ(low, high, msrs, i); | 76 | CTRL_READ(low, high, msrs, i); |
73 | CTRL_CLEAR(low); | 77 | CTRL_CLEAR_LO(low); |
78 | CTRL_CLEAR_HI(high); | ||
74 | CTRL_WRITE(low, high, msrs, i); | 79 | CTRL_WRITE(low, high, msrs, i); |
75 | } | 80 | } |
76 | 81 | ||
@@ -89,12 +94,17 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs) | |||
89 | CTR_WRITE(counter_config[i].count, msrs, i); | 94 | CTR_WRITE(counter_config[i].count, msrs, i); |
90 | 95 | ||
91 | CTRL_READ(low, high, msrs, i); | 96 | CTRL_READ(low, high, msrs, i); |
92 | CTRL_CLEAR(low); | 97 | CTRL_CLEAR_LO(low); |
98 | CTRL_CLEAR_HI(high); | ||
93 | CTRL_SET_ENABLE(low); | 99 | CTRL_SET_ENABLE(low); |
94 | CTRL_SET_USR(low, counter_config[i].user); | 100 | CTRL_SET_USR(low, counter_config[i].user); |
95 | CTRL_SET_KERN(low, counter_config[i].kernel); | 101 | CTRL_SET_KERN(low, counter_config[i].kernel); |
96 | CTRL_SET_UM(low, counter_config[i].unit_mask); | 102 | CTRL_SET_UM(low, counter_config[i].unit_mask); |
97 | CTRL_SET_EVENT(low, counter_config[i].event); | 103 | CTRL_SET_EVENT_LOW(low, counter_config[i].event); |
104 | CTRL_SET_EVENT_HIGH(high, counter_config[i].event); | ||
105 | CTRL_SET_HOST_ONLY(high, 0); | ||
106 | CTRL_SET_GUEST_ONLY(high, 0); | ||
107 | |||
98 | CTRL_WRITE(low, high, msrs, i); | 108 | CTRL_WRITE(low, high, msrs, i); |
99 | } else { | 109 | } else { |
100 | reset_value[i] = 0; | 110 | reset_value[i] = 0; |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 94c39aaf695f..b6af3ea43c73 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1131,7 +1131,7 @@ asmlinkage void __init xen_start_kernel(void) | |||
1131 | if (!xen_start_info) | 1131 | if (!xen_start_info) |
1132 | return; | 1132 | return; |
1133 | 1133 | ||
1134 | BUG_ON(memcmp(xen_start_info->magic, "xen-3.0", 7) != 0); | 1134 | BUG_ON(memcmp(xen_start_info->magic, "xen-3", 5) != 0); |
1135 | 1135 | ||
1136 | /* Install Xen paravirt ops */ | 1136 | /* Install Xen paravirt ops */ |
1137 | pv_info = xen_info; | 1137 | pv_info = xen_info; |