diff options
| -rw-r--r-- | arch/x86/boot/boot.h | 2 | ||||
| -rw-r--r-- | arch/x86/boot/memory.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/efi_32.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/mmconf-fam10h_64.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/mpparse.c | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 11 | ||||
| -rw-r--r-- | arch/x86/kernel/tsc.c | 2 | ||||
| -rw-r--r-- | arch/x86/power/cpu_32.c | 6 | ||||
| -rw-r--r-- | arch/x86/power/hibernate_asm_32.S | 26 | ||||
| -rw-r--r-- | include/asm-x86/atomic_64.h | 8 | ||||
| -rw-r--r-- | include/asm-x86/mmconfig.h | 2 | ||||
| -rw-r--r-- | include/asm-x86/percpu.h | 2 |
14 files changed, 45 insertions, 31 deletions
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 616b804a2295..cc0ef13fba7a 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | /* Useful macros */ | 30 | /* Useful macros */ |
| 31 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 31 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
| 32 | 32 | ||
| 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) | ||
| 34 | |||
| 33 | extern struct setup_header hdr; | 35 | extern struct setup_header hdr; |
| 34 | extern struct boot_params boot_params; | 36 | extern struct boot_params boot_params; |
| 35 | 37 | ||
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c index 53165c97336b..8c3c25f35578 100644 --- a/arch/x86/boot/memory.c +++ b/arch/x86/boot/memory.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include "boot.h" | 15 | #include "boot.h" |
| 16 | #include <linux/kernel.h> | ||
| 17 | 16 | ||
| 18 | #define SMAP 0x534d4150 /* ASCII "SMAP" */ | 17 | #define SMAP 0x534d4150 /* ASCII "SMAP" */ |
| 19 | 18 | ||
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 81e5ab6542d8..426e5d91b63a 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
| @@ -86,7 +86,7 @@ int acpi_save_state_mem(void) | |||
| 86 | #endif /* !CONFIG_64BIT */ | 86 | #endif /* !CONFIG_64BIT */ |
| 87 | 87 | ||
| 88 | header->pmode_cr0 = read_cr0(); | 88 | header->pmode_cr0 = read_cr0(); |
| 89 | header->pmode_cr4 = read_cr4(); | 89 | header->pmode_cr4 = read_cr4_safe(); |
| 90 | header->realmode_flags = acpi_realmode_flags; | 90 | header->realmode_flags = acpi_realmode_flags; |
| 91 | header->real_magic = 0x12345678; | 91 | header->real_magic = 0x12345678; |
| 92 | 92 | ||
diff --git a/arch/x86/kernel/efi_32.c b/arch/x86/kernel/efi_32.c index 4b63c8e1f13b..5cab48ee61a4 100644 --- a/arch/x86/kernel/efi_32.c +++ b/arch/x86/kernel/efi_32.c | |||
| @@ -53,7 +53,7 @@ void efi_call_phys_prelog(void) | |||
| 53 | * directory. If I have PAE, I just need to duplicate one entry in | 53 | * directory. If I have PAE, I just need to duplicate one entry in |
| 54 | * page directory. | 54 | * page directory. |
| 55 | */ | 55 | */ |
| 56 | cr4 = read_cr4(); | 56 | cr4 = read_cr4_safe(); |
| 57 | 57 | ||
| 58 | if (cr4 & X86_CR4_PAE) { | 58 | if (cr4 & X86_CR4_PAE) { |
| 59 | efi_bak_pg_dir_pointer[0].pgd = | 59 | efi_bak_pg_dir_pointer[0].pgd = |
| @@ -91,7 +91,7 @@ void efi_call_phys_epilog(void) | |||
| 91 | gdt_descr.size = GDT_SIZE - 1; | 91 | gdt_descr.size = GDT_SIZE - 1; |
| 92 | load_gdt(&gdt_descr); | 92 | load_gdt(&gdt_descr); |
| 93 | 93 | ||
| 94 | cr4 = read_cr4(); | 94 | cr4 = read_cr4_safe(); |
| 95 | 95 | ||
| 96 | if (cr4 & X86_CR4_PAE) { | 96 | if (cr4 & X86_CR4_PAE) { |
| 97 | swapper_pg_dir[pgd_index(0)].pgd = | 97 | swapper_pg_dir[pgd_index(0)].pgd = |
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c index fdfdc550b366..efc2f361fe85 100644 --- a/arch/x86/kernel/mmconf-fam10h_64.c +++ b/arch/x86/kernel/mmconf-fam10h_64.c | |||
| @@ -238,7 +238,7 @@ static struct dmi_system_id __devinitdata mmconf_dmi_table[] = { | |||
| 238 | {} | 238 | {} |
| 239 | }; | 239 | }; |
| 240 | 240 | ||
| 241 | void __init check_enable_amd_mmconf_dmi(void) | 241 | void __cpuinit check_enable_amd_mmconf_dmi(void) |
| 242 | { | 242 | { |
| 243 | dmi_check_system(mmconf_dmi_table); | 243 | dmi_check_system(mmconf_dmi_table); |
| 244 | } | 244 | } |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 678090508a62..b3fb430725cb 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
| @@ -49,7 +49,7 @@ static int __init mpf_checksum(unsigned char *mp, int len) | |||
| 49 | return sum & 0xFF; | 49 | return sum & 0xFF; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | static void __cpuinit MP_processor_info(struct mpc_config_processor *m) | 52 | static void __init MP_processor_info(struct mpc_config_processor *m) |
| 53 | { | 53 | { |
| 54 | int apicid; | 54 | int apicid; |
| 55 | char *bootup_cpu = ""; | 55 | char *bootup_cpu = ""; |
| @@ -484,7 +484,7 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type) | |||
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | 486 | ||
| 487 | static void construct_ioapic_table(int mpc_default_type) | 487 | static void __init construct_ioapic_table(int mpc_default_type) |
| 488 | { | 488 | { |
| 489 | struct mpc_config_ioapic ioapic; | 489 | struct mpc_config_ioapic ioapic; |
| 490 | struct mpc_config_bus bus; | 490 | struct mpc_config_bus bus; |
| @@ -529,7 +529,7 @@ static void construct_ioapic_table(int mpc_default_type) | |||
| 529 | construct_default_ioirq_mptable(mpc_default_type); | 529 | construct_default_ioirq_mptable(mpc_default_type); |
| 530 | } | 530 | } |
| 531 | #else | 531 | #else |
| 532 | static inline void construct_ioapic_table(int mpc_default_type) { } | 532 | static inline void __init construct_ioapic_table(int mpc_default_type) { } |
| 533 | #endif | 533 | #endif |
| 534 | 534 | ||
| 535 | static inline void __init construct_default_ISA_mptable(int mpc_default_type) | 535 | static inline void __init construct_default_ISA_mptable(int mpc_default_type) |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 02d19328525d..218d783ed7a8 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
| @@ -1350,7 +1350,7 @@ static void calgary_init_bitmap_from_tce_table(struct iommu_table *tbl) | |||
| 1350 | * Function for kdump case. Get the tce tables from first kernel | 1350 | * Function for kdump case. Get the tce tables from first kernel |
| 1351 | * by reading the contents of the base adress register of calgary iommu | 1351 | * by reading the contents of the base adress register of calgary iommu |
| 1352 | */ | 1352 | */ |
| 1353 | static void get_tce_space_from_tar(void) | 1353 | static void __init get_tce_space_from_tar(void) |
| 1354 | { | 1354 | { |
| 1355 | int bus; | 1355 | int bus; |
| 1356 | void __iomem *target; | 1356 | void __iomem *target; |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a8fb8a980fae..e139e617f422 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -756,6 +756,14 @@ static void __cpuinit do_fork_idle(struct work_struct *work) | |||
| 756 | } | 756 | } |
| 757 | 757 | ||
| 758 | #ifdef CONFIG_X86_64 | 758 | #ifdef CONFIG_X86_64 |
| 759 | |||
| 760 | /* __ref because it's safe to call free_bootmem when after_bootmem == 0. */ | ||
| 761 | static void __ref free_bootmem_pda(struct x8664_pda *oldpda) | ||
| 762 | { | ||
| 763 | if (!after_bootmem) | ||
| 764 | free_bootmem((unsigned long)oldpda, sizeof(*oldpda)); | ||
| 765 | } | ||
| 766 | |||
| 759 | /* | 767 | /* |
| 760 | * Allocate node local memory for the AP pda. | 768 | * Allocate node local memory for the AP pda. |
| 761 | * | 769 | * |
| @@ -784,8 +792,7 @@ int __cpuinit get_local_pda(int cpu) | |||
| 784 | 792 | ||
| 785 | if (oldpda) { | 793 | if (oldpda) { |
| 786 | memcpy(newpda, oldpda, size); | 794 | memcpy(newpda, oldpda, size); |
| 787 | if (!after_bootmem) | 795 | free_bootmem_pda(oldpda); |
| 788 | free_bootmem((unsigned long)oldpda, size); | ||
| 789 | } | 796 | } |
| 790 | 797 | ||
| 791 | newpda->in_bootmem = 0; | 798 | newpda->in_bootmem = 0; |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 7603c0553909..46af71676738 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
| @@ -104,7 +104,7 @@ __setup("notsc", notsc_setup); | |||
| 104 | /* | 104 | /* |
| 105 | * Read TSC and the reference counters. Take care of SMI disturbance | 105 | * Read TSC and the reference counters. Take care of SMI disturbance |
| 106 | */ | 106 | */ |
| 107 | static u64 __init tsc_read_refs(u64 *pm, u64 *hpet) | 107 | static u64 tsc_read_refs(u64 *pm, u64 *hpet) |
| 108 | { | 108 | { |
| 109 | u64 t1, t2; | 109 | u64 t1, t2; |
| 110 | int i; | 110 | int i; |
diff --git a/arch/x86/power/cpu_32.c b/arch/x86/power/cpu_32.c index 7dc5d5cf50a2..d3e083dea720 100644 --- a/arch/x86/power/cpu_32.c +++ b/arch/x86/power/cpu_32.c | |||
| @@ -45,7 +45,7 @@ static void __save_processor_state(struct saved_context *ctxt) | |||
| 45 | ctxt->cr0 = read_cr0(); | 45 | ctxt->cr0 = read_cr0(); |
| 46 | ctxt->cr2 = read_cr2(); | 46 | ctxt->cr2 = read_cr2(); |
| 47 | ctxt->cr3 = read_cr3(); | 47 | ctxt->cr3 = read_cr3(); |
| 48 | ctxt->cr4 = read_cr4(); | 48 | ctxt->cr4 = read_cr4_safe(); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | /* Needed by apm.c */ | 51 | /* Needed by apm.c */ |
| @@ -98,7 +98,9 @@ static void __restore_processor_state(struct saved_context *ctxt) | |||
| 98 | /* | 98 | /* |
| 99 | * control registers | 99 | * control registers |
| 100 | */ | 100 | */ |
| 101 | write_cr4(ctxt->cr4); | 101 | /* cr4 was introduced in the Pentium CPU */ |
| 102 | if (ctxt->cr4) | ||
| 103 | write_cr4(ctxt->cr4); | ||
| 102 | write_cr3(ctxt->cr3); | 104 | write_cr3(ctxt->cr3); |
| 103 | write_cr2(ctxt->cr2); | 105 | write_cr2(ctxt->cr2); |
| 104 | write_cr0(ctxt->cr0); | 106 | write_cr0(ctxt->cr0); |
diff --git a/arch/x86/power/hibernate_asm_32.S b/arch/x86/power/hibernate_asm_32.S index b95aa6cfe3cb..4fc7e872c85e 100644 --- a/arch/x86/power/hibernate_asm_32.S +++ b/arch/x86/power/hibernate_asm_32.S | |||
| @@ -28,9 +28,9 @@ ENTRY(swsusp_arch_suspend) | |||
| 28 | ret | 28 | ret |
| 29 | 29 | ||
| 30 | ENTRY(restore_image) | 30 | ENTRY(restore_image) |
| 31 | movl resume_pg_dir, %ecx | 31 | movl resume_pg_dir, %eax |
| 32 | subl $__PAGE_OFFSET, %ecx | 32 | subl $__PAGE_OFFSET, %eax |
| 33 | movl %ecx, %cr3 | 33 | movl %eax, %cr3 |
| 34 | 34 | ||
| 35 | movl restore_pblist, %edx | 35 | movl restore_pblist, %edx |
| 36 | .p2align 4,,7 | 36 | .p2align 4,,7 |
| @@ -52,17 +52,21 @@ copy_loop: | |||
| 52 | 52 | ||
| 53 | done: | 53 | done: |
| 54 | /* go back to the original page tables */ | 54 | /* go back to the original page tables */ |
| 55 | movl $swapper_pg_dir, %ecx | 55 | movl $swapper_pg_dir, %eax |
| 56 | subl $__PAGE_OFFSET, %ecx | 56 | subl $__PAGE_OFFSET, %eax |
| 57 | movl %ecx, %cr3 | 57 | movl %eax, %cr3 |
| 58 | /* Flush TLB, including "global" things (vmalloc) */ | 58 | /* Flush TLB, including "global" things (vmalloc) */ |
| 59 | movl mmu_cr4_features, %eax | 59 | movl mmu_cr4_features, %ecx |
| 60 | movl %eax, %edx | 60 | jecxz 1f # cr4 Pentium and higher, skip if zero |
| 61 | movl %ecx, %edx | ||
| 61 | andl $~(1<<7), %edx; # PGE | 62 | andl $~(1<<7), %edx; # PGE |
| 62 | movl %edx, %cr4; # turn off PGE | 63 | movl %edx, %cr4; # turn off PGE |
| 63 | movl %cr3, %ecx; # flush TLB | 64 | 1: |
| 64 | movl %ecx, %cr3 | 65 | movl %cr3, %eax; # flush TLB |
| 65 | movl %eax, %cr4; # turn PGE back on | 66 | movl %eax, %cr3 |
| 67 | jecxz 1f # cr4 Pentium and higher, skip if zero | ||
| 68 | movl %ecx, %cr4; # turn PGE back on | ||
| 69 | 1: | ||
| 66 | 70 | ||
| 67 | movl saved_context_esp, %esp | 71 | movl saved_context_esp, %esp |
| 68 | movl saved_context_ebp, %ebp | 72 | movl saved_context_ebp, %ebp |
diff --git a/include/asm-x86/atomic_64.h b/include/asm-x86/atomic_64.h index a0095191c02e..91c7d03e65bc 100644 --- a/include/asm-x86/atomic_64.h +++ b/include/asm-x86/atomic_64.h | |||
| @@ -228,7 +228,7 @@ static inline void atomic64_add(long i, atomic64_t *v) | |||
| 228 | { | 228 | { |
| 229 | asm volatile(LOCK_PREFIX "addq %1,%0" | 229 | asm volatile(LOCK_PREFIX "addq %1,%0" |
| 230 | : "=m" (v->counter) | 230 | : "=m" (v->counter) |
| 231 | : "ir" (i), "m" (v->counter)); | 231 | : "er" (i), "m" (v->counter)); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | /** | 234 | /** |
| @@ -242,7 +242,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) | |||
| 242 | { | 242 | { |
| 243 | asm volatile(LOCK_PREFIX "subq %1,%0" | 243 | asm volatile(LOCK_PREFIX "subq %1,%0" |
| 244 | : "=m" (v->counter) | 244 | : "=m" (v->counter) |
| 245 | : "ir" (i), "m" (v->counter)); | 245 | : "er" (i), "m" (v->counter)); |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | /** | 248 | /** |
| @@ -260,7 +260,7 @@ static inline int atomic64_sub_and_test(long i, atomic64_t *v) | |||
| 260 | 260 | ||
| 261 | asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" | 261 | asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" |
| 262 | : "=m" (v->counter), "=qm" (c) | 262 | : "=m" (v->counter), "=qm" (c) |
| 263 | : "ir" (i), "m" (v->counter) : "memory"); | 263 | : "er" (i), "m" (v->counter) : "memory"); |
| 264 | return c; | 264 | return c; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| @@ -341,7 +341,7 @@ static inline int atomic64_add_negative(long i, atomic64_t *v) | |||
| 341 | 341 | ||
| 342 | asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" | 342 | asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" |
| 343 | : "=m" (v->counter), "=qm" (c) | 343 | : "=m" (v->counter), "=qm" (c) |
| 344 | : "ir" (i), "m" (v->counter) : "memory"); | 344 | : "er" (i), "m" (v->counter) : "memory"); |
| 345 | return c; | 345 | return c; |
| 346 | } | 346 | } |
| 347 | 347 | ||
diff --git a/include/asm-x86/mmconfig.h b/include/asm-x86/mmconfig.h index 95beda07c6fa..e293ab81e850 100644 --- a/include/asm-x86/mmconfig.h +++ b/include/asm-x86/mmconfig.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #ifdef CONFIG_PCI_MMCONFIG | 4 | #ifdef CONFIG_PCI_MMCONFIG |
| 5 | extern void __cpuinit fam10h_check_enable_mmcfg(void); | 5 | extern void __cpuinit fam10h_check_enable_mmcfg(void); |
| 6 | extern void __init check_enable_amd_mmconf_dmi(void); | 6 | extern void __cpuinit check_enable_amd_mmconf_dmi(void); |
| 7 | #else | 7 | #else |
| 8 | static inline void fam10h_check_enable_mmcfg(void) { } | 8 | static inline void fam10h_check_enable_mmcfg(void) { } |
| 9 | static inline void check_enable_amd_mmconf_dmi(void) { } | 9 | static inline void check_enable_amd_mmconf_dmi(void) { } |
diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h index 4e91ee1e37aa..f643a3a92da0 100644 --- a/include/asm-x86/percpu.h +++ b/include/asm-x86/percpu.h | |||
| @@ -182,7 +182,7 @@ do { \ | |||
| 182 | DEFINE_PER_CPU(_type, _name) = _initvalue; \ | 182 | DEFINE_PER_CPU(_type, _name) = _initvalue; \ |
| 183 | __typeof__(_type) _name##_early_map[NR_CPUS] __initdata = \ | 183 | __typeof__(_type) _name##_early_map[NR_CPUS] __initdata = \ |
| 184 | { [0 ... NR_CPUS-1] = _initvalue }; \ | 184 | { [0 ... NR_CPUS-1] = _initvalue }; \ |
| 185 | __typeof__(_type) *_name##_early_ptr = _name##_early_map | 185 | __typeof__(_type) *_name##_early_ptr __refdata = _name##_early_map |
| 186 | 186 | ||
| 187 | #define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \ | 187 | #define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \ |
| 188 | EXPORT_PER_CPU_SYMBOL(_name) | 188 | EXPORT_PER_CPU_SYMBOL(_name) |
