diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_intel_64.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/proc.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/e820.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/machine_kexec_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/machine_kexec_64.c | 4 | ||||
-rw-r--r-- | arch/x86/mm/init.c | 18 | ||||
-rw-r--r-- | arch/x86/mm/kmmio.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/srat_32.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/srat_64.c | 1 | ||||
-rw-r--r-- | arch/x86/vdso/vclock_gettime.c | 12 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 5 |
13 files changed, 59 insertions, 30 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 42c33cebf00f..8c0be0902dac 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -49,10 +49,10 @@ | |||
49 | #define IVHD_DEV_EXT_SELECT 0x46 | 49 | #define IVHD_DEV_EXT_SELECT 0x46 |
50 | #define IVHD_DEV_EXT_SELECT_RANGE 0x47 | 50 | #define IVHD_DEV_EXT_SELECT_RANGE 0x47 |
51 | 51 | ||
52 | #define IVHD_FLAG_HT_TUN_EN 0x00 | 52 | #define IVHD_FLAG_HT_TUN_EN_MASK 0x01 |
53 | #define IVHD_FLAG_PASSPW_EN 0x01 | 53 | #define IVHD_FLAG_PASSPW_EN_MASK 0x02 |
54 | #define IVHD_FLAG_RESPASSPW_EN 0x02 | 54 | #define IVHD_FLAG_RESPASSPW_EN_MASK 0x04 |
55 | #define IVHD_FLAG_ISOC_EN 0x03 | 55 | #define IVHD_FLAG_ISOC_EN_MASK 0x08 |
56 | 56 | ||
57 | #define IVMD_FLAG_EXCL_RANGE 0x08 | 57 | #define IVMD_FLAG_EXCL_RANGE 0x08 |
58 | #define IVMD_FLAG_UNITY_MAP 0x01 | 58 | #define IVMD_FLAG_UNITY_MAP 0x01 |
@@ -569,19 +569,19 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, | |||
569 | * First set the recommended feature enable bits from ACPI | 569 | * First set the recommended feature enable bits from ACPI |
570 | * into the IOMMU control registers | 570 | * into the IOMMU control registers |
571 | */ | 571 | */ |
572 | h->flags & IVHD_FLAG_HT_TUN_EN ? | 572 | h->flags & IVHD_FLAG_HT_TUN_EN_MASK ? |
573 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : | 573 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : |
574 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); | 574 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); |
575 | 575 | ||
576 | h->flags & IVHD_FLAG_PASSPW_EN ? | 576 | h->flags & IVHD_FLAG_PASSPW_EN_MASK ? |
577 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : | 577 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : |
578 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); | 578 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); |
579 | 579 | ||
580 | h->flags & IVHD_FLAG_RESPASSPW_EN ? | 580 | h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ? |
581 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : | 581 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : |
582 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); | 582 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); |
583 | 583 | ||
584 | h->flags & IVHD_FLAG_ISOC_EN ? | 584 | h->flags & IVHD_FLAG_ISOC_EN_MASK ? |
585 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : | 585 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : |
586 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); | 586 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); |
587 | 587 | ||
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c4f667896c28..c1caefc82e62 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -1203,6 +1203,8 @@ void __cpuinit cpu_init(void) | |||
1203 | load_TR_desc(); | 1203 | load_TR_desc(); |
1204 | load_LDT(&init_mm.context); | 1204 | load_LDT(&init_mm.context); |
1205 | 1205 | ||
1206 | t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); | ||
1207 | |||
1206 | #ifdef CONFIG_DOUBLEFAULT | 1208 | #ifdef CONFIG_DOUBLEFAULT |
1207 | /* Set up doublefault TSS pointer in the GDT */ | 1209 | /* Set up doublefault TSS pointer in the GDT */ |
1208 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); | 1210 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c index d6b72df89d69..cef3ee30744b 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c | |||
@@ -151,10 +151,11 @@ static void print_update(char *type, int *hdr, int num) | |||
151 | static void cmci_discover(int banks, int boot) | 151 | static void cmci_discover(int banks, int boot) |
152 | { | 152 | { |
153 | unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned); | 153 | unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned); |
154 | unsigned long flags; | ||
154 | int hdr = 0; | 155 | int hdr = 0; |
155 | int i; | 156 | int i; |
156 | 157 | ||
157 | spin_lock(&cmci_discover_lock); | 158 | spin_lock_irqsave(&cmci_discover_lock, flags); |
158 | for (i = 0; i < banks; i++) { | 159 | for (i = 0; i < banks; i++) { |
159 | u64 val; | 160 | u64 val; |
160 | 161 | ||
@@ -184,7 +185,7 @@ static void cmci_discover(int banks, int boot) | |||
184 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); | 185 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); |
185 | } | 186 | } |
186 | } | 187 | } |
187 | spin_unlock(&cmci_discover_lock); | 188 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
188 | if (hdr) | 189 | if (hdr) |
189 | printk(KERN_CONT "\n"); | 190 | printk(KERN_CONT "\n"); |
190 | } | 191 | } |
@@ -211,13 +212,14 @@ void cmci_recheck(void) | |||
211 | */ | 212 | */ |
212 | void cmci_clear(void) | 213 | void cmci_clear(void) |
213 | { | 214 | { |
215 | unsigned long flags; | ||
214 | int i; | 216 | int i; |
215 | int banks; | 217 | int banks; |
216 | u64 val; | 218 | u64 val; |
217 | 219 | ||
218 | if (!cmci_supported(&banks)) | 220 | if (!cmci_supported(&banks)) |
219 | return; | 221 | return; |
220 | spin_lock(&cmci_discover_lock); | 222 | spin_lock_irqsave(&cmci_discover_lock, flags); |
221 | for (i = 0; i < banks; i++) { | 223 | for (i = 0; i < banks; i++) { |
222 | if (!test_bit(i, __get_cpu_var(mce_banks_owned))) | 224 | if (!test_bit(i, __get_cpu_var(mce_banks_owned))) |
223 | continue; | 225 | continue; |
@@ -227,7 +229,7 @@ void cmci_clear(void) | |||
227 | wrmsrl(MSR_IA32_MC0_CTL2 + i, val); | 229 | wrmsrl(MSR_IA32_MC0_CTL2 + i, val); |
228 | __clear_bit(i, __get_cpu_var(mce_banks_owned)); | 230 | __clear_bit(i, __get_cpu_var(mce_banks_owned)); |
229 | } | 231 | } |
230 | spin_unlock(&cmci_discover_lock); | 232 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
231 | } | 233 | } |
232 | 234 | ||
233 | /* | 235 | /* |
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index f93047fed791..d5e30397246b 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
@@ -14,7 +14,7 @@ static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c, | |||
14 | if (c->x86_max_cores * smp_num_siblings > 1) { | 14 | if (c->x86_max_cores * smp_num_siblings > 1) { |
15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); | 15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); |
16 | seq_printf(m, "siblings\t: %d\n", | 16 | seq_printf(m, "siblings\t: %d\n", |
17 | cpumask_weight(cpu_sibling_mask(cpu))); | 17 | cpumask_weight(cpu_core_mask(cpu))); |
18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); | 18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); |
19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); | 19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); |
20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); | 20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index ef2c3563357d..006281302925 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1074,12 +1074,13 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align) | |||
1074 | u64 addr; | 1074 | u64 addr; |
1075 | u64 start; | 1075 | u64 start; |
1076 | 1076 | ||
1077 | start = startt; | 1077 | for (start = startt; ; start += size) { |
1078 | while (size < sizet && (start + 1)) | ||
1079 | start = find_e820_area_size(start, &size, align); | 1078 | start = find_e820_area_size(start, &size, align); |
1080 | 1079 | if (!(start + 1)) | |
1081 | if (size < sizet) | 1080 | return 0; |
1082 | return 0; | 1081 | if (size >= sizet) |
1082 | break; | ||
1083 | } | ||
1083 | 1084 | ||
1084 | #ifdef CONFIG_X86_32 | 1085 | #ifdef CONFIG_X86_32 |
1085 | if (start >= MAXMEM) | 1086 | if (start >= MAXMEM) |
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index e7368c1da01d..c1c429d00130 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c | |||
@@ -194,7 +194,7 @@ void machine_kexec(struct kimage *image) | |||
194 | unsigned int preserve_context); | 194 | unsigned int preserve_context); |
195 | 195 | ||
196 | #ifdef CONFIG_KEXEC_JUMP | 196 | #ifdef CONFIG_KEXEC_JUMP |
197 | if (kexec_image->preserve_context) | 197 | if (image->preserve_context) |
198 | save_processor_state(); | 198 | save_processor_state(); |
199 | #endif | 199 | #endif |
200 | 200 | ||
@@ -253,7 +253,7 @@ void machine_kexec(struct kimage *image) | |||
253 | image->preserve_context); | 253 | image->preserve_context); |
254 | 254 | ||
255 | #ifdef CONFIG_KEXEC_JUMP | 255 | #ifdef CONFIG_KEXEC_JUMP |
256 | if (kexec_image->preserve_context) | 256 | if (image->preserve_context) |
257 | restore_processor_state(); | 257 | restore_processor_state(); |
258 | #endif | 258 | #endif |
259 | 259 | ||
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 89cea4d44679..84c3bf209e98 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c | |||
@@ -274,7 +274,7 @@ void machine_kexec(struct kimage *image) | |||
274 | int save_ftrace_enabled; | 274 | int save_ftrace_enabled; |
275 | 275 | ||
276 | #ifdef CONFIG_KEXEC_JUMP | 276 | #ifdef CONFIG_KEXEC_JUMP |
277 | if (kexec_image->preserve_context) | 277 | if (image->preserve_context) |
278 | save_processor_state(); | 278 | save_processor_state(); |
279 | #endif | 279 | #endif |
280 | 280 | ||
@@ -333,7 +333,7 @@ void machine_kexec(struct kimage *image) | |||
333 | image->preserve_context); | 333 | image->preserve_context); |
334 | 334 | ||
335 | #ifdef CONFIG_KEXEC_JUMP | 335 | #ifdef CONFIG_KEXEC_JUMP |
336 | if (kexec_image->preserve_context) | 336 | if (image->preserve_context) |
337 | restore_processor_state(); | 337 | restore_processor_state(); |
338 | #endif | 338 | #endif |
339 | 339 | ||
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index fd3da1dda1c9..ae4f7b5d7104 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <asm/page.h> | 7 | #include <asm/page.h> |
8 | #include <asm/page_types.h> | 8 | #include <asm/page_types.h> |
9 | #include <asm/sections.h> | 9 | #include <asm/sections.h> |
10 | #include <asm/setup.h> | ||
10 | #include <asm/system.h> | 11 | #include <asm/system.h> |
11 | #include <asm/tlbflush.h> | 12 | #include <asm/tlbflush.h> |
12 | 13 | ||
@@ -304,8 +305,23 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
304 | #endif | 305 | #endif |
305 | 306 | ||
306 | #ifdef CONFIG_X86_64 | 307 | #ifdef CONFIG_X86_64 |
307 | if (!after_bootmem) | 308 | if (!after_bootmem && !start) { |
309 | pud_t *pud; | ||
310 | pmd_t *pmd; | ||
311 | |||
308 | mmu_cr4_features = read_cr4(); | 312 | mmu_cr4_features = read_cr4(); |
313 | |||
314 | /* | ||
315 | * _brk_end cannot change anymore, but it and _end may be | ||
316 | * located on different 2M pages. cleanup_highmap(), however, | ||
317 | * can only consider _end when it runs, so destroy any | ||
318 | * mappings beyond _brk_end here. | ||
319 | */ | ||
320 | pud = pud_offset(pgd_offset_k(_brk_end), _brk_end); | ||
321 | pmd = pmd_offset(pud, _brk_end - 1); | ||
322 | while (++pmd <= pmd_offset(pud, (unsigned long)_end - 1)) | ||
323 | pmd_clear(pmd); | ||
324 | } | ||
309 | #endif | 325 | #endif |
310 | __flush_tlb_all(); | 326 | __flush_tlb_all(); |
311 | 327 | ||
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 4f115e00486b..50dc802a1c46 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -87,7 +87,7 @@ static struct kmmio_probe *get_kmmio_probe(unsigned long addr) | |||
87 | { | 87 | { |
88 | struct kmmio_probe *p; | 88 | struct kmmio_probe *p; |
89 | list_for_each_entry_rcu(p, &kmmio_probes, list) { | 89 | list_for_each_entry_rcu(p, &kmmio_probes, list) { |
90 | if (addr >= p->addr && addr <= (p->addr + p->len)) | 90 | if (addr >= p->addr && addr < (p->addr + p->len)) |
91 | return p; | 91 | return p; |
92 | } | 92 | } |
93 | return NULL; | 93 | return NULL; |
diff --git a/arch/x86/mm/srat_32.c b/arch/x86/mm/srat_32.c index 16ae70fc57e7..29a0e37114f8 100644 --- a/arch/x86/mm/srat_32.c +++ b/arch/x86/mm/srat_32.c | |||
@@ -216,7 +216,7 @@ int __init get_memcfg_from_srat(void) | |||
216 | 216 | ||
217 | if (num_memory_chunks == 0) { | 217 | if (num_memory_chunks == 0) { |
218 | printk(KERN_WARNING | 218 | printk(KERN_WARNING |
219 | "could not finy any ACPI SRAT memory areas.\n"); | 219 | "could not find any ACPI SRAT memory areas.\n"); |
220 | goto out_fail; | 220 | goto out_fail; |
221 | } | 221 | } |
222 | 222 | ||
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index 33c5fa57e43d..01765955baaf 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -361,6 +361,7 @@ static void __init unparse_node(int node) | |||
361 | { | 361 | { |
362 | int i; | 362 | int i; |
363 | node_clear(node, nodes_parsed); | 363 | node_clear(node, nodes_parsed); |
364 | node_clear(node, cpu_nodes_parsed); | ||
364 | for (i = 0; i < MAX_LOCAL_APIC; i++) { | 365 | for (i = 0; i < MAX_LOCAL_APIC; i++) { |
365 | if (apicid_to_node[i] == node) | 366 | if (apicid_to_node[i] == node) |
366 | apicid_to_node[i] = NUMA_NO_NODE; | 367 | apicid_to_node[i] = NUMA_NO_NODE; |
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c index d9d35824c56f..6a40b78b46aa 100644 --- a/arch/x86/vdso/vclock_gettime.c +++ b/arch/x86/vdso/vclock_gettime.c | |||
@@ -104,11 +104,13 @@ notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) | |||
104 | { | 104 | { |
105 | long ret; | 105 | long ret; |
106 | if (likely(gtod->sysctl_enabled && gtod->clock.vread)) { | 106 | if (likely(gtod->sysctl_enabled && gtod->clock.vread)) { |
107 | BUILD_BUG_ON(offsetof(struct timeval, tv_usec) != | 107 | if (likely(tv != NULL)) { |
108 | offsetof(struct timespec, tv_nsec) || | 108 | BUILD_BUG_ON(offsetof(struct timeval, tv_usec) != |
109 | sizeof(*tv) != sizeof(struct timespec)); | 109 | offsetof(struct timespec, tv_nsec) || |
110 | do_realtime((struct timespec *)tv); | 110 | sizeof(*tv) != sizeof(struct timespec)); |
111 | tv->tv_usec /= 1000; | 111 | do_realtime((struct timespec *)tv); |
112 | tv->tv_usec /= 1000; | ||
113 | } | ||
112 | if (unlikely(tz != NULL)) { | 114 | if (unlikely(tz != NULL)) { |
113 | /* Avoid memcpy. Some old compilers fail to inline it */ | 115 | /* Avoid memcpy. Some old compilers fail to inline it */ |
114 | tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest; | 116 | tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest; |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 9842b1212407..e25a78e1113a 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1794,6 +1794,11 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, | |||
1794 | 1794 | ||
1795 | pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir))); | 1795 | pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir))); |
1796 | 1796 | ||
1797 | reserve_early(__pa(xen_start_info->pt_base), | ||
1798 | __pa(xen_start_info->pt_base + | ||
1799 | xen_start_info->nr_pt_frames * PAGE_SIZE), | ||
1800 | "XEN PAGETABLES"); | ||
1801 | |||
1797 | return swapper_pg_dir; | 1802 | return swapper_pg_dir; |
1798 | } | 1803 | } |
1799 | #endif /* CONFIG_X86_64 */ | 1804 | #endif /* CONFIG_X86_64 */ |