diff options
Diffstat (limited to 'arch/x86')
102 files changed, 733 insertions, 399 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bacac556b189..e795b5ba25b2 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -28,7 +28,7 @@ config X86 | |||
28 | select HAVE_KRETPROBES | 28 | select HAVE_KRETPROBES |
29 | select HAVE_FTRACE_MCOUNT_RECORD | 29 | select HAVE_FTRACE_MCOUNT_RECORD |
30 | select HAVE_DYNAMIC_FTRACE | 30 | select HAVE_DYNAMIC_FTRACE |
31 | select HAVE_FTRACE | 31 | select HAVE_FUNCTION_TRACER |
32 | select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) | 32 | select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) |
33 | select HAVE_ARCH_KGDB if !X86_VOYAGER | 33 | select HAVE_ARCH_KGDB if !X86_VOYAGER |
34 | select HAVE_ARCH_TRACEHOOK | 34 | select HAVE_ARCH_TRACEHOOK |
@@ -167,9 +167,12 @@ config GENERIC_PENDING_IRQ | |||
167 | config X86_SMP | 167 | config X86_SMP |
168 | bool | 168 | bool |
169 | depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64) | 169 | depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64) |
170 | select USE_GENERIC_SMP_HELPERS | ||
171 | default y | 170 | default y |
172 | 171 | ||
172 | config USE_GENERIC_SMP_HELPERS | ||
173 | def_bool y | ||
174 | depends on SMP | ||
175 | |||
173 | config X86_32_SMP | 176 | config X86_32_SMP |
174 | def_bool y | 177 | def_bool y |
175 | depends on X86_32 && SMP | 178 | depends on X86_32 && SMP |
@@ -231,6 +234,10 @@ config SMP | |||
231 | 234 | ||
232 | If you don't know what to do here, say N. | 235 | If you don't know what to do here, say N. |
233 | 236 | ||
237 | config X86_HAS_BOOT_CPU_ID | ||
238 | def_bool y | ||
239 | depends on X86_VOYAGER | ||
240 | |||
234 | config X86_FIND_SMP_CONFIG | 241 | config X86_FIND_SMP_CONFIG |
235 | def_bool y | 242 | def_bool y |
236 | depends on X86_MPPARSE || X86_VOYAGER | 243 | depends on X86_MPPARSE || X86_VOYAGER |
@@ -1494,7 +1501,7 @@ config HAVE_ARCH_EARLY_PFN_TO_NID | |||
1494 | def_bool X86_64 | 1501 | def_bool X86_64 |
1495 | depends on NUMA | 1502 | depends on NUMA |
1496 | 1503 | ||
1497 | menu "Power management options" | 1504 | menu "Power management and ACPI options" |
1498 | depends on !X86_VOYAGER | 1505 | depends on !X86_VOYAGER |
1499 | 1506 | ||
1500 | config ARCH_HIBERNATION_HEADER | 1507 | config ARCH_HIBERNATION_HEADER |
@@ -1894,6 +1901,10 @@ config SYSVIPC_COMPAT | |||
1894 | endmenu | 1901 | endmenu |
1895 | 1902 | ||
1896 | 1903 | ||
1904 | config HAVE_ATOMIC_IOMAP | ||
1905 | def_bool y | ||
1906 | depends on X86_32 | ||
1907 | |||
1897 | source "net/Kconfig" | 1908 | source "net/Kconfig" |
1898 | 1909 | ||
1899 | source "drivers/Kconfig" | 1910 | source "drivers/Kconfig" |
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index 0b7c4a3f0651..b815664fe370 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu | |||
@@ -513,19 +513,19 @@ config CPU_SUP_UMC_32 | |||
513 | If unsure, say N. | 513 | If unsure, say N. |
514 | 514 | ||
515 | config X86_DS | 515 | config X86_DS |
516 | bool "Debug Store support" | 516 | def_bool X86_PTRACE_BTS |
517 | default y | 517 | depends on X86_DEBUGCTLMSR |
518 | help | ||
519 | Add support for Debug Store. | ||
520 | This allows the kernel to provide a memory buffer to the hardware | ||
521 | to store various profiling and tracing events. | ||
522 | 518 | ||
523 | config X86_PTRACE_BTS | 519 | config X86_PTRACE_BTS |
524 | bool "ptrace interface to Branch Trace Store" | 520 | bool "Branch Trace Store" |
525 | default y | 521 | default y |
526 | depends on (X86_DS && X86_DEBUGCTLMSR) | 522 | depends on X86_DEBUGCTLMSR |
527 | help | 523 | help |
528 | Add a ptrace interface to allow collecting an execution trace | 524 | This adds a ptrace interface to the hardware's branch trace store. |
529 | of the traced task. | 525 | |
530 | This collects control flow changes in a (cyclic) buffer and allows | 526 | Debuggers may use it to collect an execution trace of the debugged |
531 | debuggers to fill in the gaps and show an execution trace of the debuggee. | 527 | application in order to answer the question 'how did I get here?'. |
528 | Debuggers may trace user mode as well as kernel mode. | ||
529 | |||
530 | Say Y unless there is no application development on this machine | ||
531 | and you want to save a small amount of code size. | ||
diff --git a/arch/x86/boot/compressed/.gitignore b/arch/x86/boot/compressed/.gitignore index be0ed065249b..63eff3b04d01 100644 --- a/arch/x86/boot/compressed/.gitignore +++ b/arch/x86/boot/compressed/.gitignore | |||
@@ -1 +1,3 @@ | |||
1 | relocs | 1 | relocs |
2 | vmlinux.bin.all | ||
3 | vmlinux.relocs | ||
diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c index 0be77b39328a..7e8e8b25f5f6 100644 --- a/arch/x86/boot/tty.c +++ b/arch/x86/boot/tty.c | |||
@@ -74,7 +74,7 @@ static int kbd_pending(void) | |||
74 | { | 74 | { |
75 | u8 pending; | 75 | u8 pending; |
76 | asm volatile("int $0x16; setnz %0" | 76 | asm volatile("int $0x16; setnz %0" |
77 | : "=rm" (pending) | 77 | : "=qm" (pending) |
78 | : "a" (0x0100)); | 78 | : "a" (0x0100)); |
79 | return pending; | 79 | return pending; |
80 | } | 80 | } |
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 8d676d8ecde9..9830681446ad 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
@@ -113,7 +113,6 @@ static inline void acpi_disable_pci(void) | |||
113 | acpi_pci_disabled = 1; | 113 | acpi_pci_disabled = 1; |
114 | acpi_noirq_set(); | 114 | acpi_noirq_set(); |
115 | } | 115 | } |
116 | extern int acpi_irq_balance_set(char *str); | ||
117 | 116 | ||
118 | /* routines for saving/restoring kernel state */ | 117 | /* routines for saving/restoring kernel state */ |
119 | extern int acpi_save_state_mem(void); | 118 | extern int acpi_save_state_mem(void); |
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h index 1a30c0440c6b..ac302a2fa339 100644 --- a/arch/x86/include/asm/amd_iommu_types.h +++ b/arch/x86/include/asm/amd_iommu_types.h | |||
@@ -251,13 +251,6 @@ struct amd_iommu { | |||
251 | /* Pointer to PCI device of this IOMMU */ | 251 | /* Pointer to PCI device of this IOMMU */ |
252 | struct pci_dev *dev; | 252 | struct pci_dev *dev; |
253 | 253 | ||
254 | /* | ||
255 | * Capability pointer. There could be more than one IOMMU per PCI | ||
256 | * device function if there are more than one AMD IOMMU capability | ||
257 | * pointers. | ||
258 | */ | ||
259 | u16 cap_ptr; | ||
260 | |||
261 | /* physical address of MMIO space */ | 254 | /* physical address of MMIO space */ |
262 | u64 mmio_phys; | 255 | u64 mmio_phys; |
263 | /* virtual address of MMIO space */ | 256 | /* virtual address of MMIO space */ |
@@ -266,6 +259,13 @@ struct amd_iommu { | |||
266 | /* capabilities of that IOMMU read from ACPI */ | 259 | /* capabilities of that IOMMU read from ACPI */ |
267 | u32 cap; | 260 | u32 cap; |
268 | 261 | ||
262 | /* | ||
263 | * Capability pointer. There could be more than one IOMMU per PCI | ||
264 | * device function if there are more than one AMD IOMMU capability | ||
265 | * pointers. | ||
266 | */ | ||
267 | u16 cap_ptr; | ||
268 | |||
269 | /* pci domain of this IOMMU */ | 269 | /* pci domain of this IOMMU */ |
270 | u16 pci_seg; | 270 | u16 pci_seg; |
271 | 271 | ||
@@ -284,19 +284,19 @@ struct amd_iommu { | |||
284 | /* size of command buffer */ | 284 | /* size of command buffer */ |
285 | u32 cmd_buf_size; | 285 | u32 cmd_buf_size; |
286 | 286 | ||
287 | /* event buffer virtual address */ | ||
288 | u8 *evt_buf; | ||
289 | /* size of event buffer */ | 287 | /* size of event buffer */ |
290 | u32 evt_buf_size; | 288 | u32 evt_buf_size; |
289 | /* event buffer virtual address */ | ||
290 | u8 *evt_buf; | ||
291 | /* MSI number for event interrupt */ | 291 | /* MSI number for event interrupt */ |
292 | u16 evt_msi_num; | 292 | u16 evt_msi_num; |
293 | 293 | ||
294 | /* if one, we need to send a completion wait command */ | ||
295 | int need_sync; | ||
296 | |||
297 | /* true if interrupts for this IOMMU are already enabled */ | 294 | /* true if interrupts for this IOMMU are already enabled */ |
298 | bool int_enabled; | 295 | bool int_enabled; |
299 | 296 | ||
297 | /* if one, we need to send a completion wait command */ | ||
298 | int need_sync; | ||
299 | |||
300 | /* default dma_ops domain for that IOMMU */ | 300 | /* default dma_ops domain for that IOMMU */ |
301 | struct dma_ops_domain *default_dom; | 301 | struct dma_ops_domain *default_dom; |
302 | }; | 302 | }; |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index f73e95d75b45..cfdf8c2c5c31 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -91,7 +91,7 @@ | |||
91 | #define X86_FEATURE_11AP (3*32+19) /* "" Bad local APIC aka 11AP */ | 91 | #define X86_FEATURE_11AP (3*32+19) /* "" Bad local APIC aka 11AP */ |
92 | #define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */ | 92 | #define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */ |
93 | #define X86_FEATURE_AMDC1E (3*32+21) /* AMD C1E detected */ | 93 | #define X86_FEATURE_AMDC1E (3*32+21) /* AMD C1E detected */ |
94 | #define X86_FEATURE_XTOPOLOGY (3*32+21) /* cpu topology enum extensions */ | 94 | #define X86_FEATURE_XTOPOLOGY (3*32+22) /* cpu topology enum extensions */ |
95 | 95 | ||
96 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 96 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
97 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ | 97 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ |
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 4a5397bfce27..097794ff6b79 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h | |||
@@ -71,15 +71,13 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev) | |||
71 | /* Make sure we keep the same behaviour */ | 71 | /* Make sure we keep the same behaviour */ |
72 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 72 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
73 | { | 73 | { |
74 | #ifdef CONFIG_X86_32 | 74 | #ifdef CONFIG_X86_64 |
75 | return 0; | ||
76 | #else | ||
77 | struct dma_mapping_ops *ops = get_dma_ops(dev); | 75 | struct dma_mapping_ops *ops = get_dma_ops(dev); |
78 | if (ops->mapping_error) | 76 | if (ops->mapping_error) |
79 | return ops->mapping_error(dev, dma_addr); | 77 | return ops->mapping_error(dev, dma_addr); |
80 | 78 | ||
81 | return (dma_addr == bad_dma_address); | ||
82 | #endif | 79 | #endif |
80 | return (dma_addr == bad_dma_address); | ||
83 | } | 81 | } |
84 | 82 | ||
85 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 83 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
@@ -255,9 +253,11 @@ static inline unsigned long dma_alloc_coherent_mask(struct device *dev, | |||
255 | 253 | ||
256 | static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp) | 254 | static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp) |
257 | { | 255 | { |
258 | #ifdef CONFIG_X86_64 | ||
259 | unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp); | 256 | unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp); |
260 | 257 | ||
258 | if (dma_mask <= DMA_24BIT_MASK) | ||
259 | gfp |= GFP_DMA; | ||
260 | #ifdef CONFIG_X86_64 | ||
261 | if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA)) | 261 | if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA)) |
262 | gfp |= GFP_DMA32; | 262 | gfp |= GFP_DMA32; |
263 | #endif | 263 | #endif |
diff --git a/arch/x86/include/asm/ds.h b/arch/x86/include/asm/ds.h index 72c5a190bf48..a95008457ea4 100644 --- a/arch/x86/include/asm/ds.h +++ b/arch/x86/include/asm/ds.h | |||
@@ -23,12 +23,13 @@ | |||
23 | #ifndef _ASM_X86_DS_H | 23 | #ifndef _ASM_X86_DS_H |
24 | #define _ASM_X86_DS_H | 24 | #define _ASM_X86_DS_H |
25 | 25 | ||
26 | #ifdef CONFIG_X86_DS | ||
27 | 26 | ||
28 | #include <linux/types.h> | 27 | #include <linux/types.h> |
29 | #include <linux/init.h> | 28 | #include <linux/init.h> |
30 | 29 | ||
31 | 30 | ||
31 | #ifdef CONFIG_X86_DS | ||
32 | |||
32 | struct task_struct; | 33 | struct task_struct; |
33 | 34 | ||
34 | /* | 35 | /* |
@@ -232,7 +233,8 @@ extern void ds_free(struct ds_context *context); | |||
232 | 233 | ||
233 | #else /* CONFIG_X86_DS */ | 234 | #else /* CONFIG_X86_DS */ |
234 | 235 | ||
235 | #define ds_init_intel(config) do {} while (0) | 236 | struct cpuinfo_x86; |
237 | static inline void __cpuinit ds_init_intel(struct cpuinfo_x86 *ignored) {} | ||
236 | 238 | ||
237 | #endif /* CONFIG_X86_DS */ | 239 | #endif /* CONFIG_X86_DS */ |
238 | #endif /* _ASM_X86_DS_H */ | 240 | #endif /* _ASM_X86_DS_H */ |
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h index 3ffc5a7bf667..398493461913 100644 --- a/arch/x86/include/asm/es7000/wakecpu.h +++ b/arch/x86/include/asm/es7000/wakecpu.h | |||
@@ -50,10 +50,9 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) | |||
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | #if APIC_DEBUG | 53 | #define inquire_remote_apic(apicid) do { \ |
54 | #define inquire_remote_apic(apicid) __inquire_remote_apic(apicid) | 54 | if (apic_verbosity >= APIC_DEBUG) \ |
55 | #else | 55 | __inquire_remote_apic(apicid); \ |
56 | #define inquire_remote_apic(apicid) {} | 56 | } while (0) |
57 | #endif | ||
58 | 57 | ||
59 | #endif /* __ASM_MACH_WAKECPU_H */ | 58 | #endif /* __ASM_MACH_WAKECPU_H */ |
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 8668a94f850e..23696d44a0af 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h | |||
@@ -9,6 +9,10 @@ | |||
9 | 9 | ||
10 | extern int fixmaps_set; | 10 | extern int fixmaps_set; |
11 | 11 | ||
12 | extern pte_t *kmap_pte; | ||
13 | extern pgprot_t kmap_prot; | ||
14 | extern pte_t *pkmap_page_table; | ||
15 | |||
12 | void __native_set_fixmap(enum fixed_addresses idx, pte_t pte); | 16 | void __native_set_fixmap(enum fixed_addresses idx, pte_t pte); |
13 | void native_set_fixmap(enum fixed_addresses idx, | 17 | void native_set_fixmap(enum fixed_addresses idx, |
14 | unsigned long phys, pgprot_t flags); | 18 | unsigned long phys, pgprot_t flags); |
diff --git a/arch/x86/include/asm/fixmap_32.h b/arch/x86/include/asm/fixmap_32.h index 09f29ab5c139..c7115c1d7217 100644 --- a/arch/x86/include/asm/fixmap_32.h +++ b/arch/x86/include/asm/fixmap_32.h | |||
@@ -28,10 +28,8 @@ extern unsigned long __FIXADDR_TOP; | |||
28 | #include <asm/acpi.h> | 28 | #include <asm/acpi.h> |
29 | #include <asm/apicdef.h> | 29 | #include <asm/apicdef.h> |
30 | #include <asm/page.h> | 30 | #include <asm/page.h> |
31 | #ifdef CONFIG_HIGHMEM | ||
32 | #include <linux/threads.h> | 31 | #include <linux/threads.h> |
33 | #include <asm/kmap_types.h> | 32 | #include <asm/kmap_types.h> |
34 | #endif | ||
35 | 33 | ||
36 | /* | 34 | /* |
37 | * Here we define all the compile-time 'special' virtual | 35 | * Here we define all the compile-time 'special' virtual |
@@ -75,10 +73,8 @@ enum fixed_addresses { | |||
75 | #ifdef CONFIG_X86_CYCLONE_TIMER | 73 | #ifdef CONFIG_X86_CYCLONE_TIMER |
76 | FIX_CYCLONE_TIMER, /*cyclone timer register*/ | 74 | FIX_CYCLONE_TIMER, /*cyclone timer register*/ |
77 | #endif | 75 | #endif |
78 | #ifdef CONFIG_HIGHMEM | ||
79 | FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ | 76 | FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ |
80 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, | 77 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, |
81 | #endif | ||
82 | #ifdef CONFIG_PCI_MMCONFIG | 78 | #ifdef CONFIG_PCI_MMCONFIG |
83 | FIX_PCIE_MCFG, | 79 | FIX_PCIE_MCFG, |
84 | #endif | 80 | #endif |
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h index 47f7e65e6c1d..9e8bc29b8b17 100644 --- a/arch/x86/include/asm/ftrace.h +++ b/arch/x86/include/asm/ftrace.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _ASM_X86_FTRACE_H | 1 | #ifndef _ASM_X86_FTRACE_H |
2 | #define _ASM_X86_FTRACE_H | 2 | #define _ASM_X86_FTRACE_H |
3 | 3 | ||
4 | #ifdef CONFIG_FTRACE | 4 | #ifdef CONFIG_FUNCTION_TRACER |
5 | #define MCOUNT_ADDR ((long)(mcount)) | 5 | #define MCOUNT_ADDR ((long)(mcount)) |
6 | #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ | 6 | #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ |
7 | 7 | ||
@@ -19,6 +19,6 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr) | |||
19 | } | 19 | } |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #endif /* CONFIG_FTRACE */ | 22 | #endif /* CONFIG_FUNCTION_TRACER */ |
23 | 23 | ||
24 | #endif /* _ASM_X86_FTRACE_H */ | 24 | #endif /* _ASM_X86_FTRACE_H */ |
diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h index a3b3b7c3027b..bf9276bea660 100644 --- a/arch/x86/include/asm/highmem.h +++ b/arch/x86/include/asm/highmem.h | |||
@@ -25,14 +25,11 @@ | |||
25 | #include <asm/kmap_types.h> | 25 | #include <asm/kmap_types.h> |
26 | #include <asm/tlbflush.h> | 26 | #include <asm/tlbflush.h> |
27 | #include <asm/paravirt.h> | 27 | #include <asm/paravirt.h> |
28 | #include <asm/fixmap.h> | ||
28 | 29 | ||
29 | /* declarations for highmem.c */ | 30 | /* declarations for highmem.c */ |
30 | extern unsigned long highstart_pfn, highend_pfn; | 31 | extern unsigned long highstart_pfn, highend_pfn; |
31 | 32 | ||
32 | extern pte_t *kmap_pte; | ||
33 | extern pgprot_t kmap_prot; | ||
34 | extern pte_t *pkmap_page_table; | ||
35 | |||
36 | /* | 33 | /* |
37 | * Right now we initialize only a single pte table. It can be extended | 34 | * Right now we initialize only a single pte table. It can be extended |
38 | * easily, subsequent pte tables have to be allocated in one physical | 35 | * easily, subsequent pte tables have to be allocated in one physical |
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 5618a103f395..ac2abc88cd95 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h | |||
@@ -82,9 +82,9 @@ extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size); | |||
82 | extern void early_ioremap_init(void); | 82 | extern void early_ioremap_init(void); |
83 | extern void early_ioremap_clear(void); | 83 | extern void early_ioremap_clear(void); |
84 | extern void early_ioremap_reset(void); | 84 | extern void early_ioremap_reset(void); |
85 | extern void *early_ioremap(unsigned long offset, unsigned long size); | 85 | extern void __iomem *early_ioremap(unsigned long offset, unsigned long size); |
86 | extern void *early_memremap(unsigned long offset, unsigned long size); | 86 | extern void __iomem *early_memremap(unsigned long offset, unsigned long size); |
87 | extern void early_iounmap(void *addr, unsigned long size); | 87 | extern void early_iounmap(void __iomem *addr, unsigned long size); |
88 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | 88 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); |
89 | 89 | ||
90 | 90 | ||
diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h new file mode 100644 index 000000000000..c1f06289b14b --- /dev/null +++ b/arch/x86/include/asm/iomap.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright © 2008 Ingo Molnar | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/fs.h> | ||
20 | #include <linux/mm.h> | ||
21 | #include <linux/uaccess.h> | ||
22 | #include <asm/cacheflush.h> | ||
23 | #include <asm/pgtable.h> | ||
24 | #include <asm/tlbflush.h> | ||
25 | |||
26 | void * | ||
27 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); | ||
28 | |||
29 | void | ||
30 | iounmap_atomic(void *kvaddr, enum km_type type); | ||
diff --git a/arch/x86/include/asm/iommu.h b/arch/x86/include/asm/iommu.h index 98e28ea8cd16..0b500c5b6446 100644 --- a/arch/x86/include/asm/iommu.h +++ b/arch/x86/include/asm/iommu.h | |||
@@ -6,8 +6,6 @@ extern void no_iommu_init(void); | |||
6 | extern struct dma_mapping_ops nommu_dma_ops; | 6 | extern struct dma_mapping_ops nommu_dma_ops; |
7 | extern int force_iommu, no_iommu; | 7 | extern int force_iommu, no_iommu; |
8 | extern int iommu_detected; | 8 | extern int iommu_detected; |
9 | extern int dmar_disabled; | ||
10 | extern int forbid_dac; | ||
11 | 9 | ||
12 | extern unsigned long iommu_nr_pages(unsigned long addr, unsigned long len); | 10 | extern unsigned long iommu_nr_pages(unsigned long addr, unsigned long len); |
13 | 11 | ||
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index d843ed0e9b2e..0005adb0f941 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h | |||
@@ -101,30 +101,22 @@ | |||
101 | #define LAST_VM86_IRQ 15 | 101 | #define LAST_VM86_IRQ 15 |
102 | #define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15) | 102 | #define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15) |
103 | 103 | ||
104 | #ifdef CONFIG_X86_64 | 104 | #if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_X86_VOYAGER) |
105 | # if NR_CPUS < MAX_IO_APICS | 105 | # if NR_CPUS < MAX_IO_APICS |
106 | # define NR_IRQS (NR_VECTORS + (32 * NR_CPUS)) | 106 | # define NR_IRQS (NR_VECTORS + (32 * NR_CPUS)) |
107 | # else | 107 | # else |
108 | # define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS)) | 108 | # define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS)) |
109 | # endif | 109 | # endif |
110 | 110 | ||
111 | #elif !defined(CONFIG_X86_VOYAGER) | 111 | #elif defined(CONFIG_X86_VOYAGER) |
112 | 112 | ||
113 | # if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT) || defined(CONFIG_X86_VISWS) | 113 | # define NR_IRQS 224 |
114 | |||
115 | # define NR_IRQS 224 | ||
116 | |||
117 | # else /* IO_APIC || PARAVIRT */ | ||
118 | |||
119 | # define NR_IRQS 16 | ||
120 | |||
121 | # endif | ||
122 | 114 | ||
123 | #else /* !VISWS && !VOYAGER */ | 115 | #else /* IO_APIC || VOYAGER */ |
124 | 116 | ||
125 | # define NR_IRQS 224 | 117 | # define NR_IRQS 16 |
126 | 118 | ||
127 | #endif /* VISWS */ | 119 | #endif |
128 | 120 | ||
129 | /* Voyager specific defines */ | 121 | /* Voyager specific defines */ |
130 | /* These define the CPIs we use in linux */ | 122 | /* These define the CPIs we use in linux */ |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 65679d006337..8346be87cfa1 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -364,6 +364,9 @@ struct kvm_arch{ | |||
364 | 364 | ||
365 | struct page *ept_identity_pagetable; | 365 | struct page *ept_identity_pagetable; |
366 | bool ept_identity_pagetable_done; | 366 | bool ept_identity_pagetable_done; |
367 | |||
368 | unsigned long irq_sources_bitmap; | ||
369 | unsigned long irq_states[KVM_IOAPIC_NUM_PINS]; | ||
367 | }; | 370 | }; |
368 | 371 | ||
369 | struct kvm_vm_stat { | 372 | struct kvm_vm_stat { |
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h index d5c0b826a4ff..9d80db91e992 100644 --- a/arch/x86/include/asm/mach-default/mach_wakecpu.h +++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h | |||
@@ -33,10 +33,9 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) | |||
33 | { | 33 | { |
34 | } | 34 | } |
35 | 35 | ||
36 | #if APIC_DEBUG | 36 | #define inquire_remote_apic(apicid) do { \ |
37 | #define inquire_remote_apic(apicid) __inquire_remote_apic(apicid) | 37 | if (apic_verbosity >= APIC_DEBUG) \ |
38 | #else | 38 | __inquire_remote_apic(apicid); \ |
39 | #define inquire_remote_apic(apicid) {} | 39 | } while (0) |
40 | #endif | ||
41 | 40 | ||
42 | #endif /* _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H */ | 41 | #endif /* _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H */ |
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 485bdf059ffb..07f1af494ca5 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h | |||
@@ -34,10 +34,14 @@ static inline void get_memcfg_numa(void) | |||
34 | 34 | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | 35 | extern int early_pfn_to_nid(unsigned long pfn); |
36 | 36 | ||
37 | extern void resume_map_numa_kva(pgd_t *pgd); | ||
38 | |||
37 | #else /* !CONFIG_NUMA */ | 39 | #else /* !CONFIG_NUMA */ |
38 | 40 | ||
39 | #define get_memcfg_numa get_memcfg_numa_flat | 41 | #define get_memcfg_numa get_memcfg_numa_flat |
40 | 42 | ||
43 | static inline void resume_map_numa_kva(pgd_t *pgd) {} | ||
44 | |||
41 | #endif /* CONFIG_NUMA */ | 45 | #endif /* CONFIG_NUMA */ |
42 | 46 | ||
43 | #ifdef CONFIG_DISCONTIGMEM | 47 | #ifdef CONFIG_DISCONTIGMEM |
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 478a9245aae1..397efa375581 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h | |||
@@ -108,9 +108,7 @@ static __always_inline unsigned long long __native_read_tsc(void) | |||
108 | { | 108 | { |
109 | DECLARE_ARGS(val, low, high); | 109 | DECLARE_ARGS(val, low, high); |
110 | 110 | ||
111 | rdtsc_barrier(); | ||
112 | asm volatile("rdtsc" : EAX_EDX_RET(val, low, high)); | 111 | asm volatile("rdtsc" : EAX_EDX_RET(val, low, high)); |
113 | rdtsc_barrier(); | ||
114 | 112 | ||
115 | return EAX_EDX_VAL(val, low, high); | 113 | return EAX_EDX_VAL(val, low, high); |
116 | } | 114 | } |
diff --git a/arch/x86/include/asm/pci_64.h b/arch/x86/include/asm/pci_64.h index 5b28995d664e..d02d936840a3 100644 --- a/arch/x86/include/asm/pci_64.h +++ b/arch/x86/include/asm/pci_64.h | |||
@@ -34,8 +34,6 @@ extern void pci_iommu_alloc(void); | |||
34 | */ | 34 | */ |
35 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) | 35 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
36 | 36 | ||
37 | #if defined(CONFIG_GART_IOMMU) || defined(CONFIG_CALGARY_IOMMU) | ||
38 | |||
39 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | 37 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ |
40 | dma_addr_t ADDR_NAME; | 38 | dma_addr_t ADDR_NAME; |
41 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | 39 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ |
@@ -49,18 +47,6 @@ extern void pci_iommu_alloc(void); | |||
49 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | 47 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ |
50 | (((PTR)->LEN_NAME) = (VAL)) | 48 | (((PTR)->LEN_NAME) = (VAL)) |
51 | 49 | ||
52 | #else | ||
53 | /* No IOMMU */ | ||
54 | |||
55 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
56 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
57 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
58 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
59 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
60 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
61 | |||
62 | #endif | ||
63 | |||
64 | #endif /* __KERNEL__ */ | 50 | #endif /* __KERNEL__ */ |
65 | 51 | ||
66 | #endif /* _ASM_X86_PCI_64_H */ | 52 | #endif /* _ASM_X86_PCI_64_H */ |
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index fb16cec702e4..52597aeadfff 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h | |||
@@ -120,13 +120,13 @@ static inline void pud_clear(pud_t *pudp) | |||
120 | write_cr3(pgd); | 120 | write_cr3(pgd); |
121 | } | 121 | } |
122 | 122 | ||
123 | #define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_PFN_MASK)) | 123 | #define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT) |
124 | 124 | ||
125 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK)) | 125 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK)) |
126 | 126 | ||
127 | 127 | ||
128 | /* Find an entry in the second-level page table.. */ | 128 | /* Find an entry in the second-level page table.. */ |
129 | #define pmd_offset(pud, address) ((pmd_t *)pud_page(*(pud)) + \ | 129 | #define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \ |
130 | pmd_index(address)) | 130 | pmd_index(address)) |
131 | 131 | ||
132 | #ifdef CONFIG_SMP | 132 | #ifdef CONFIG_SMP |
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index d1531c8480b7..eefb0594b058 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h | |||
@@ -271,8 +271,6 @@ extern int do_get_thread_area(struct task_struct *p, int idx, | |||
271 | extern int do_set_thread_area(struct task_struct *p, int idx, | 271 | extern int do_set_thread_area(struct task_struct *p, int idx, |
272 | struct user_desc __user *info, int can_allocate); | 272 | struct user_desc __user *info, int can_allocate); |
273 | 273 | ||
274 | #define __ARCH_WANT_COMPAT_SYS_PTRACE | ||
275 | |||
276 | #endif /* __KERNEL__ */ | 274 | #endif /* __KERNEL__ */ |
277 | 275 | ||
278 | #endif /* !__ASSEMBLY__ */ | 276 | #endif /* !__ASSEMBLY__ */ |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 2766021aef80..d12811ce51d9 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -225,5 +225,11 @@ static inline int hard_smp_processor_id(void) | |||
225 | 225 | ||
226 | #endif /* CONFIG_X86_LOCAL_APIC */ | 226 | #endif /* CONFIG_X86_LOCAL_APIC */ |
227 | 227 | ||
228 | #ifdef CONFIG_X86_HAS_BOOT_CPU_ID | ||
229 | extern unsigned char boot_cpu_id; | ||
230 | #else | ||
231 | #define boot_cpu_id 0 | ||
232 | #endif | ||
233 | |||
228 | #endif /* __ASSEMBLY__ */ | 234 | #endif /* __ASSEMBLY__ */ |
229 | #endif /* _ASM_X86_SMP_H */ | 235 | #endif /* _ASM_X86_SMP_H */ |
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 90ac7718469a..ff386ff50ed7 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
@@ -154,7 +154,7 @@ extern unsigned long node_remap_size[]; | |||
154 | 154 | ||
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | /* sched_domains SD_NODE_INIT for NUMAQ machines */ | 157 | /* sched_domains SD_NODE_INIT for NUMA machines */ |
158 | #define SD_NODE_INIT (struct sched_domain) { \ | 158 | #define SD_NODE_INIT (struct sched_domain) { \ |
159 | .min_interval = 8, \ | 159 | .min_interval = 8, \ |
160 | .max_interval = 32, \ | 160 | .max_interval = 32, \ |
@@ -169,8 +169,9 @@ extern unsigned long node_remap_size[]; | |||
169 | .flags = SD_LOAD_BALANCE \ | 169 | .flags = SD_LOAD_BALANCE \ |
170 | | SD_BALANCE_EXEC \ | 170 | | SD_BALANCE_EXEC \ |
171 | | SD_BALANCE_FORK \ | 171 | | SD_BALANCE_FORK \ |
172 | | SD_SERIALIZE \ | 172 | | SD_WAKE_AFFINE \ |
173 | | SD_WAKE_BALANCE, \ | 173 | | SD_WAKE_BALANCE \ |
174 | | SD_SERIALIZE, \ | ||
174 | .last_balance = jiffies, \ | 175 | .last_balance = jiffies, \ |
175 | .balance_interval = 1, \ | 176 | .balance_interval = 1, \ |
176 | } | 177 | } |
@@ -238,7 +239,7 @@ struct pci_bus; | |||
238 | void set_pci_bus_resources_arch_default(struct pci_bus *b); | 239 | void set_pci_bus_resources_arch_default(struct pci_bus *b); |
239 | 240 | ||
240 | #ifdef CONFIG_SMP | 241 | #ifdef CONFIG_SMP |
241 | #define mc_capable() (boot_cpu_data.x86_max_cores > 1) | 242 | #define mc_capable() (cpus_weight(per_cpu(cpu_core_map, 0)) != nr_cpu_ids) |
242 | #define smt_capable() (smp_num_siblings > 1) | 243 | #define smt_capable() (smp_num_siblings > 1) |
243 | #endif | 244 | #endif |
244 | 245 | ||
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h index 38ae163cc91b..9cd83a8e40d5 100644 --- a/arch/x86/include/asm/tsc.h +++ b/arch/x86/include/asm/tsc.h | |||
@@ -34,6 +34,8 @@ static inline cycles_t get_cycles(void) | |||
34 | 34 | ||
35 | static __always_inline cycles_t vget_cycles(void) | 35 | static __always_inline cycles_t vget_cycles(void) |
36 | { | 36 | { |
37 | cycles_t cycles; | ||
38 | |||
37 | /* | 39 | /* |
38 | * We only do VDSOs on TSC capable CPUs, so this shouldnt | 40 | * We only do VDSOs on TSC capable CPUs, so this shouldnt |
39 | * access boot_cpu_data (which is not VDSO-safe): | 41 | * access boot_cpu_data (which is not VDSO-safe): |
@@ -42,7 +44,11 @@ static __always_inline cycles_t vget_cycles(void) | |||
42 | if (!cpu_has_tsc) | 44 | if (!cpu_has_tsc) |
43 | return 0; | 45 | return 0; |
44 | #endif | 46 | #endif |
45 | return (cycles_t)__native_read_tsc(); | 47 | rdtsc_barrier(); |
48 | cycles = (cycles_t)__native_read_tsc(); | ||
49 | rdtsc_barrier(); | ||
50 | |||
51 | return cycles; | ||
46 | } | 52 | } |
47 | 53 | ||
48 | extern void tsc_init(void); | 54 | extern void tsc_init(void); |
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h index 664f15280f14..f8cfd00db450 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h | |||
@@ -46,7 +46,7 @@ int __copy_from_user(void *dst, const void __user *src, unsigned size) | |||
46 | return ret; | 46 | return ret; |
47 | case 10: | 47 | case 10: |
48 | __get_user_asm(*(u64 *)dst, (u64 __user *)src, | 48 | __get_user_asm(*(u64 *)dst, (u64 __user *)src, |
49 | ret, "q", "", "=r", 16); | 49 | ret, "q", "", "=r", 10); |
50 | if (unlikely(ret)) | 50 | if (unlikely(ret)) |
51 | return ret; | 51 | return ret; |
52 | __get_user_asm(*(u16 *)(8 + (char *)dst), | 52 | __get_user_asm(*(u16 *)(8 + (char *)dst), |
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 834b2c1d89fb..d2e415e6666f 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
@@ -639,8 +639,8 @@ __SYSCALL(__NR_fallocate, sys_fallocate) | |||
639 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) | 639 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) |
640 | #define __NR_timerfd_gettime 287 | 640 | #define __NR_timerfd_gettime 287 |
641 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) | 641 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) |
642 | #define __NR_paccept 288 | 642 | #define __NR_accept4 288 |
643 | __SYSCALL(__NR_paccept, sys_paccept) | 643 | __SYSCALL(__NR_accept4, sys_accept4) |
644 | #define __NR_signalfd4 289 | 644 | #define __NR_signalfd4 289 |
645 | __SYSCALL(__NR_signalfd4, sys_signalfd4) | 645 | __SYSCALL(__NR_signalfd4, sys_signalfd4) |
646 | #define __NR_eventfd2 290 | 646 | #define __NR_eventfd2 290 |
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index c6ad93e315c8..7a5782610b2b 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/numa.h> | 14 | #include <linux/numa.h> |
15 | #include <linux/percpu.h> | 15 | #include <linux/percpu.h> |
16 | #include <linux/timer.h> | ||
16 | #include <asm/types.h> | 17 | #include <asm/types.h> |
17 | #include <asm/percpu.h> | 18 | #include <asm/percpu.h> |
18 | 19 | ||
diff --git a/arch/x86/include/asm/voyager.h b/arch/x86/include/asm/voyager.h index 9c811d2e6f91..b3e647307625 100644 --- a/arch/x86/include/asm/voyager.h +++ b/arch/x86/include/asm/voyager.h | |||
@@ -520,6 +520,7 @@ extern void voyager_restart(void); | |||
520 | extern void voyager_cat_power_off(void); | 520 | extern void voyager_cat_power_off(void); |
521 | extern void voyager_cat_do_common_interrupt(void); | 521 | extern void voyager_cat_do_common_interrupt(void); |
522 | extern void voyager_handle_nmi(void); | 522 | extern void voyager_handle_nmi(void); |
523 | extern void voyager_smp_intr_init(void); | ||
523 | /* Commands for the following are */ | 524 | /* Commands for the following are */ |
524 | #define VOYAGER_PSI_READ 0 | 525 | #define VOYAGER_PSI_READ 0 |
525 | #define VOYAGER_PSI_WRITE 1 | 526 | #define VOYAGER_PSI_WRITE 1 |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index d7e5a58ee22f..b62a7667828e 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -6,11 +6,12 @@ extra-y := head_$(BITS).o head$(BITS).o head.o init_task.o vmlinu | |||
6 | 6 | ||
7 | CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) | 7 | CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) |
8 | 8 | ||
9 | ifdef CONFIG_FTRACE | 9 | ifdef CONFIG_FUNCTION_TRACER |
10 | # Do not profile debug and lowlevel utilities | 10 | # Do not profile debug and lowlevel utilities |
11 | CFLAGS_REMOVE_tsc.o = -pg | 11 | CFLAGS_REMOVE_tsc.o = -pg |
12 | CFLAGS_REMOVE_rtc.o = -pg | 12 | CFLAGS_REMOVE_rtc.o = -pg |
13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg | 13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg |
14 | CFLAGS_REMOVE_ftrace.o = -pg | ||
14 | endif | 15 | endif |
15 | 16 | ||
16 | # | 17 | # |
@@ -40,7 +41,7 @@ obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o | |||
40 | obj-y += process.o | 41 | obj-y += process.o |
41 | obj-y += i387.o xsave.o | 42 | obj-y += i387.o xsave.o |
42 | obj-y += ptrace.o | 43 | obj-y += ptrace.o |
43 | obj-y += ds.o | 44 | obj-$(CONFIG_X86_DS) += ds.o |
44 | obj-$(CONFIG_X86_32) += tls.o | 45 | obj-$(CONFIG_X86_32) += tls.o |
45 | obj-$(CONFIG_IA32_EMULATION) += tls.o | 46 | obj-$(CONFIG_IA32_EMULATION) += tls.o |
46 | obj-y += step.o | 47 | obj-y += step.o |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 8c1f76abae9e..4c51a2f8fd31 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -1343,7 +1343,6 @@ static void __init acpi_process_madt(void) | |||
1343 | error = acpi_parse_madt_ioapic_entries(); | 1343 | error = acpi_parse_madt_ioapic_entries(); |
1344 | if (!error) { | 1344 | if (!error) { |
1345 | acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; | 1345 | acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; |
1346 | acpi_irq_balance_set(NULL); | ||
1347 | acpi_ioapic = 1; | 1346 | acpi_ioapic = 1; |
1348 | 1347 | ||
1349 | smp_found_config = 1; | 1348 | smp_found_config = 1; |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index a8fd9ebdc8e2..a7b6dec6fc3f 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -50,7 +50,7 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom, | |||
50 | /* returns !0 if the IOMMU is caching non-present entries in its TLB */ | 50 | /* returns !0 if the IOMMU is caching non-present entries in its TLB */ |
51 | static int iommu_has_npcache(struct amd_iommu *iommu) | 51 | static int iommu_has_npcache(struct amd_iommu *iommu) |
52 | { | 52 | { |
53 | return iommu->cap & IOMMU_CAP_NPCACHE; | 53 | return iommu->cap & (1UL << IOMMU_CAP_NPCACHE); |
54 | } | 54 | } |
55 | 55 | ||
56 | /**************************************************************************** | 56 | /**************************************************************************** |
@@ -187,6 +187,8 @@ static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd) | |||
187 | 187 | ||
188 | spin_lock_irqsave(&iommu->lock, flags); | 188 | spin_lock_irqsave(&iommu->lock, flags); |
189 | ret = __iommu_queue_command(iommu, cmd); | 189 | ret = __iommu_queue_command(iommu, cmd); |
190 | if (!ret) | ||
191 | iommu->need_sync = 1; | ||
190 | spin_unlock_irqrestore(&iommu->lock, flags); | 192 | spin_unlock_irqrestore(&iommu->lock, flags); |
191 | 193 | ||
192 | return ret; | 194 | return ret; |
@@ -210,10 +212,13 @@ static int iommu_completion_wait(struct amd_iommu *iommu) | |||
210 | cmd.data[0] = CMD_COMPL_WAIT_INT_MASK; | 212 | cmd.data[0] = CMD_COMPL_WAIT_INT_MASK; |
211 | CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT); | 213 | CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT); |
212 | 214 | ||
213 | iommu->need_sync = 0; | ||
214 | |||
215 | spin_lock_irqsave(&iommu->lock, flags); | 215 | spin_lock_irqsave(&iommu->lock, flags); |
216 | 216 | ||
217 | if (!iommu->need_sync) | ||
218 | goto out; | ||
219 | |||
220 | iommu->need_sync = 0; | ||
221 | |||
217 | ret = __iommu_queue_command(iommu, &cmd); | 222 | ret = __iommu_queue_command(iommu, &cmd); |
218 | 223 | ||
219 | if (ret) | 224 | if (ret) |
@@ -254,8 +259,6 @@ static int iommu_queue_inv_dev_entry(struct amd_iommu *iommu, u16 devid) | |||
254 | 259 | ||
255 | ret = iommu_queue_command(iommu, &cmd); | 260 | ret = iommu_queue_command(iommu, &cmd); |
256 | 261 | ||
257 | iommu->need_sync = 1; | ||
258 | |||
259 | return ret; | 262 | return ret; |
260 | } | 263 | } |
261 | 264 | ||
@@ -281,8 +284,6 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu, | |||
281 | 284 | ||
282 | ret = iommu_queue_command(iommu, &cmd); | 285 | ret = iommu_queue_command(iommu, &cmd); |
283 | 286 | ||
284 | iommu->need_sync = 1; | ||
285 | |||
286 | return ret; | 287 | return ret; |
287 | } | 288 | } |
288 | 289 | ||
@@ -343,7 +344,7 @@ static int iommu_map(struct protection_domain *dom, | |||
343 | u64 __pte, *pte, *page; | 344 | u64 __pte, *pte, *page; |
344 | 345 | ||
345 | bus_addr = PAGE_ALIGN(bus_addr); | 346 | bus_addr = PAGE_ALIGN(bus_addr); |
346 | phys_addr = PAGE_ALIGN(bus_addr); | 347 | phys_addr = PAGE_ALIGN(phys_addr); |
347 | 348 | ||
348 | /* only support 512GB address spaces for now */ | 349 | /* only support 512GB address spaces for now */ |
349 | if (bus_addr > IOMMU_MAP_SIZE_L3 || !(prot & IOMMU_PROT_MASK)) | 350 | if (bus_addr > IOMMU_MAP_SIZE_L3 || !(prot & IOMMU_PROT_MASK)) |
@@ -536,6 +537,9 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom, | |||
536 | { | 537 | { |
537 | address >>= PAGE_SHIFT; | 538 | address >>= PAGE_SHIFT; |
538 | iommu_area_free(dom->bitmap, address, pages); | 539 | iommu_area_free(dom->bitmap, address, pages); |
540 | |||
541 | if (address >= dom->next_bit) | ||
542 | dom->need_flush = true; | ||
539 | } | 543 | } |
540 | 544 | ||
541 | /**************************************************************************** | 545 | /**************************************************************************** |
@@ -596,7 +600,7 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom) | |||
596 | continue; | 600 | continue; |
597 | 601 | ||
598 | p2 = IOMMU_PTE_PAGE(p1[i]); | 602 | p2 = IOMMU_PTE_PAGE(p1[i]); |
599 | for (j = 0; j < 512; ++i) { | 603 | for (j = 0; j < 512; ++j) { |
600 | if (!IOMMU_PTE_PRESENT(p2[j])) | 604 | if (!IOMMU_PTE_PRESENT(p2[j])) |
601 | continue; | 605 | continue; |
602 | p3 = IOMMU_PTE_PAGE(p2[j]); | 606 | p3 = IOMMU_PTE_PAGE(p2[j]); |
@@ -759,8 +763,6 @@ static void set_device_domain(struct amd_iommu *iommu, | |||
759 | write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); | 763 | write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); |
760 | 764 | ||
761 | iommu_queue_inv_dev_entry(iommu, devid); | 765 | iommu_queue_inv_dev_entry(iommu, devid); |
762 | |||
763 | iommu->need_sync = 1; | ||
764 | } | 766 | } |
765 | 767 | ||
766 | /***************************************************************************** | 768 | /***************************************************************************** |
@@ -855,6 +857,9 @@ static int get_device_resources(struct device *dev, | |||
855 | print_devid(_bdf, 1); | 857 | print_devid(_bdf, 1); |
856 | } | 858 | } |
857 | 859 | ||
860 | if (domain_for_device(_bdf) == NULL) | ||
861 | set_device_domain(*iommu, *domain, _bdf); | ||
862 | |||
858 | return 1; | 863 | return 1; |
859 | } | 864 | } |
860 | 865 | ||
@@ -905,7 +910,7 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu, | |||
905 | if (address >= dom->aperture_size) | 910 | if (address >= dom->aperture_size) |
906 | return; | 911 | return; |
907 | 912 | ||
908 | WARN_ON(address & 0xfffULL || address > dom->aperture_size); | 913 | WARN_ON(address & ~PAGE_MASK || address >= dom->aperture_size); |
909 | 914 | ||
910 | pte = dom->pte_pages[IOMMU_PTE_L1_INDEX(address)]; | 915 | pte = dom->pte_pages[IOMMU_PTE_L1_INDEX(address)]; |
911 | pte += IOMMU_PTE_L0_INDEX(address); | 916 | pte += IOMMU_PTE_L0_INDEX(address); |
@@ -917,8 +922,8 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu, | |||
917 | 922 | ||
918 | /* | 923 | /* |
919 | * This function contains common code for mapping of a physically | 924 | * This function contains common code for mapping of a physically |
920 | * contiguous memory region into DMA address space. It is uses by all | 925 | * contiguous memory region into DMA address space. It is used by all |
921 | * mapping functions provided by this IOMMU driver. | 926 | * mapping functions provided with this IOMMU driver. |
922 | * Must be called with the domain lock held. | 927 | * Must be called with the domain lock held. |
923 | */ | 928 | */ |
924 | static dma_addr_t __map_single(struct device *dev, | 929 | static dma_addr_t __map_single(struct device *dev, |
@@ -978,7 +983,8 @@ static void __unmap_single(struct amd_iommu *iommu, | |||
978 | dma_addr_t i, start; | 983 | dma_addr_t i, start; |
979 | unsigned int pages; | 984 | unsigned int pages; |
980 | 985 | ||
981 | if ((dma_addr == 0) || (dma_addr + size > dma_dom->aperture_size)) | 986 | if ((dma_addr == bad_dma_address) || |
987 | (dma_addr + size > dma_dom->aperture_size)) | ||
982 | return; | 988 | return; |
983 | 989 | ||
984 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); | 990 | pages = iommu_num_pages(dma_addr, size, PAGE_SIZE); |
@@ -992,8 +998,10 @@ static void __unmap_single(struct amd_iommu *iommu, | |||
992 | 998 | ||
993 | dma_ops_free_addresses(dma_dom, dma_addr, pages); | 999 | dma_ops_free_addresses(dma_dom, dma_addr, pages); |
994 | 1000 | ||
995 | if (amd_iommu_unmap_flush) | 1001 | if (amd_iommu_unmap_flush || dma_dom->need_flush) { |
996 | iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size); | 1002 | iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size); |
1003 | dma_dom->need_flush = false; | ||
1004 | } | ||
997 | } | 1005 | } |
998 | 1006 | ||
999 | /* | 1007 | /* |
@@ -1026,8 +1034,7 @@ static dma_addr_t map_single(struct device *dev, phys_addr_t paddr, | |||
1026 | if (addr == bad_dma_address) | 1034 | if (addr == bad_dma_address) |
1027 | goto out; | 1035 | goto out; |
1028 | 1036 | ||
1029 | if (unlikely(iommu->need_sync)) | 1037 | iommu_completion_wait(iommu); |
1030 | iommu_completion_wait(iommu); | ||
1031 | 1038 | ||
1032 | out: | 1039 | out: |
1033 | spin_unlock_irqrestore(&domain->lock, flags); | 1040 | spin_unlock_irqrestore(&domain->lock, flags); |
@@ -1055,8 +1062,7 @@ static void unmap_single(struct device *dev, dma_addr_t dma_addr, | |||
1055 | 1062 | ||
1056 | __unmap_single(iommu, domain->priv, dma_addr, size, dir); | 1063 | __unmap_single(iommu, domain->priv, dma_addr, size, dir); |
1057 | 1064 | ||
1058 | if (unlikely(iommu->need_sync)) | 1065 | iommu_completion_wait(iommu); |
1059 | iommu_completion_wait(iommu); | ||
1060 | 1066 | ||
1061 | spin_unlock_irqrestore(&domain->lock, flags); | 1067 | spin_unlock_irqrestore(&domain->lock, flags); |
1062 | } | 1068 | } |
@@ -1122,8 +1128,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist, | |||
1122 | goto unmap; | 1128 | goto unmap; |
1123 | } | 1129 | } |
1124 | 1130 | ||
1125 | if (unlikely(iommu->need_sync)) | 1131 | iommu_completion_wait(iommu); |
1126 | iommu_completion_wait(iommu); | ||
1127 | 1132 | ||
1128 | out: | 1133 | out: |
1129 | spin_unlock_irqrestore(&domain->lock, flags); | 1134 | spin_unlock_irqrestore(&domain->lock, flags); |
@@ -1168,8 +1173,7 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist, | |||
1168 | s->dma_address = s->dma_length = 0; | 1173 | s->dma_address = s->dma_length = 0; |
1169 | } | 1174 | } |
1170 | 1175 | ||
1171 | if (unlikely(iommu->need_sync)) | 1176 | iommu_completion_wait(iommu); |
1172 | iommu_completion_wait(iommu); | ||
1173 | 1177 | ||
1174 | spin_unlock_irqrestore(&domain->lock, flags); | 1178 | spin_unlock_irqrestore(&domain->lock, flags); |
1175 | } | 1179 | } |
@@ -1220,8 +1224,7 @@ static void *alloc_coherent(struct device *dev, size_t size, | |||
1220 | goto out; | 1224 | goto out; |
1221 | } | 1225 | } |
1222 | 1226 | ||
1223 | if (unlikely(iommu->need_sync)) | 1227 | iommu_completion_wait(iommu); |
1224 | iommu_completion_wait(iommu); | ||
1225 | 1228 | ||
1226 | out: | 1229 | out: |
1227 | spin_unlock_irqrestore(&domain->lock, flags); | 1230 | spin_unlock_irqrestore(&domain->lock, flags); |
@@ -1252,8 +1255,7 @@ static void free_coherent(struct device *dev, size_t size, | |||
1252 | 1255 | ||
1253 | __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL); | 1256 | __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL); |
1254 | 1257 | ||
1255 | if (unlikely(iommu->need_sync)) | 1258 | iommu_completion_wait(iommu); |
1256 | iommu_completion_wait(iommu); | ||
1257 | 1259 | ||
1258 | spin_unlock_irqrestore(&domain->lock, flags); | 1260 | spin_unlock_irqrestore(&domain->lock, flags); |
1259 | 1261 | ||
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 0cdcda35a05f..30ae2701b3df 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -121,7 +121,7 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have | |||
121 | LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings | 121 | LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings |
122 | we find in ACPI */ | 122 | we find in ACPI */ |
123 | unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */ | 123 | unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */ |
124 | int amd_iommu_isolate; /* if 1, device isolation is enabled */ | 124 | int amd_iommu_isolate = 1; /* if 1, device isolation is enabled */ |
125 | bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ | 125 | bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ |
126 | 126 | ||
127 | LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the | 127 | LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the |
@@ -1213,7 +1213,9 @@ static int __init parse_amd_iommu_options(char *str) | |||
1213 | for (; *str; ++str) { | 1213 | for (; *str; ++str) { |
1214 | if (strncmp(str, "isolate", 7) == 0) | 1214 | if (strncmp(str, "isolate", 7) == 0) |
1215 | amd_iommu_isolate = 1; | 1215 | amd_iommu_isolate = 1; |
1216 | if (strncmp(str, "fullflush", 11) == 0) | 1216 | if (strncmp(str, "share", 5) == 0) |
1217 | amd_iommu_isolate = 0; | ||
1218 | if (strncmp(str, "fullflush", 9) == 0) | ||
1217 | amd_iommu_unmap_flush = true; | 1219 | amd_iommu_unmap_flush = true; |
1218 | } | 1220 | } |
1219 | 1221 | ||
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index 04a7f960bbc0..16f94879b525 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c | |||
@@ -1315,7 +1315,7 @@ void enable_x2apic(void) | |||
1315 | } | 1315 | } |
1316 | } | 1316 | } |
1317 | 1317 | ||
1318 | void enable_IR_x2apic(void) | 1318 | void __init enable_IR_x2apic(void) |
1319 | { | 1319 | { |
1320 | #ifdef CONFIG_INTR_REMAP | 1320 | #ifdef CONFIG_INTR_REMAP |
1321 | int ret; | 1321 | int ret; |
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index 0d9c993aa93e..ef8f831af823 100644 --- a/arch/x86/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c | |||
@@ -69,7 +69,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
69 | */ | 69 | */ |
70 | void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) | 70 | void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) |
71 | { | 71 | { |
72 | #ifdef CONFIG_SMP | 72 | #ifdef CONFIG_X86_SMP |
73 | unsigned int eax, ebx, ecx, edx, sub_index; | 73 | unsigned int eax, ebx, ecx, edx, sub_index; |
74 | unsigned int ht_mask_width, core_plus_mask_width; | 74 | unsigned int ht_mask_width, core_plus_mask_width; |
75 | unsigned int core_select_mask, core_level_siblings; | 75 | unsigned int core_select_mask, core_level_siblings; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 25581dcb280e..b9c9ea0217a9 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/pat.h> | 20 | #include <asm/pat.h> |
21 | #include <asm/asm.h> | 21 | #include <asm/asm.h> |
22 | #include <asm/numa.h> | 22 | #include <asm/numa.h> |
23 | #include <asm/smp.h> | ||
23 | #ifdef CONFIG_X86_LOCAL_APIC | 24 | #ifdef CONFIG_X86_LOCAL_APIC |
24 | #include <asm/mpspec.h> | 25 | #include <asm/mpspec.h> |
25 | #include <asm/apic.h> | 26 | #include <asm/apic.h> |
@@ -549,6 +550,10 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) | |||
549 | this_cpu->c_early_init(c); | 550 | this_cpu->c_early_init(c); |
550 | 551 | ||
551 | validate_pat_support(c); | 552 | validate_pat_support(c); |
553 | |||
554 | #ifdef CONFIG_SMP | ||
555 | c->cpu_index = boot_cpu_id; | ||
556 | #endif | ||
552 | } | 557 | } |
553 | 558 | ||
554 | void __init early_cpu_init(void) | 559 | void __init early_cpu_init(void) |
@@ -1134,7 +1139,7 @@ void __cpuinit cpu_init(void) | |||
1134 | /* | 1139 | /* |
1135 | * Boot processor to setup the FP and extended state context info. | 1140 | * Boot processor to setup the FP and extended state context info. |
1136 | */ | 1141 | */ |
1137 | if (!smp_processor_id()) | 1142 | if (smp_processor_id() == boot_cpu_id) |
1138 | init_thread_xstate(); | 1143 | init_thread_xstate(); |
1139 | 1144 | ||
1140 | xsave_init(); | 1145 | xsave_init(); |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index d3dcd58b87cd..7f05f44b97e9 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -115,9 +115,20 @@ static int query_current_values_with_pending_wait(struct powernow_k8_data *data) | |||
115 | u32 i = 0; | 115 | u32 i = 0; |
116 | 116 | ||
117 | if (cpu_family == CPU_HW_PSTATE) { | 117 | if (cpu_family == CPU_HW_PSTATE) { |
118 | rdmsr(MSR_PSTATE_STATUS, lo, hi); | 118 | if (data->currpstate == HW_PSTATE_INVALID) { |
119 | i = lo & HW_PSTATE_MASK; | 119 | /* read (initial) hw pstate if not yet set */ |
120 | data->currpstate = i; | 120 | rdmsr(MSR_PSTATE_STATUS, lo, hi); |
121 | i = lo & HW_PSTATE_MASK; | ||
122 | |||
123 | /* | ||
124 | * a workaround for family 11h erratum 311 might cause | ||
125 | * an "out-of-range Pstate if the core is in Pstate-0 | ||
126 | */ | ||
127 | if (i >= data->numps) | ||
128 | data->currpstate = HW_PSTATE_0; | ||
129 | else | ||
130 | data->currpstate = i; | ||
131 | } | ||
121 | return 0; | 132 | return 0; |
122 | } | 133 | } |
123 | do { | 134 | do { |
@@ -1121,6 +1132,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1121 | } | 1132 | } |
1122 | 1133 | ||
1123 | data->cpu = pol->cpu; | 1134 | data->cpu = pol->cpu; |
1135 | data->currpstate = HW_PSTATE_INVALID; | ||
1124 | 1136 | ||
1125 | if (powernow_k8_cpu_init_acpi(data)) { | 1137 | if (powernow_k8_cpu_init_acpi(data)) { |
1126 | /* | 1138 | /* |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h index ab48cfed4d96..65cfb5d7f77f 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h | |||
@@ -5,6 +5,19 @@ | |||
5 | * http://www.gnu.org/licenses/gpl.html | 5 | * http://www.gnu.org/licenses/gpl.html |
6 | */ | 6 | */ |
7 | 7 | ||
8 | |||
9 | enum pstate { | ||
10 | HW_PSTATE_INVALID = 0xff, | ||
11 | HW_PSTATE_0 = 0, | ||
12 | HW_PSTATE_1 = 1, | ||
13 | HW_PSTATE_2 = 2, | ||
14 | HW_PSTATE_3 = 3, | ||
15 | HW_PSTATE_4 = 4, | ||
16 | HW_PSTATE_5 = 5, | ||
17 | HW_PSTATE_6 = 6, | ||
18 | HW_PSTATE_7 = 7, | ||
19 | }; | ||
20 | |||
8 | struct powernow_k8_data { | 21 | struct powernow_k8_data { |
9 | unsigned int cpu; | 22 | unsigned int cpu; |
10 | 23 | ||
@@ -23,7 +36,9 @@ struct powernow_k8_data { | |||
23 | u32 exttype; /* extended interface = 1 */ | 36 | u32 exttype; /* extended interface = 1 */ |
24 | 37 | ||
25 | /* keep track of the current fid / vid or pstate */ | 38 | /* keep track of the current fid / vid or pstate */ |
26 | u32 currvid, currfid, currpstate; | 39 | u32 currvid; |
40 | u32 currfid; | ||
41 | enum pstate currpstate; | ||
27 | 42 | ||
28 | /* the powernow_table includes all frequency and vid/fid pairings: | 43 | /* the powernow_table includes all frequency and vid/fid pairings: |
29 | * fid are the lower 8 bits of the index, vid are the upper 8 bits. | 44 | * fid are the lower 8 bits of the index, vid are the upper 8 bits. |
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index 2b69994fd3a8..a2d1176c38ee 100644 --- a/arch/x86/kernel/ds.c +++ b/arch/x86/kernel/ds.c | |||
@@ -21,8 +21,6 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | 23 | ||
24 | #ifdef CONFIG_X86_DS | ||
25 | |||
26 | #include <asm/ds.h> | 24 | #include <asm/ds.h> |
27 | 25 | ||
28 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
@@ -211,14 +209,15 @@ static DEFINE_PER_CPU(struct ds_context *, system_context); | |||
211 | static inline struct ds_context *ds_get_context(struct task_struct *task) | 209 | static inline struct ds_context *ds_get_context(struct task_struct *task) |
212 | { | 210 | { |
213 | struct ds_context *context; | 211 | struct ds_context *context; |
212 | unsigned long irq; | ||
214 | 213 | ||
215 | spin_lock(&ds_lock); | 214 | spin_lock_irqsave(&ds_lock, irq); |
216 | 215 | ||
217 | context = (task ? task->thread.ds_ctx : this_system_context); | 216 | context = (task ? task->thread.ds_ctx : this_system_context); |
218 | if (context) | 217 | if (context) |
219 | context->count++; | 218 | context->count++; |
220 | 219 | ||
221 | spin_unlock(&ds_lock); | 220 | spin_unlock_irqrestore(&ds_lock, irq); |
222 | 221 | ||
223 | return context; | 222 | return context; |
224 | } | 223 | } |
@@ -226,18 +225,16 @@ static inline struct ds_context *ds_get_context(struct task_struct *task) | |||
226 | /* | 225 | /* |
227 | * Same as ds_get_context, but allocates the context and it's DS | 226 | * Same as ds_get_context, but allocates the context and it's DS |
228 | * structure, if necessary; returns NULL; if out of memory. | 227 | * structure, if necessary; returns NULL; if out of memory. |
229 | * | ||
230 | * pre: requires ds_lock to be held | ||
231 | */ | 228 | */ |
232 | static inline struct ds_context *ds_alloc_context(struct task_struct *task) | 229 | static inline struct ds_context *ds_alloc_context(struct task_struct *task) |
233 | { | 230 | { |
234 | struct ds_context **p_context = | 231 | struct ds_context **p_context = |
235 | (task ? &task->thread.ds_ctx : &this_system_context); | 232 | (task ? &task->thread.ds_ctx : &this_system_context); |
236 | struct ds_context *context = *p_context; | 233 | struct ds_context *context = *p_context; |
234 | unsigned long irq; | ||
237 | 235 | ||
238 | if (!context) { | 236 | if (!context) { |
239 | context = kzalloc(sizeof(*context), GFP_KERNEL); | 237 | context = kzalloc(sizeof(*context), GFP_KERNEL); |
240 | |||
241 | if (!context) | 238 | if (!context) |
242 | return NULL; | 239 | return NULL; |
243 | 240 | ||
@@ -247,18 +244,27 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task) | |||
247 | return NULL; | 244 | return NULL; |
248 | } | 245 | } |
249 | 246 | ||
250 | *p_context = context; | 247 | spin_lock_irqsave(&ds_lock, irq); |
251 | 248 | ||
252 | context->this = p_context; | 249 | if (*p_context) { |
253 | context->task = task; | 250 | kfree(context->ds); |
251 | kfree(context); | ||
252 | |||
253 | context = *p_context; | ||
254 | } else { | ||
255 | *p_context = context; | ||
254 | 256 | ||
255 | if (task) | 257 | context->this = p_context; |
256 | set_tsk_thread_flag(task, TIF_DS_AREA_MSR); | 258 | context->task = task; |
257 | 259 | ||
258 | if (!task || (task == current)) | 260 | if (task) |
259 | wrmsr(MSR_IA32_DS_AREA, (unsigned long)context->ds, 0); | 261 | set_tsk_thread_flag(task, TIF_DS_AREA_MSR); |
260 | 262 | ||
261 | get_tracer(task); | 263 | if (!task || (task == current)) |
264 | wrmsrl(MSR_IA32_DS_AREA, | ||
265 | (unsigned long)context->ds); | ||
266 | } | ||
267 | spin_unlock_irqrestore(&ds_lock, irq); | ||
262 | } | 268 | } |
263 | 269 | ||
264 | context->count++; | 270 | context->count++; |
@@ -272,10 +278,12 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task) | |||
272 | */ | 278 | */ |
273 | static inline void ds_put_context(struct ds_context *context) | 279 | static inline void ds_put_context(struct ds_context *context) |
274 | { | 280 | { |
281 | unsigned long irq; | ||
282 | |||
275 | if (!context) | 283 | if (!context) |
276 | return; | 284 | return; |
277 | 285 | ||
278 | spin_lock(&ds_lock); | 286 | spin_lock_irqsave(&ds_lock, irq); |
279 | 287 | ||
280 | if (--context->count) | 288 | if (--context->count) |
281 | goto out; | 289 | goto out; |
@@ -297,7 +305,7 @@ static inline void ds_put_context(struct ds_context *context) | |||
297 | kfree(context->ds); | 305 | kfree(context->ds); |
298 | kfree(context); | 306 | kfree(context); |
299 | out: | 307 | out: |
300 | spin_unlock(&ds_lock); | 308 | spin_unlock_irqrestore(&ds_lock, irq); |
301 | } | 309 | } |
302 | 310 | ||
303 | 311 | ||
@@ -368,6 +376,7 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
368 | struct ds_context *context; | 376 | struct ds_context *context; |
369 | unsigned long buffer, adj; | 377 | unsigned long buffer, adj; |
370 | const unsigned long alignment = (1 << 3); | 378 | const unsigned long alignment = (1 << 3); |
379 | unsigned long irq; | ||
371 | int error = 0; | 380 | int error = 0; |
372 | 381 | ||
373 | if (!ds_cfg.sizeof_ds) | 382 | if (!ds_cfg.sizeof_ds) |
@@ -382,25 +391,27 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
382 | return -EOPNOTSUPP; | 391 | return -EOPNOTSUPP; |
383 | 392 | ||
384 | 393 | ||
385 | spin_lock(&ds_lock); | ||
386 | |||
387 | if (!check_tracer(task)) | ||
388 | return -EPERM; | ||
389 | |||
390 | error = -ENOMEM; | ||
391 | context = ds_alloc_context(task); | 394 | context = ds_alloc_context(task); |
392 | if (!context) | 395 | if (!context) |
396 | return -ENOMEM; | ||
397 | |||
398 | spin_lock_irqsave(&ds_lock, irq); | ||
399 | |||
400 | error = -EPERM; | ||
401 | if (!check_tracer(task)) | ||
393 | goto out_unlock; | 402 | goto out_unlock; |
394 | 403 | ||
404 | get_tracer(task); | ||
405 | |||
395 | error = -EALREADY; | 406 | error = -EALREADY; |
396 | if (context->owner[qual] == current) | 407 | if (context->owner[qual] == current) |
397 | goto out_unlock; | 408 | goto out_put_tracer; |
398 | error = -EPERM; | 409 | error = -EPERM; |
399 | if (context->owner[qual] != NULL) | 410 | if (context->owner[qual] != NULL) |
400 | goto out_unlock; | 411 | goto out_put_tracer; |
401 | context->owner[qual] = current; | 412 | context->owner[qual] = current; |
402 | 413 | ||
403 | spin_unlock(&ds_lock); | 414 | spin_unlock_irqrestore(&ds_lock, irq); |
404 | 415 | ||
405 | 416 | ||
406 | error = -ENOMEM; | 417 | error = -ENOMEM; |
@@ -448,10 +459,17 @@ static int ds_request(struct task_struct *task, void *base, size_t size, | |||
448 | out_release: | 459 | out_release: |
449 | context->owner[qual] = NULL; | 460 | context->owner[qual] = NULL; |
450 | ds_put_context(context); | 461 | ds_put_context(context); |
462 | put_tracer(task); | ||
463 | return error; | ||
464 | |||
465 | out_put_tracer: | ||
466 | spin_unlock_irqrestore(&ds_lock, irq); | ||
467 | ds_put_context(context); | ||
468 | put_tracer(task); | ||
451 | return error; | 469 | return error; |
452 | 470 | ||
453 | out_unlock: | 471 | out_unlock: |
454 | spin_unlock(&ds_lock); | 472 | spin_unlock_irqrestore(&ds_lock, irq); |
455 | ds_put_context(context); | 473 | ds_put_context(context); |
456 | return error; | 474 | return error; |
457 | } | 475 | } |
@@ -801,13 +819,21 @@ static const struct ds_configuration ds_cfg_var = { | |||
801 | .sizeof_ds = sizeof(long) * 12, | 819 | .sizeof_ds = sizeof(long) * 12, |
802 | .sizeof_field = sizeof(long), | 820 | .sizeof_field = sizeof(long), |
803 | .sizeof_rec[ds_bts] = sizeof(long) * 3, | 821 | .sizeof_rec[ds_bts] = sizeof(long) * 3, |
822 | #ifdef __i386__ | ||
804 | .sizeof_rec[ds_pebs] = sizeof(long) * 10 | 823 | .sizeof_rec[ds_pebs] = sizeof(long) * 10 |
824 | #else | ||
825 | .sizeof_rec[ds_pebs] = sizeof(long) * 18 | ||
826 | #endif | ||
805 | }; | 827 | }; |
806 | static const struct ds_configuration ds_cfg_64 = { | 828 | static const struct ds_configuration ds_cfg_64 = { |
807 | .sizeof_ds = 8 * 12, | 829 | .sizeof_ds = 8 * 12, |
808 | .sizeof_field = 8, | 830 | .sizeof_field = 8, |
809 | .sizeof_rec[ds_bts] = 8 * 3, | 831 | .sizeof_rec[ds_bts] = 8 * 3, |
832 | #ifdef __i386__ | ||
810 | .sizeof_rec[ds_pebs] = 8 * 10 | 833 | .sizeof_rec[ds_pebs] = 8 * 10 |
834 | #else | ||
835 | .sizeof_rec[ds_pebs] = 8 * 18 | ||
836 | #endif | ||
811 | }; | 837 | }; |
812 | 838 | ||
813 | static inline void | 839 | static inline void |
@@ -861,4 +887,3 @@ void ds_free(struct ds_context *context) | |||
861 | while (leftovers--) | 887 | while (leftovers--) |
862 | ds_put_context(context); | 888 | ds_put_context(context); |
863 | } | 889 | } |
864 | #endif /* CONFIG_X86_DS */ | ||
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index ce97bf3bed12..7aafeb5263ef 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1290,15 +1290,17 @@ void __init e820_reserve_resources(void) | |||
1290 | res->start = e820.map[i].addr; | 1290 | res->start = e820.map[i].addr; |
1291 | res->end = end; | 1291 | res->end = end; |
1292 | 1292 | ||
1293 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 1293 | res->flags = IORESOURCE_MEM; |
1294 | 1294 | ||
1295 | /* | 1295 | /* |
1296 | * don't register the region that could be conflicted with | 1296 | * don't register the region that could be conflicted with |
1297 | * pci device BAR resource and insert them later in | 1297 | * pci device BAR resource and insert them later in |
1298 | * pcibios_resource_survey() | 1298 | * pcibios_resource_survey() |
1299 | */ | 1299 | */ |
1300 | if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) | 1300 | if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) { |
1301 | res->flags |= IORESOURCE_BUSY; | ||
1301 | insert_resource(&iomem_resource, res); | 1302 | insert_resource(&iomem_resource, res); |
1303 | } | ||
1302 | res++; | 1304 | res++; |
1303 | } | 1305 | } |
1304 | 1306 | ||
@@ -1318,7 +1320,7 @@ void __init e820_reserve_resources_late(void) | |||
1318 | res = e820_res; | 1320 | res = e820_res; |
1319 | for (i = 0; i < e820.nr_map; i++) { | 1321 | for (i = 0; i < e820.nr_map; i++) { |
1320 | if (!res->parent && res->end) | 1322 | if (!res->parent && res->end) |
1321 | reserve_region_with_split(&iomem_resource, res->start, res->end, res->name); | 1323 | insert_resource_expand_to_fit(&iomem_resource, res); |
1322 | res++; | 1324 | res++; |
1323 | } | 1325 | } |
1324 | } | 1326 | } |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 3ce029ffaa55..1b894b72c0f5 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
@@ -188,20 +188,6 @@ static void __init ati_bugs_contd(int num, int slot, int func) | |||
188 | } | 188 | } |
189 | #endif | 189 | #endif |
190 | 190 | ||
191 | #ifdef CONFIG_DMAR | ||
192 | static void __init intel_g33_dmar(int num, int slot, int func) | ||
193 | { | ||
194 | struct acpi_table_header *dmar_tbl; | ||
195 | acpi_status status; | ||
196 | |||
197 | status = acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_tbl); | ||
198 | if (ACPI_SUCCESS(status)) { | ||
199 | printk(KERN_INFO "BIOS BUG: DMAR advertised on Intel G31/G33 chipset -- ignoring\n"); | ||
200 | dmar_disabled = 1; | ||
201 | } | ||
202 | } | ||
203 | #endif | ||
204 | |||
205 | #define QFLAG_APPLY_ONCE 0x1 | 191 | #define QFLAG_APPLY_ONCE 0x1 |
206 | #define QFLAG_APPLIED 0x2 | 192 | #define QFLAG_APPLIED 0x2 |
207 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) | 193 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) |
@@ -225,10 +211,6 @@ static struct chipset early_qrk[] __initdata = { | |||
225 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, | 211 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, |
226 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, | 212 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, |
227 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, | 213 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, |
228 | #ifdef CONFIG_DMAR | ||
229 | { PCI_VENDOR_ID_INTEL, 0x29c0, | ||
230 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, intel_g33_dmar }, | ||
231 | #endif | ||
232 | {} | 214 | {} |
233 | }; | 215 | }; |
234 | 216 | ||
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index dd65143941a8..28b597ef9ca1 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1149,7 +1149,7 @@ ENDPROC(xen_failsafe_callback) | |||
1149 | 1149 | ||
1150 | #endif /* CONFIG_XEN */ | 1150 | #endif /* CONFIG_XEN */ |
1151 | 1151 | ||
1152 | #ifdef CONFIG_FTRACE | 1152 | #ifdef CONFIG_FUNCTION_TRACER |
1153 | #ifdef CONFIG_DYNAMIC_FTRACE | 1153 | #ifdef CONFIG_DYNAMIC_FTRACE |
1154 | 1154 | ||
1155 | ENTRY(mcount) | 1155 | ENTRY(mcount) |
@@ -1204,7 +1204,7 @@ trace: | |||
1204 | jmp ftrace_stub | 1204 | jmp ftrace_stub |
1205 | END(mcount) | 1205 | END(mcount) |
1206 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 1206 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
1207 | #endif /* CONFIG_FTRACE */ | 1207 | #endif /* CONFIG_FUNCTION_TRACER */ |
1208 | 1208 | ||
1209 | .section .rodata,"a" | 1209 | .section .rodata,"a" |
1210 | #include "syscall_table_32.S" | 1210 | #include "syscall_table_32.S" |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 09e7145484c5..b86f332c96a6 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -61,7 +61,7 @@ | |||
61 | 61 | ||
62 | .code64 | 62 | .code64 |
63 | 63 | ||
64 | #ifdef CONFIG_FTRACE | 64 | #ifdef CONFIG_FUNCTION_TRACER |
65 | #ifdef CONFIG_DYNAMIC_FTRACE | 65 | #ifdef CONFIG_DYNAMIC_FTRACE |
66 | ENTRY(mcount) | 66 | ENTRY(mcount) |
67 | retq | 67 | retq |
@@ -138,7 +138,7 @@ trace: | |||
138 | jmp ftrace_stub | 138 | jmp ftrace_stub |
139 | END(mcount) | 139 | END(mcount) |
140 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 140 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
141 | #endif /* CONFIG_FTRACE */ | 141 | #endif /* CONFIG_FUNCTION_TRACER */ |
142 | 142 | ||
143 | #ifndef CONFIG_PREEMPT | 143 | #ifndef CONFIG_PREEMPT |
144 | #define retint_kernel retint_restore_args | 144 | #define retint_kernel retint_restore_args |
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c index f454c78fcef6..0aa2c443d600 100644 --- a/arch/x86/kernel/es7000_32.c +++ b/arch/x86/kernel/es7000_32.c | |||
@@ -250,31 +250,24 @@ int __init find_unisys_acpi_oem_table(unsigned long *oem_addr) | |||
250 | { | 250 | { |
251 | struct acpi_table_header *header = NULL; | 251 | struct acpi_table_header *header = NULL; |
252 | int i = 0; | 252 | int i = 0; |
253 | acpi_size tbl_size; | ||
254 | 253 | ||
255 | while (ACPI_SUCCESS(acpi_get_table_with_size("OEM1", i++, &header, &tbl_size))) { | 254 | while (ACPI_SUCCESS(acpi_get_table("OEM1", i++, &header))) { |
256 | if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) { | 255 | if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) { |
257 | struct oem_table *t = (struct oem_table *)header; | 256 | struct oem_table *t = (struct oem_table *)header; |
258 | 257 | ||
259 | oem_addrX = t->OEMTableAddr; | 258 | oem_addrX = t->OEMTableAddr; |
260 | oem_size = t->OEMTableSize; | 259 | oem_size = t->OEMTableSize; |
261 | early_acpi_os_unmap_memory(header, tbl_size); | ||
262 | 260 | ||
263 | *oem_addr = (unsigned long)__acpi_map_table(oem_addrX, | 261 | *oem_addr = (unsigned long)__acpi_map_table(oem_addrX, |
264 | oem_size); | 262 | oem_size); |
265 | return 0; | 263 | return 0; |
266 | } | 264 | } |
267 | early_acpi_os_unmap_memory(header, tbl_size); | ||
268 | } | 265 | } |
269 | return -1; | 266 | return -1; |
270 | } | 267 | } |
271 | 268 | ||
272 | void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr) | 269 | void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr) |
273 | { | 270 | { |
274 | if (!oem_addr) | ||
275 | return; | ||
276 | |||
277 | __acpi_unmap_table((char *)oem_addr, oem_size); | ||
278 | } | 271 | } |
279 | #endif | 272 | #endif |
280 | 273 | ||
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index d073d981a730..50ea0ac8c9bf 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -21,8 +21,7 @@ | |||
21 | #include <asm/nops.h> | 21 | #include <asm/nops.h> |
22 | 22 | ||
23 | 23 | ||
24 | /* Long is fine, even if it is only 4 bytes ;-) */ | 24 | static unsigned char ftrace_nop[MCOUNT_INSN_SIZE]; |
25 | static unsigned long *ftrace_nop; | ||
26 | 25 | ||
27 | union ftrace_code_union { | 26 | union ftrace_code_union { |
28 | char code[MCOUNT_INSN_SIZE]; | 27 | char code[MCOUNT_INSN_SIZE]; |
@@ -33,17 +32,17 @@ union ftrace_code_union { | |||
33 | }; | 32 | }; |
34 | 33 | ||
35 | 34 | ||
36 | static int notrace ftrace_calc_offset(long ip, long addr) | 35 | static int ftrace_calc_offset(long ip, long addr) |
37 | { | 36 | { |
38 | return (int)(addr - ip); | 37 | return (int)(addr - ip); |
39 | } | 38 | } |
40 | 39 | ||
41 | notrace unsigned char *ftrace_nop_replace(void) | 40 | unsigned char *ftrace_nop_replace(void) |
42 | { | 41 | { |
43 | return (char *)ftrace_nop; | 42 | return ftrace_nop; |
44 | } | 43 | } |
45 | 44 | ||
46 | notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | 45 | unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) |
47 | { | 46 | { |
48 | static union ftrace_code_union calc; | 47 | static union ftrace_code_union calc; |
49 | 48 | ||
@@ -57,7 +56,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |||
57 | return calc.code; | 56 | return calc.code; |
58 | } | 57 | } |
59 | 58 | ||
60 | notrace int | 59 | int |
61 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, | 60 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, |
62 | unsigned char *new_code) | 61 | unsigned char *new_code) |
63 | { | 62 | { |
@@ -66,26 +65,31 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, | |||
66 | /* | 65 | /* |
67 | * Note: Due to modules and __init, code can | 66 | * Note: Due to modules and __init, code can |
68 | * disappear and change, we need to protect against faulting | 67 | * disappear and change, we need to protect against faulting |
69 | * as well as code changing. | 68 | * as well as code changing. We do this by using the |
69 | * probe_kernel_* functions. | ||
70 | * | 70 | * |
71 | * No real locking needed, this code is run through | 71 | * No real locking needed, this code is run through |
72 | * kstop_machine, or before SMP starts. | 72 | * kstop_machine, or before SMP starts. |
73 | */ | 73 | */ |
74 | if (__copy_from_user_inatomic(replaced, (char __user *)ip, MCOUNT_INSN_SIZE)) | ||
75 | return 1; | ||
76 | 74 | ||
75 | /* read the text we want to modify */ | ||
76 | if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) | ||
77 | return -EFAULT; | ||
78 | |||
79 | /* Make sure it is what we expect it to be */ | ||
77 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) | 80 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) |
78 | return 2; | 81 | return -EINVAL; |
79 | 82 | ||
80 | WARN_ON_ONCE(__copy_to_user_inatomic((char __user *)ip, new_code, | 83 | /* replace the text with the new text */ |
81 | MCOUNT_INSN_SIZE)); | 84 | if (probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE)) |
85 | return -EPERM; | ||
82 | 86 | ||
83 | sync_core(); | 87 | sync_core(); |
84 | 88 | ||
85 | return 0; | 89 | return 0; |
86 | } | 90 | } |
87 | 91 | ||
88 | notrace int ftrace_update_ftrace_func(ftrace_func_t func) | 92 | int ftrace_update_ftrace_func(ftrace_func_t func) |
89 | { | 93 | { |
90 | unsigned long ip = (unsigned long)(&ftrace_call); | 94 | unsigned long ip = (unsigned long)(&ftrace_call); |
91 | unsigned char old[MCOUNT_INSN_SIZE], *new; | 95 | unsigned char old[MCOUNT_INSN_SIZE], *new; |
@@ -98,13 +102,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |||
98 | return ret; | 102 | return ret; |
99 | } | 103 | } |
100 | 104 | ||
101 | notrace int ftrace_mcount_set(unsigned long *data) | ||
102 | { | ||
103 | /* mcount is initialized as a nop */ | ||
104 | *data = 0; | ||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | int __init ftrace_dyn_arch_init(void *data) | 105 | int __init ftrace_dyn_arch_init(void *data) |
109 | { | 106 | { |
110 | extern const unsigned char ftrace_test_p6nop[]; | 107 | extern const unsigned char ftrace_test_p6nop[]; |
@@ -127,9 +124,6 @@ int __init ftrace_dyn_arch_init(void *data) | |||
127 | * TODO: check the cpuid to determine the best nop. | 124 | * TODO: check the cpuid to determine the best nop. |
128 | */ | 125 | */ |
129 | asm volatile ( | 126 | asm volatile ( |
130 | "jmp ftrace_test_jmp\n" | ||
131 | /* This code needs to stay around */ | ||
132 | ".section .text, \"ax\"\n" | ||
133 | "ftrace_test_jmp:" | 127 | "ftrace_test_jmp:" |
134 | "jmp ftrace_test_p6nop\n" | 128 | "jmp ftrace_test_p6nop\n" |
135 | "nop\n" | 129 | "nop\n" |
@@ -140,8 +134,6 @@ int __init ftrace_dyn_arch_init(void *data) | |||
140 | "jmp 1f\n" | 134 | "jmp 1f\n" |
141 | "ftrace_test_nop5:" | 135 | "ftrace_test_nop5:" |
142 | ".byte 0x66,0x66,0x66,0x66,0x90\n" | 136 | ".byte 0x66,0x66,0x66,0x66,0x90\n" |
143 | "jmp 1f\n" | ||
144 | ".previous\n" | ||
145 | "1:" | 137 | "1:" |
146 | ".section .fixup, \"ax\"\n" | 138 | ".section .fixup, \"ax\"\n" |
147 | "2: movl $1, %0\n" | 139 | "2: movl $1, %0\n" |
@@ -156,15 +148,15 @@ int __init ftrace_dyn_arch_init(void *data) | |||
156 | switch (faulted) { | 148 | switch (faulted) { |
157 | case 0: | 149 | case 0: |
158 | pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n"); | 150 | pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n"); |
159 | ftrace_nop = (unsigned long *)ftrace_test_p6nop; | 151 | memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE); |
160 | break; | 152 | break; |
161 | case 1: | 153 | case 1: |
162 | pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n"); | 154 | pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n"); |
163 | ftrace_nop = (unsigned long *)ftrace_test_nop5; | 155 | memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE); |
164 | break; | 156 | break; |
165 | case 2: | 157 | case 2: |
166 | pr_info("ftrace: converting mcount calls to jmp . + 5\n"); | 158 | pr_info("ftrace: converting mcount calls to jmp . + 5\n"); |
167 | ftrace_nop = (unsigned long *)ftrace_test_jmp; | 159 | memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE); |
168 | break; | 160 | break; |
169 | } | 161 | } |
170 | 162 | ||
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c index 680a06557c5e..2c7dbdb98278 100644 --- a/arch/x86/kernel/genx2apic_uv_x.c +++ b/arch/x86/kernel/genx2apic_uv_x.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/ctype.h> | 15 | #include <linux/ctype.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
18 | #include <linux/bootmem.h> | ||
19 | #include <linux/module.h> | 18 | #include <linux/module.h> |
20 | #include <linux/hardirq.h> | 19 | #include <linux/hardirq.h> |
21 | #include <asm/smp.h> | 20 | #include <asm/smp.h> |
@@ -398,16 +397,16 @@ void __init uv_system_init(void) | |||
398 | printk(KERN_DEBUG "UV: Found %d blades\n", uv_num_possible_blades()); | 397 | printk(KERN_DEBUG "UV: Found %d blades\n", uv_num_possible_blades()); |
399 | 398 | ||
400 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); | 399 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); |
401 | uv_blade_info = alloc_bootmem_pages(bytes); | 400 | uv_blade_info = kmalloc(bytes, GFP_KERNEL); |
402 | 401 | ||
403 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); | 402 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); |
404 | 403 | ||
405 | bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes(); | 404 | bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes(); |
406 | uv_node_to_blade = alloc_bootmem_pages(bytes); | 405 | uv_node_to_blade = kmalloc(bytes, GFP_KERNEL); |
407 | memset(uv_node_to_blade, 255, bytes); | 406 | memset(uv_node_to_blade, 255, bytes); |
408 | 407 | ||
409 | bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus(); | 408 | bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus(); |
410 | uv_cpu_to_blade = alloc_bootmem_pages(bytes); | 409 | uv_cpu_to_blade = kmalloc(bytes, GFP_KERNEL); |
411 | memset(uv_cpu_to_blade, 255, bytes); | 410 | memset(uv_cpu_to_blade, 255, bytes); |
412 | 411 | ||
413 | blade = 0; | 412 | blade = 0; |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 77017e834cf7..067d8de913f6 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -322,7 +322,7 @@ static int hpet_next_event(unsigned long delta, | |||
322 | * what we wrote hit the chip before we compare it to the | 322 | * what we wrote hit the chip before we compare it to the |
323 | * counter. | 323 | * counter. |
324 | */ | 324 | */ |
325 | WARN_ON((u32)hpet_readl(HPET_T0_CMP) != cnt); | 325 | WARN_ON_ONCE((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt); |
326 | 326 | ||
327 | return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; | 327 | return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; |
328 | } | 328 | } |
@@ -445,7 +445,7 @@ static int hpet_setup_irq(struct hpet_dev *dev) | |||
445 | { | 445 | { |
446 | 446 | ||
447 | if (request_irq(dev->irq, hpet_interrupt_handler, | 447 | if (request_irq(dev->irq, hpet_interrupt_handler, |
448 | IRQF_SHARED|IRQF_NOBALANCING, dev->name, dev)) | 448 | IRQF_DISABLED|IRQF_NOBALANCING, dev->name, dev)) |
449 | return -1; | 449 | return -1; |
450 | 450 | ||
451 | disable_irq(dev->irq); | 451 | disable_irq(dev->irq); |
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c index dd7ebee446af..43cec6bdda63 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <asm/desc.h> | 5 | #include <asm/desc.h> |
6 | #include <asm/ftrace.h> | 6 | #include <asm/ftrace.h> |
7 | 7 | ||
8 | #ifdef CONFIG_FTRACE | 8 | #ifdef CONFIG_FUNCTION_TRACER |
9 | /* mcount is defined in assembly */ | 9 | /* mcount is defined in assembly */ |
10 | EXPORT_SYMBOL(mcount); | 10 | EXPORT_SYMBOL(mcount); |
11 | #endif | 11 | #endif |
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 1f20608d4ca8..b0f61f0dcd0a 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
@@ -58,7 +58,7 @@ void __cpuinit mxcsr_feature_mask_init(void) | |||
58 | stts(); | 58 | stts(); |
59 | } | 59 | } |
60 | 60 | ||
61 | void __init init_thread_xstate(void) | 61 | void __cpuinit init_thread_xstate(void) |
62 | { | 62 | { |
63 | if (!HAVE_HWFP) { | 63 | if (!HAVE_HWFP) { |
64 | xstate_size = sizeof(struct i387_soft_struct); | 64 | xstate_size = sizeof(struct i387_soft_struct); |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index b764d7429c61..9043251210fb 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -1140,6 +1140,20 @@ static void __clear_irq_vector(int irq) | |||
1140 | 1140 | ||
1141 | cfg->vector = 0; | 1141 | cfg->vector = 0; |
1142 | cpus_clear(cfg->domain); | 1142 | cpus_clear(cfg->domain); |
1143 | |||
1144 | if (likely(!cfg->move_in_progress)) | ||
1145 | return; | ||
1146 | cpus_and(mask, cfg->old_domain, cpu_online_map); | ||
1147 | for_each_cpu_mask_nr(cpu, mask) { | ||
1148 | for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; | ||
1149 | vector++) { | ||
1150 | if (per_cpu(vector_irq, cpu)[vector] != irq) | ||
1151 | continue; | ||
1152 | per_cpu(vector_irq, cpu)[vector] = -1; | ||
1153 | break; | ||
1154 | } | ||
1155 | } | ||
1156 | cfg->move_in_progress = 0; | ||
1143 | } | 1157 | } |
1144 | 1158 | ||
1145 | void __setup_vector_irq(int cpu) | 1159 | void __setup_vector_irq(int cpu) |
@@ -3594,25 +3608,7 @@ int __init io_apic_get_redir_entries (int ioapic) | |||
3594 | 3608 | ||
3595 | int __init probe_nr_irqs(void) | 3609 | int __init probe_nr_irqs(void) |
3596 | { | 3610 | { |
3597 | int idx; | 3611 | return NR_IRQS; |
3598 | int nr = 0; | ||
3599 | #ifndef CONFIG_XEN | ||
3600 | int nr_min = 32; | ||
3601 | #else | ||
3602 | int nr_min = NR_IRQS; | ||
3603 | #endif | ||
3604 | |||
3605 | for (idx = 0; idx < nr_ioapics; idx++) | ||
3606 | nr += io_apic_get_redir_entries(idx) + 1; | ||
3607 | |||
3608 | /* double it for hotplug and msi and nmi */ | ||
3609 | nr <<= 1; | ||
3610 | |||
3611 | /* something wrong ? */ | ||
3612 | if (nr < nr_min) | ||
3613 | nr = nr_min; | ||
3614 | |||
3615 | return nr; | ||
3616 | } | 3612 | } |
3617 | 3613 | ||
3618 | /* -------------------------------------------------------------------------- | 3614 | /* -------------------------------------------------------------------------- |
@@ -3759,7 +3755,9 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) | |||
3759 | void __init setup_ioapic_dest(void) | 3755 | void __init setup_ioapic_dest(void) |
3760 | { | 3756 | { |
3761 | int pin, ioapic, irq, irq_entry; | 3757 | int pin, ioapic, irq, irq_entry; |
3758 | struct irq_desc *desc; | ||
3762 | struct irq_cfg *cfg; | 3759 | struct irq_cfg *cfg; |
3760 | cpumask_t mask; | ||
3763 | 3761 | ||
3764 | if (skip_ioapic_setup == 1) | 3762 | if (skip_ioapic_setup == 1) |
3765 | return; | 3763 | return; |
@@ -3776,16 +3774,30 @@ void __init setup_ioapic_dest(void) | |||
3776 | * cpu is online. | 3774 | * cpu is online. |
3777 | */ | 3775 | */ |
3778 | cfg = irq_cfg(irq); | 3776 | cfg = irq_cfg(irq); |
3779 | if (!cfg->vector) | 3777 | if (!cfg->vector) { |
3780 | setup_IO_APIC_irq(ioapic, pin, irq, | 3778 | setup_IO_APIC_irq(ioapic, pin, irq, |
3781 | irq_trigger(irq_entry), | 3779 | irq_trigger(irq_entry), |
3782 | irq_polarity(irq_entry)); | 3780 | irq_polarity(irq_entry)); |
3781 | continue; | ||
3782 | |||
3783 | } | ||
3784 | |||
3785 | /* | ||
3786 | * Honour affinities which have been set in early boot | ||
3787 | */ | ||
3788 | desc = irq_to_desc(irq); | ||
3789 | if (desc->status & | ||
3790 | (IRQ_NO_BALANCING | IRQ_AFFINITY_SET)) | ||
3791 | mask = desc->affinity; | ||
3792 | else | ||
3793 | mask = TARGET_CPUS; | ||
3794 | |||
3783 | #ifdef CONFIG_INTR_REMAP | 3795 | #ifdef CONFIG_INTR_REMAP |
3784 | else if (intr_remapping_enabled) | 3796 | if (intr_remapping_enabled) |
3785 | set_ir_ioapic_affinity_irq(irq, TARGET_CPUS); | 3797 | set_ir_ioapic_affinity_irq(irq, mask); |
3786 | #endif | ||
3787 | else | 3798 | else |
3788 | set_ioapic_affinity_irq(irq, TARGET_CPUS); | 3799 | #endif |
3800 | set_ioapic_affinity_irq(irq, mask); | ||
3789 | } | 3801 | } |
3790 | 3802 | ||
3791 | } | 3803 | } |
diff --git a/arch/x86/kernel/k8.c b/arch/x86/kernel/k8.c index 304d8bad6559..cbc4332a77b2 100644 --- a/arch/x86/kernel/k8.c +++ b/arch/x86/kernel/k8.c | |||
@@ -18,7 +18,6 @@ static u32 *flush_words; | |||
18 | struct pci_device_id k8_nb_ids[] = { | 18 | struct pci_device_id k8_nb_ids[] = { |
19 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) }, | 19 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) }, |
20 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, | 20 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, |
21 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, | ||
22 | {} | 21 | {} |
23 | }; | 22 | }; |
24 | EXPORT_SYMBOL(k8_nb_ids); | 23 | EXPORT_SYMBOL(k8_nb_ids); |
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 774ac4991568..e169ae9b6a62 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c | |||
@@ -128,7 +128,7 @@ static int kvm_register_clock(char *txt) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | #ifdef CONFIG_X86_LOCAL_APIC | 130 | #ifdef CONFIG_X86_LOCAL_APIC |
131 | static void kvm_setup_secondary_clock(void) | 131 | static void __cpuinit kvm_setup_secondary_clock(void) |
132 | { | 132 | { |
133 | /* | 133 | /* |
134 | * Now that the first cpu already had this clocksource initialized, | 134 | * Now that the first cpu already had this clocksource initialized, |
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index 0732adba05ca..7a385746509a 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c | |||
@@ -162,7 +162,10 @@ void machine_kexec(struct kimage *image) | |||
162 | page_list[VA_PTE_0] = (unsigned long)kexec_pte0; | 162 | page_list[VA_PTE_0] = (unsigned long)kexec_pte0; |
163 | page_list[PA_PTE_1] = __pa(kexec_pte1); | 163 | page_list[PA_PTE_1] = __pa(kexec_pte1); |
164 | page_list[VA_PTE_1] = (unsigned long)kexec_pte1; | 164 | page_list[VA_PTE_1] = (unsigned long)kexec_pte1; |
165 | page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) << PAGE_SHIFT); | 165 | |
166 | if (image->type == KEXEC_TYPE_DEFAULT) | ||
167 | page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) | ||
168 | << PAGE_SHIFT); | ||
166 | 169 | ||
167 | /* The segment registers are funny things, they have both a | 170 | /* The segment registers are funny things, they have both a |
168 | * visible and an invisible part. Whenever the visible part is | 171 | * visible and an invisible part. Whenever the visible part is |
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index 7a1f8eeac2c7..5f8e5d75a254 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <asm/microcode.h> | 39 | #include <asm/microcode.h> |
40 | 40 | ||
41 | MODULE_DESCRIPTION("AMD Microcode Update Driver"); | 41 | MODULE_DESCRIPTION("AMD Microcode Update Driver"); |
42 | MODULE_AUTHOR("Peter Oruba <peter.oruba@amd.com>"); | 42 | MODULE_AUTHOR("Peter Oruba"); |
43 | MODULE_LICENSE("GPL v2"); | 43 | MODULE_LICENSE("GPL v2"); |
44 | 44 | ||
45 | #define UCODE_MAGIC 0x00414d44 | 45 | #define UCODE_MAGIC 0x00414d44 |
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 936d8d55f230..82fb2809ce32 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -480,8 +480,8 @@ static int __init microcode_init(void) | |||
480 | 480 | ||
481 | printk(KERN_INFO | 481 | printk(KERN_INFO |
482 | "Microcode Update Driver: v" MICROCODE_VERSION | 482 | "Microcode Update Driver: v" MICROCODE_VERSION |
483 | " <tigran@aivazian.fsnet.co.uk>" | 483 | " <tigran@aivazian.fsnet.co.uk>," |
484 | " <peter.oruba@amd.com>\n"); | 484 | " Peter Oruba\n"); |
485 | 485 | ||
486 | return 0; | 486 | return 0; |
487 | } | 487 | } |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index f98f4e1dba09..0f4c1fd5a1f4 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -604,6 +604,9 @@ static void __init __get_smp_config(unsigned int early) | |||
604 | printk(KERN_INFO "Using ACPI for processor (LAPIC) " | 604 | printk(KERN_INFO "Using ACPI for processor (LAPIC) " |
605 | "configuration information\n"); | 605 | "configuration information\n"); |
606 | 606 | ||
607 | if (!mpf) | ||
608 | return; | ||
609 | |||
607 | printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", | 610 | printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", |
608 | mpf->mpf_specification); | 611 | mpf->mpf_specification); |
609 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) | 612 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) |
diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c index 0e9f1982b1dd..95777b0faa73 100644 --- a/arch/x86/kernel/paravirt-spinlocks.c +++ b/arch/x86/kernel/paravirt-spinlocks.c | |||
@@ -7,7 +7,8 @@ | |||
7 | 7 | ||
8 | #include <asm/paravirt.h> | 8 | #include <asm/paravirt.h> |
9 | 9 | ||
10 | static void default_spin_lock_flags(struct raw_spinlock *lock, unsigned long flags) | 10 | static inline void |
11 | default_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) | ||
11 | { | 12 | { |
12 | __raw_spin_lock(lock); | 13 | __raw_spin_lock(lock); |
13 | } | 14 | } |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index e1e731d78f38..d28bbdc35e4e 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -1567,7 +1567,7 @@ static int __init calgary_parse_options(char *p) | |||
1567 | ++p; | 1567 | ++p; |
1568 | if (*p == '\0') | 1568 | if (*p == '\0') |
1569 | break; | 1569 | break; |
1570 | bridge = simple_strtol(p, &endp, 0); | 1570 | bridge = simple_strtoul(p, &endp, 0); |
1571 | if (p == endp) | 1571 | if (p == endp) |
1572 | break; | 1572 | break; |
1573 | 1573 | ||
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 1972266e8ba5..192624820217 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #include <asm/calgary.h> | 9 | #include <asm/calgary.h> |
10 | #include <asm/amd_iommu.h> | 10 | #include <asm/amd_iommu.h> |
11 | 11 | ||
12 | static int forbid_dac __read_mostly; | ||
13 | |||
12 | struct dma_mapping_ops *dma_ops; | 14 | struct dma_mapping_ops *dma_ops; |
13 | EXPORT_SYMBOL(dma_ops); | 15 | EXPORT_SYMBOL(dma_ops); |
14 | 16 | ||
@@ -291,3 +293,17 @@ void pci_iommu_shutdown(void) | |||
291 | } | 293 | } |
292 | /* Must execute after PCI subsystem */ | 294 | /* Must execute after PCI subsystem */ |
293 | fs_initcall(pci_iommu_init); | 295 | fs_initcall(pci_iommu_init); |
296 | |||
297 | #ifdef CONFIG_PCI | ||
298 | /* Many VIA bridges seem to corrupt data for DAC. Disable it here */ | ||
299 | |||
300 | static __devinit void via_no_dac(struct pci_dev *dev) | ||
301 | { | ||
302 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { | ||
303 | printk(KERN_INFO "PCI: VIA PCI bridge detected." | ||
304 | "Disabling DAC.\n"); | ||
305 | forbid_dac = 1; | ||
306 | } | ||
307 | } | ||
308 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); | ||
309 | #endif | ||
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index e3f75bbcedea..ba7ad83e20a8 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -123,6 +123,8 @@ static void free_iommu(unsigned long offset, int size) | |||
123 | 123 | ||
124 | spin_lock_irqsave(&iommu_bitmap_lock, flags); | 124 | spin_lock_irqsave(&iommu_bitmap_lock, flags); |
125 | iommu_area_free(iommu_gart_bitmap, offset, size); | 125 | iommu_area_free(iommu_gart_bitmap, offset, size); |
126 | if (offset >= next_bit) | ||
127 | next_bit = offset + size; | ||
126 | spin_unlock_irqrestore(&iommu_bitmap_lock, flags); | 128 | spin_unlock_irqrestore(&iommu_bitmap_lock, flags); |
127 | } | 129 | } |
128 | 130 | ||
@@ -744,7 +746,7 @@ void __init gart_iommu_init(void) | |||
744 | long i; | 746 | long i; |
745 | 747 | ||
746 | if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0) { | 748 | if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0) { |
747 | printk(KERN_INFO "PCI-GART: No AMD northbridge found.\n"); | 749 | printk(KERN_INFO "PCI-GART: No AMD GART found.\n"); |
748 | return; | 750 | return; |
749 | } | 751 | } |
750 | 752 | ||
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c index c4ce0332759e..3c539d111abb 100644 --- a/arch/x86/kernel/pci-swiotlb_64.c +++ b/arch/x86/kernel/pci-swiotlb_64.c | |||
@@ -18,9 +18,21 @@ swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size, | |||
18 | return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); | 18 | return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); |
19 | } | 19 | } |
20 | 20 | ||
21 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | ||
22 | dma_addr_t *dma_handle, gfp_t flags) | ||
23 | { | ||
24 | void *vaddr; | ||
25 | |||
26 | vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags); | ||
27 | if (vaddr) | ||
28 | return vaddr; | ||
29 | |||
30 | return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); | ||
31 | } | ||
32 | |||
21 | struct dma_mapping_ops swiotlb_dma_ops = { | 33 | struct dma_mapping_ops swiotlb_dma_ops = { |
22 | .mapping_error = swiotlb_dma_mapping_error, | 34 | .mapping_error = swiotlb_dma_mapping_error, |
23 | .alloc_coherent = swiotlb_alloc_coherent, | 35 | .alloc_coherent = x86_swiotlb_alloc_coherent, |
24 | .free_coherent = swiotlb_free_coherent, | 36 | .free_coherent = swiotlb_free_coherent, |
25 | .map_single = swiotlb_map_single_phys, | 37 | .map_single = swiotlb_map_single_phys, |
26 | .unmap_single = swiotlb_unmap_single, | 38 | .unmap_single = swiotlb_unmap_single, |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index f4c93f1cfc19..cc5a2545dd41 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -29,11 +29,7 @@ EXPORT_SYMBOL(pm_power_off); | |||
29 | 29 | ||
30 | static const struct desc_ptr no_idt = {}; | 30 | static const struct desc_ptr no_idt = {}; |
31 | static int reboot_mode; | 31 | static int reboot_mode; |
32 | /* | 32 | enum reboot_type reboot_type = BOOT_KBD; |
33 | * Keyboard reset and triple fault may result in INIT, not RESET, which | ||
34 | * doesn't work when we're in vmx root mode. Try ACPI first. | ||
35 | */ | ||
36 | enum reboot_type reboot_type = BOOT_ACPI; | ||
37 | int reboot_force; | 33 | int reboot_force; |
38 | 34 | ||
39 | #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) | 35 | #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) |
@@ -173,6 +169,15 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
173 | DMI_MATCH(DMI_BOARD_NAME, "0KW626"), | 169 | DMI_MATCH(DMI_BOARD_NAME, "0KW626"), |
174 | }, | 170 | }, |
175 | }, | 171 | }, |
172 | { /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */ | ||
173 | .callback = set_bios_reboot, | ||
174 | .ident = "Dell OptiPlex 330", | ||
175 | .matches = { | ||
176 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
177 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"), | ||
178 | DMI_MATCH(DMI_BOARD_NAME, "0KP561"), | ||
179 | }, | ||
180 | }, | ||
176 | { /* Handle problems with rebooting on Dell 2400's */ | 181 | { /* Handle problems with rebooting on Dell 2400's */ |
177 | .callback = set_bios_reboot, | 182 | .callback = set_bios_reboot, |
178 | .ident = "Dell PowerEdge 2400", | 183 | .ident = "Dell PowerEdge 2400", |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 0fa6790c1dd3..9d5674f7b6cc 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -764,7 +764,7 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = { | |||
764 | .callback = dmi_low_memory_corruption, | 764 | .callback = dmi_low_memory_corruption, |
765 | .ident = "Phoenix BIOS", | 765 | .ident = "Phoenix BIOS", |
766 | .matches = { | 766 | .matches = { |
767 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"), | 767 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"), |
768 | }, | 768 | }, |
769 | }, | 769 | }, |
770 | #endif | 770 | #endif |
diff --git a/arch/x86/kernel/tlb_32.c b/arch/x86/kernel/tlb_32.c index e00534b33534..f4049f3513b6 100644 --- a/arch/x86/kernel/tlb_32.c +++ b/arch/x86/kernel/tlb_32.c | |||
@@ -154,6 +154,12 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, | |||
154 | flush_mm = mm; | 154 | flush_mm = mm; |
155 | flush_va = va; | 155 | flush_va = va; |
156 | cpus_or(flush_cpumask, cpumask, flush_cpumask); | 156 | cpus_or(flush_cpumask, cpumask, flush_cpumask); |
157 | |||
158 | /* | ||
159 | * Make the above memory operations globally visible before | ||
160 | * sending the IPI. | ||
161 | */ | ||
162 | smp_mb(); | ||
157 | /* | 163 | /* |
158 | * We have to send the IPI only to | 164 | * We have to send the IPI only to |
159 | * CPUs affected. | 165 | * CPUs affected. |
diff --git a/arch/x86/kernel/tlb_64.c b/arch/x86/kernel/tlb_64.c index dcbf7a1159ea..8f919ca69494 100644 --- a/arch/x86/kernel/tlb_64.c +++ b/arch/x86/kernel/tlb_64.c | |||
@@ -183,6 +183,11 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, | |||
183 | cpus_or(f->flush_cpumask, cpumask, f->flush_cpumask); | 183 | cpus_or(f->flush_cpumask, cpumask, f->flush_cpumask); |
184 | 184 | ||
185 | /* | 185 | /* |
186 | * Make the above memory operations globally visible before | ||
187 | * sending the IPI. | ||
188 | */ | ||
189 | smp_mb(); | ||
190 | /* | ||
186 | * We have to send the IPI only to | 191 | * We have to send the IPI only to |
187 | * CPUs affected. | 192 | * CPUs affected. |
188 | */ | 193 | */ |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 161bb850fc47..424093b157d3 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -55,7 +55,7 @@ u64 native_sched_clock(void) | |||
55 | rdtscll(this_offset); | 55 | rdtscll(this_offset); |
56 | 56 | ||
57 | /* return the value in ns */ | 57 | /* return the value in ns */ |
58 | return cycles_2_ns(this_offset); | 58 | return __cycles_2_ns(this_offset); |
59 | } | 59 | } |
60 | 60 | ||
61 | /* We need to define a real function for sched_clock, to override the | 61 | /* We need to define a real function for sched_clock, to override the |
@@ -759,7 +759,7 @@ __cpuinit int unsynchronized_tsc(void) | |||
759 | if (!cpu_has_tsc || tsc_unstable) | 759 | if (!cpu_has_tsc || tsc_unstable) |
760 | return 1; | 760 | return 1; |
761 | 761 | ||
762 | #ifdef CONFIG_SMP | 762 | #ifdef CONFIG_X86_SMP |
763 | if (apic_is_clustered_box()) | 763 | if (apic_is_clustered_box()) |
764 | return 1; | 764 | return 1; |
765 | #endif | 765 | #endif |
@@ -813,10 +813,6 @@ void __init tsc_init(void) | |||
813 | cpu_khz = calibrate_cpu(); | 813 | cpu_khz = calibrate_cpu(); |
814 | #endif | 814 | #endif |
815 | 815 | ||
816 | lpj = ((u64)tsc_khz * 1000); | ||
817 | do_div(lpj, HZ); | ||
818 | lpj_fine = lpj; | ||
819 | |||
820 | printk("Detected %lu.%03lu MHz processor.\n", | 816 | printk("Detected %lu.%03lu MHz processor.\n", |
821 | (unsigned long)cpu_khz / 1000, | 817 | (unsigned long)cpu_khz / 1000, |
822 | (unsigned long)cpu_khz % 1000); | 818 | (unsigned long)cpu_khz % 1000); |
@@ -836,6 +832,10 @@ void __init tsc_init(void) | |||
836 | /* now allow native_sched_clock() to use rdtsc */ | 832 | /* now allow native_sched_clock() to use rdtsc */ |
837 | tsc_disabled = 0; | 833 | tsc_disabled = 0; |
838 | 834 | ||
835 | lpj = ((u64)tsc_khz * 1000); | ||
836 | do_div(lpj, HZ); | ||
837 | lpj_fine = lpj; | ||
838 | |||
839 | use_tsc_delay(); | 839 | use_tsc_delay(); |
840 | /* Check and install the TSC clocksource */ | 840 | /* Check and install the TSC clocksource */ |
841 | dmi_check_system(bad_tsc_dmi_table); | 841 | dmi_check_system(bad_tsc_dmi_table); |
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index 9ffb01c31c40..1c0dfbca87c1 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c | |||
@@ -46,7 +46,9 @@ static __cpuinit void check_tsc_warp(void) | |||
46 | cycles_t start, now, prev, end; | 46 | cycles_t start, now, prev, end; |
47 | int i; | 47 | int i; |
48 | 48 | ||
49 | rdtsc_barrier(); | ||
49 | start = get_cycles(); | 50 | start = get_cycles(); |
51 | rdtsc_barrier(); | ||
50 | /* | 52 | /* |
51 | * The measurement runs for 20 msecs: | 53 | * The measurement runs for 20 msecs: |
52 | */ | 54 | */ |
@@ -61,7 +63,9 @@ static __cpuinit void check_tsc_warp(void) | |||
61 | */ | 63 | */ |
62 | __raw_spin_lock(&sync_lock); | 64 | __raw_spin_lock(&sync_lock); |
63 | prev = last_tsc; | 65 | prev = last_tsc; |
66 | rdtsc_barrier(); | ||
64 | now = get_cycles(); | 67 | now = get_cycles(); |
68 | rdtsc_barrier(); | ||
65 | last_tsc = now; | 69 | last_tsc = now; |
66 | __raw_spin_unlock(&sync_lock); | 70 | __raw_spin_unlock(&sync_lock); |
67 | 71 | ||
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 7766d36983fc..a688f3bfaec2 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c | |||
@@ -78,7 +78,7 @@ static unsigned __init_or_module vsmp_patch(u8 type, u16 clobbers, void *ibuf, | |||
78 | 78 | ||
79 | static void __init set_vsmp_pv_ops(void) | 79 | static void __init set_vsmp_pv_ops(void) |
80 | { | 80 | { |
81 | void *address; | 81 | void __iomem *address; |
82 | unsigned int cap, ctl, cfg; | 82 | unsigned int cap, ctl, cfg; |
83 | 83 | ||
84 | /* set vSMP magic bits to indicate vSMP capable kernel */ | 84 | /* set vSMP magic bits to indicate vSMP capable kernel */ |
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c index b545f371b5f5..695e426aa354 100644 --- a/arch/x86/kernel/x8664_ksyms_64.c +++ b/arch/x86/kernel/x8664_ksyms_64.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <asm/desc.h> | 12 | #include <asm/desc.h> |
13 | #include <asm/ftrace.h> | 13 | #include <asm/ftrace.h> |
14 | 14 | ||
15 | #ifdef CONFIG_FTRACE | 15 | #ifdef CONFIG_FUNCTION_TRACER |
16 | /* mcount is defined in assembly */ | 16 | /* mcount is defined in assembly */ |
17 | EXPORT_SYMBOL(mcount); | 17 | EXPORT_SYMBOL(mcount); |
18 | #endif | 18 | #endif |
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index b13acb75e822..15c3e6999182 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c | |||
@@ -310,7 +310,7 @@ static void __init setup_xstate_init(void) | |||
310 | /* | 310 | /* |
311 | * Enable and initialize the xsave feature. | 311 | * Enable and initialize the xsave feature. |
312 | */ | 312 | */ |
313 | void __init xsave_cntxt_init(void) | 313 | void __ref xsave_cntxt_init(void) |
314 | { | 314 | { |
315 | unsigned int eax, ebx, ecx, edx; | 315 | unsigned int eax, ebx, ecx, edx; |
316 | 316 | ||
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index ce3251ce5504..b81125f0bdee 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig | |||
@@ -20,6 +20,8 @@ if VIRTUALIZATION | |||
20 | config KVM | 20 | config KVM |
21 | tristate "Kernel-based Virtual Machine (KVM) support" | 21 | tristate "Kernel-based Virtual Machine (KVM) support" |
22 | depends on HAVE_KVM | 22 | depends on HAVE_KVM |
23 | # for device assignment: | ||
24 | depends on PCI | ||
23 | select PREEMPT_NOTIFIERS | 25 | select PREEMPT_NOTIFIERS |
24 | select MMU_NOTIFIER | 26 | select MMU_NOTIFIER |
25 | select ANON_INODES | 27 | select ANON_INODES |
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 11c6725fb798..59ebd37ad79e 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c | |||
@@ -545,6 +545,14 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm) | |||
545 | if (!pit) | 545 | if (!pit) |
546 | return NULL; | 546 | return NULL; |
547 | 547 | ||
548 | mutex_lock(&kvm->lock); | ||
549 | pit->irq_source_id = kvm_request_irq_source_id(kvm); | ||
550 | mutex_unlock(&kvm->lock); | ||
551 | if (pit->irq_source_id < 0) { | ||
552 | kfree(pit); | ||
553 | return NULL; | ||
554 | } | ||
555 | |||
548 | mutex_init(&pit->pit_state.lock); | 556 | mutex_init(&pit->pit_state.lock); |
549 | mutex_lock(&pit->pit_state.lock); | 557 | mutex_lock(&pit->pit_state.lock); |
550 | spin_lock_init(&pit->pit_state.inject_lock); | 558 | spin_lock_init(&pit->pit_state.inject_lock); |
@@ -587,6 +595,7 @@ void kvm_free_pit(struct kvm *kvm) | |||
587 | mutex_lock(&kvm->arch.vpit->pit_state.lock); | 595 | mutex_lock(&kvm->arch.vpit->pit_state.lock); |
588 | timer = &kvm->arch.vpit->pit_state.pit_timer.timer; | 596 | timer = &kvm->arch.vpit->pit_state.pit_timer.timer; |
589 | hrtimer_cancel(timer); | 597 | hrtimer_cancel(timer); |
598 | kvm_free_irq_source_id(kvm, kvm->arch.vpit->irq_source_id); | ||
590 | mutex_unlock(&kvm->arch.vpit->pit_state.lock); | 599 | mutex_unlock(&kvm->arch.vpit->pit_state.lock); |
591 | kfree(kvm->arch.vpit); | 600 | kfree(kvm->arch.vpit); |
592 | } | 601 | } |
@@ -595,8 +604,8 @@ void kvm_free_pit(struct kvm *kvm) | |||
595 | static void __inject_pit_timer_intr(struct kvm *kvm) | 604 | static void __inject_pit_timer_intr(struct kvm *kvm) |
596 | { | 605 | { |
597 | mutex_lock(&kvm->lock); | 606 | mutex_lock(&kvm->lock); |
598 | kvm_set_irq(kvm, 0, 1); | 607 | kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 1); |
599 | kvm_set_irq(kvm, 0, 0); | 608 | kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 0); |
600 | mutex_unlock(&kvm->lock); | 609 | mutex_unlock(&kvm->lock); |
601 | } | 610 | } |
602 | 611 | ||
diff --git a/arch/x86/kvm/i8254.h b/arch/x86/kvm/i8254.h index e436d4983aa1..4178022b97aa 100644 --- a/arch/x86/kvm/i8254.h +++ b/arch/x86/kvm/i8254.h | |||
@@ -44,6 +44,7 @@ struct kvm_pit { | |||
44 | struct kvm_io_device speaker_dev; | 44 | struct kvm_io_device speaker_dev; |
45 | struct kvm *kvm; | 45 | struct kvm *kvm; |
46 | struct kvm_kpit_state pit_state; | 46 | struct kvm_kpit_state pit_state; |
47 | int irq_source_id; | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | #define KVM_PIT_BASE_ADDRESS 0x40 | 50 | #define KVM_PIT_BASE_ADDRESS 0x40 |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 99c239c5c0ac..410ddbc1aa2e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -314,7 +314,7 @@ static int mmu_topup_memory_caches(struct kvm_vcpu *vcpu) | |||
314 | if (r) | 314 | if (r) |
315 | goto out; | 315 | goto out; |
316 | r = mmu_topup_memory_cache(&vcpu->arch.mmu_rmap_desc_cache, | 316 | r = mmu_topup_memory_cache(&vcpu->arch.mmu_rmap_desc_cache, |
317 | rmap_desc_cache, 1); | 317 | rmap_desc_cache, 4); |
318 | if (r) | 318 | if (r) |
319 | goto out; | 319 | goto out; |
320 | r = mmu_topup_memory_cache_page(&vcpu->arch.mmu_page_cache, 8); | 320 | r = mmu_topup_memory_cache_page(&vcpu->arch.mmu_page_cache, 8); |
@@ -1038,13 +1038,13 @@ static int kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) | |||
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | rmap_write_protect(vcpu->kvm, sp->gfn); | 1040 | rmap_write_protect(vcpu->kvm, sp->gfn); |
1041 | kvm_unlink_unsync_page(vcpu->kvm, sp); | ||
1041 | if (vcpu->arch.mmu.sync_page(vcpu, sp)) { | 1042 | if (vcpu->arch.mmu.sync_page(vcpu, sp)) { |
1042 | kvm_mmu_zap_page(vcpu->kvm, sp); | 1043 | kvm_mmu_zap_page(vcpu->kvm, sp); |
1043 | return 1; | 1044 | return 1; |
1044 | } | 1045 | } |
1045 | 1046 | ||
1046 | kvm_mmu_flush_tlb(vcpu); | 1047 | kvm_mmu_flush_tlb(vcpu); |
1047 | kvm_unlink_unsync_page(vcpu->kvm, sp); | ||
1048 | return 0; | 1048 | return 0; |
1049 | } | 1049 | } |
1050 | 1050 | ||
@@ -2634,6 +2634,7 @@ static int kvm_pv_mmu_write(struct kvm_vcpu *vcpu, | |||
2634 | static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu) | 2634 | static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu) |
2635 | { | 2635 | { |
2636 | kvm_x86_ops->tlb_flush(vcpu); | 2636 | kvm_x86_ops->tlb_flush(vcpu); |
2637 | set_bit(KVM_REQ_MMU_SYNC, &vcpu->requests); | ||
2637 | return 1; | 2638 | return 1; |
2638 | } | 2639 | } |
2639 | 2640 | ||
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 613ec9aa674a..84eee43bbe74 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -331,6 +331,7 @@ static int FNAME(shadow_walk_entry)(struct kvm_shadow_walk *_sw, | |||
331 | r = kvm_read_guest_atomic(vcpu->kvm, gw->pte_gpa[level - 2], | 331 | r = kvm_read_guest_atomic(vcpu->kvm, gw->pte_gpa[level - 2], |
332 | &curr_pte, sizeof(curr_pte)); | 332 | &curr_pte, sizeof(curr_pte)); |
333 | if (r || curr_pte != gw->ptes[level - 2]) { | 333 | if (r || curr_pte != gw->ptes[level - 2]) { |
334 | kvm_mmu_put_page(shadow_page, sptep); | ||
334 | kvm_release_pfn_clean(sw->pfn); | 335 | kvm_release_pfn_clean(sw->pfn); |
335 | sw->sptep = NULL; | 336 | sw->sptep = NULL; |
336 | return 1; | 337 | return 1; |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 2643b430d83a..a4018b01e1f9 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3149,7 +3149,9 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) | |||
3149 | 3149 | ||
3150 | if (cpu_has_virtual_nmis()) { | 3150 | if (cpu_has_virtual_nmis()) { |
3151 | if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) { | 3151 | if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) { |
3152 | if (vmx_nmi_enabled(vcpu)) { | 3152 | if (vcpu->arch.interrupt.pending) { |
3153 | enable_nmi_window(vcpu); | ||
3154 | } else if (vmx_nmi_enabled(vcpu)) { | ||
3153 | vcpu->arch.nmi_pending = false; | 3155 | vcpu->arch.nmi_pending = false; |
3154 | vcpu->arch.nmi_injected = true; | 3156 | vcpu->arch.nmi_injected = true; |
3155 | } else { | 3157 | } else { |
@@ -3564,7 +3566,8 @@ static int __init vmx_init(void) | |||
3564 | bypass_guest_pf = 0; | 3566 | bypass_guest_pf = 0; |
3565 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | | 3567 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | |
3566 | VMX_EPT_WRITABLE_MASK | | 3568 | VMX_EPT_WRITABLE_MASK | |
3567 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT); | 3569 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT | |
3570 | VMX_EPT_IGMT_BIT); | ||
3568 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, | 3571 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, |
3569 | VMX_EPT_EXECUTABLE_MASK); | 3572 | VMX_EPT_EXECUTABLE_MASK); |
3570 | kvm_enable_tdp(); | 3573 | kvm_enable_tdp(); |
diff --git a/arch/x86/kvm/vmx.h b/arch/x86/kvm/vmx.h index 3e010d21fdd7..ec5edc339da6 100644 --- a/arch/x86/kvm/vmx.h +++ b/arch/x86/kvm/vmx.h | |||
@@ -352,6 +352,7 @@ enum vmcs_field { | |||
352 | #define VMX_EPT_READABLE_MASK 0x1ull | 352 | #define VMX_EPT_READABLE_MASK 0x1ull |
353 | #define VMX_EPT_WRITABLE_MASK 0x2ull | 353 | #define VMX_EPT_WRITABLE_MASK 0x2ull |
354 | #define VMX_EPT_EXECUTABLE_MASK 0x4ull | 354 | #define VMX_EPT_EXECUTABLE_MASK 0x4ull |
355 | #define VMX_EPT_IGMT_BIT (1ull << 6) | ||
355 | 356 | ||
356 | #define VMX_EPT_IDENTITY_PAGETABLE_ADDR 0xfffbc000ul | 357 | #define VMX_EPT_IDENTITY_PAGETABLE_ADDR 0xfffbc000ul |
357 | 358 | ||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4f0677d1eae8..f1f8ff2f1fa2 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1742,7 +1742,8 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
1742 | goto out; | 1742 | goto out; |
1743 | if (irqchip_in_kernel(kvm)) { | 1743 | if (irqchip_in_kernel(kvm)) { |
1744 | mutex_lock(&kvm->lock); | 1744 | mutex_lock(&kvm->lock); |
1745 | kvm_set_irq(kvm, irq_event.irq, irq_event.level); | 1745 | kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, |
1746 | irq_event.irq, irq_event.level); | ||
1746 | mutex_unlock(&kvm->lock); | 1747 | mutex_unlock(&kvm->lock); |
1747 | r = 0; | 1748 | r = 0; |
1748 | } | 1749 | } |
@@ -4013,6 +4014,9 @@ struct kvm *kvm_arch_create_vm(void) | |||
4013 | INIT_LIST_HEAD(&kvm->arch.active_mmu_pages); | 4014 | INIT_LIST_HEAD(&kvm->arch.active_mmu_pages); |
4014 | INIT_LIST_HEAD(&kvm->arch.assigned_dev_head); | 4015 | INIT_LIST_HEAD(&kvm->arch.assigned_dev_head); |
4015 | 4016 | ||
4017 | /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */ | ||
4018 | set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap); | ||
4019 | |||
4016 | return kvm; | 4020 | return kvm; |
4017 | } | 4021 | } |
4018 | 4022 | ||
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 48ee4f9435f4..a5d8e1ace1cf 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -367,10 +367,9 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx, | |||
367 | * lazily after a task switch, and Linux uses that gratefully, but wouldn't a | 367 | * lazily after a task switch, and Linux uses that gratefully, but wouldn't a |
368 | * name like "FPUTRAP bit" be a little less cryptic? | 368 | * name like "FPUTRAP bit" be a little less cryptic? |
369 | * | 369 | * |
370 | * We store cr0 (and cr3) locally, because the Host never changes it. The | 370 | * We store cr0 locally because the Host never changes it. The Guest sometimes |
371 | * Guest sometimes wants to read it and we'd prefer not to bother the Host | 371 | * wants to read it and we'd prefer not to bother the Host unnecessarily. */ |
372 | * unnecessarily. */ | 372 | static unsigned long current_cr0; |
373 | static unsigned long current_cr0, current_cr3; | ||
374 | static void lguest_write_cr0(unsigned long val) | 373 | static void lguest_write_cr0(unsigned long val) |
375 | { | 374 | { |
376 | lazy_hcall(LHCALL_TS, val & X86_CR0_TS, 0, 0); | 375 | lazy_hcall(LHCALL_TS, val & X86_CR0_TS, 0, 0); |
@@ -399,17 +398,23 @@ static unsigned long lguest_read_cr2(void) | |||
399 | return lguest_data.cr2; | 398 | return lguest_data.cr2; |
400 | } | 399 | } |
401 | 400 | ||
401 | /* See lguest_set_pte() below. */ | ||
402 | static bool cr3_changed = false; | ||
403 | |||
402 | /* cr3 is the current toplevel pagetable page: the principle is the same as | 404 | /* cr3 is the current toplevel pagetable page: the principle is the same as |
403 | * cr0. Keep a local copy, and tell the Host when it changes. */ | 405 | * cr0. Keep a local copy, and tell the Host when it changes. The only |
406 | * difference is that our local copy is in lguest_data because the Host needs | ||
407 | * to set it upon our initial hypercall. */ | ||
404 | static void lguest_write_cr3(unsigned long cr3) | 408 | static void lguest_write_cr3(unsigned long cr3) |
405 | { | 409 | { |
410 | lguest_data.pgdir = cr3; | ||
406 | lazy_hcall(LHCALL_NEW_PGTABLE, cr3, 0, 0); | 411 | lazy_hcall(LHCALL_NEW_PGTABLE, cr3, 0, 0); |
407 | current_cr3 = cr3; | 412 | cr3_changed = true; |
408 | } | 413 | } |
409 | 414 | ||
410 | static unsigned long lguest_read_cr3(void) | 415 | static unsigned long lguest_read_cr3(void) |
411 | { | 416 | { |
412 | return current_cr3; | 417 | return lguest_data.pgdir; |
413 | } | 418 | } |
414 | 419 | ||
415 | /* cr4 is used to enable and disable PGE, but we don't care. */ | 420 | /* cr4 is used to enable and disable PGE, but we don't care. */ |
@@ -498,13 +503,13 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) | |||
498 | * to forget all of them. Fortunately, this is very rare. | 503 | * to forget all of them. Fortunately, this is very rare. |
499 | * | 504 | * |
500 | * ... except in early boot when the kernel sets up the initial pagetables, | 505 | * ... except in early boot when the kernel sets up the initial pagetables, |
501 | * which makes booting astonishingly slow. So we don't even tell the Host | 506 | * which makes booting astonishingly slow: 1.83 seconds! So we don't even tell |
502 | * anything changed until we've done the first page table switch. */ | 507 | * the Host anything changed until we've done the first page table switch, |
508 | * which brings boot back to 0.25 seconds. */ | ||
503 | static void lguest_set_pte(pte_t *ptep, pte_t pteval) | 509 | static void lguest_set_pte(pte_t *ptep, pte_t pteval) |
504 | { | 510 | { |
505 | *ptep = pteval; | 511 | *ptep = pteval; |
506 | /* Don't bother with hypercall before initial setup. */ | 512 | if (cr3_changed) |
507 | if (current_cr3) | ||
508 | lazy_hcall(LHCALL_FLUSH_TLB, 1, 0, 0); | 513 | lazy_hcall(LHCALL_FLUSH_TLB, 1, 0, 0); |
509 | } | 514 | } |
510 | 515 | ||
@@ -521,7 +526,7 @@ static void lguest_set_pte(pte_t *ptep, pte_t pteval) | |||
521 | static void lguest_flush_tlb_single(unsigned long addr) | 526 | static void lguest_flush_tlb_single(unsigned long addr) |
522 | { | 527 | { |
523 | /* Simply set it to zero: if it was not, it will fault back in. */ | 528 | /* Simply set it to zero: if it was not, it will fault back in. */ |
524 | lazy_hcall(LHCALL_SET_PTE, current_cr3, addr, 0); | 529 | lazy_hcall(LHCALL_SET_PTE, lguest_data.pgdir, addr, 0); |
525 | } | 530 | } |
526 | 531 | ||
527 | /* This is what happens after the Guest has removed a large number of entries. | 532 | /* This is what happens after the Guest has removed a large number of entries. |
@@ -581,6 +586,9 @@ static void __init lguest_init_IRQ(void) | |||
581 | 586 | ||
582 | for (i = 0; i < LGUEST_IRQS; i++) { | 587 | for (i = 0; i < LGUEST_IRQS; i++) { |
583 | int vector = FIRST_EXTERNAL_VECTOR + i; | 588 | int vector = FIRST_EXTERNAL_VECTOR + i; |
589 | /* Some systems map "vectors" to interrupts weirdly. Lguest has | ||
590 | * a straightforward 1 to 1 mapping, so force that here. */ | ||
591 | __get_cpu_var(vector_irq)[vector] = i; | ||
584 | if (vector != SYSCALL_VECTOR) { | 592 | if (vector != SYSCALL_VECTOR) { |
585 | set_intr_gate(vector, interrupt[vector]); | 593 | set_intr_gate(vector, interrupt[vector]); |
586 | set_irq_chip_and_handler_name(i, &lguest_irq_controller, | 594 | set_irq_chip_and_handler_name(i, &lguest_irq_controller, |
diff --git a/arch/x86/mach-voyager/setup.c b/arch/x86/mach-voyager/setup.c index 6bbdd633864c..a580b9562e76 100644 --- a/arch/x86/mach-voyager/setup.c +++ b/arch/x86/mach-voyager/setup.c | |||
@@ -27,7 +27,7 @@ static struct irqaction irq2 = { | |||
27 | void __init intr_init_hook(void) | 27 | void __init intr_init_hook(void) |
28 | { | 28 | { |
29 | #ifdef CONFIG_SMP | 29 | #ifdef CONFIG_SMP |
30 | smp_intr_init(); | 30 | voyager_smp_intr_init(); |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | setup_irq(2, &irq2); | 33 | setup_irq(2, &irq2); |
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 0f6e8a6523ae..52145007bd7e 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * This file provides all the same external entries as smp.c but uses | 7 | * This file provides all the same external entries as smp.c but uses |
8 | * the voyager hal to provide the functionality | 8 | * the voyager hal to provide the functionality |
9 | */ | 9 | */ |
10 | #include <linux/cpu.h> | ||
10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
11 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
12 | #include <linux/kernel_stat.h> | 13 | #include <linux/kernel_stat.h> |
@@ -90,6 +91,7 @@ static void ack_vic_irq(unsigned int irq); | |||
90 | static void vic_enable_cpi(void); | 91 | static void vic_enable_cpi(void); |
91 | static void do_boot_cpu(__u8 cpuid); | 92 | static void do_boot_cpu(__u8 cpuid); |
92 | static void do_quad_bootstrap(void); | 93 | static void do_quad_bootstrap(void); |
94 | static void initialize_secondary(void); | ||
93 | 95 | ||
94 | int hard_smp_processor_id(void); | 96 | int hard_smp_processor_id(void); |
95 | int safe_smp_processor_id(void); | 97 | int safe_smp_processor_id(void); |
@@ -344,6 +346,12 @@ static void do_quad_bootstrap(void) | |||
344 | } | 346 | } |
345 | } | 347 | } |
346 | 348 | ||
349 | void prefill_possible_map(void) | ||
350 | { | ||
351 | /* This is empty on voyager because we need a much | ||
352 | * earlier detection which is done in find_smp_config */ | ||
353 | } | ||
354 | |||
347 | /* Set up all the basic stuff: read the SMP config and make all the | 355 | /* Set up all the basic stuff: read the SMP config and make all the |
348 | * SMP information reflect only the boot cpu. All others will be | 356 | * SMP information reflect only the boot cpu. All others will be |
349 | * brought on-line later. */ | 357 | * brought on-line later. */ |
@@ -413,6 +421,7 @@ void __init smp_store_cpu_info(int id) | |||
413 | struct cpuinfo_x86 *c = &cpu_data(id); | 421 | struct cpuinfo_x86 *c = &cpu_data(id); |
414 | 422 | ||
415 | *c = boot_cpu_data; | 423 | *c = boot_cpu_data; |
424 | c->cpu_index = id; | ||
416 | 425 | ||
417 | identify_secondary_cpu(c); | 426 | identify_secondary_cpu(c); |
418 | } | 427 | } |
@@ -650,6 +659,8 @@ void __init smp_boot_cpus(void) | |||
650 | smp_tune_scheduling(); | 659 | smp_tune_scheduling(); |
651 | */ | 660 | */ |
652 | smp_store_cpu_info(boot_cpu_id); | 661 | smp_store_cpu_info(boot_cpu_id); |
662 | /* setup the jump vector */ | ||
663 | initial_code = (unsigned long)initialize_secondary; | ||
653 | printk("CPU%d: ", boot_cpu_id); | 664 | printk("CPU%d: ", boot_cpu_id); |
654 | print_cpu_info(&cpu_data(boot_cpu_id)); | 665 | print_cpu_info(&cpu_data(boot_cpu_id)); |
655 | 666 | ||
@@ -702,7 +713,7 @@ void __init smp_boot_cpus(void) | |||
702 | 713 | ||
703 | /* Reload the secondary CPUs task structure (this function does not | 714 | /* Reload the secondary CPUs task structure (this function does not |
704 | * return ) */ | 715 | * return ) */ |
705 | void __init initialize_secondary(void) | 716 | static void __init initialize_secondary(void) |
706 | { | 717 | { |
707 | #if 0 | 718 | #if 0 |
708 | // AC kernels only | 719 | // AC kernels only |
@@ -1248,7 +1259,7 @@ static void handle_vic_irq(unsigned int irq, struct irq_desc *desc) | |||
1248 | #define QIC_SET_GATE(cpi, vector) \ | 1259 | #define QIC_SET_GATE(cpi, vector) \ |
1249 | set_intr_gate((cpi) + QIC_DEFAULT_CPI_BASE, (vector)) | 1260 | set_intr_gate((cpi) + QIC_DEFAULT_CPI_BASE, (vector)) |
1250 | 1261 | ||
1251 | void __init smp_intr_init(void) | 1262 | void __init voyager_smp_intr_init(void) |
1252 | { | 1263 | { |
1253 | int i; | 1264 | int i; |
1254 | 1265 | ||
@@ -1780,6 +1791,17 @@ void __init smp_setup_processor_id(void) | |||
1780 | x86_write_percpu(cpu_number, hard_smp_processor_id()); | 1791 | x86_write_percpu(cpu_number, hard_smp_processor_id()); |
1781 | } | 1792 | } |
1782 | 1793 | ||
1794 | static void voyager_send_call_func(cpumask_t callmask) | ||
1795 | { | ||
1796 | __u32 mask = cpus_addr(callmask)[0] & ~(1 << smp_processor_id()); | ||
1797 | send_CPI(mask, VIC_CALL_FUNCTION_CPI); | ||
1798 | } | ||
1799 | |||
1800 | static void voyager_send_call_func_single(int cpu) | ||
1801 | { | ||
1802 | send_CPI(1 << cpu, VIC_CALL_FUNCTION_SINGLE_CPI); | ||
1803 | } | ||
1804 | |||
1783 | struct smp_ops smp_ops = { | 1805 | struct smp_ops smp_ops = { |
1784 | .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu, | 1806 | .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu, |
1785 | .smp_prepare_cpus = voyager_smp_prepare_cpus, | 1807 | .smp_prepare_cpus = voyager_smp_prepare_cpus, |
@@ -1789,6 +1811,6 @@ struct smp_ops smp_ops = { | |||
1789 | .smp_send_stop = voyager_smp_send_stop, | 1811 | .smp_send_stop = voyager_smp_send_stop, |
1790 | .smp_send_reschedule = voyager_smp_send_reschedule, | 1812 | .smp_send_reschedule = voyager_smp_send_reschedule, |
1791 | 1813 | ||
1792 | .send_call_func_ipi = native_send_call_func_ipi, | 1814 | .send_call_func_ipi = voyager_send_call_func, |
1793 | .send_call_func_single_ipi = native_send_call_func_single_ipi, | 1815 | .send_call_func_single_ipi = voyager_send_call_func_single, |
1794 | }; | 1816 | }; |
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile index 59f89b434b45..fea4565ff576 100644 --- a/arch/x86/mm/Makefile +++ b/arch/x86/mm/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | obj-y := init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ | 1 | obj-y := init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ |
2 | pat.o pgtable.o gup.o | 2 | pat.o pgtable.o gup.o |
3 | 3 | ||
4 | obj-$(CONFIG_X86_32) += pgtable_32.o | 4 | obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o |
5 | 5 | ||
6 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | 6 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o |
7 | obj-$(CONFIG_X86_PTDUMP) += dump_pagetables.o | 7 | obj-$(CONFIG_X86_PTDUMP) += dump_pagetables.o |
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index 4ba373c5b8c8..be54176e9eb2 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -233,7 +233,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
233 | len = (unsigned long) nr_pages << PAGE_SHIFT; | 233 | len = (unsigned long) nr_pages << PAGE_SHIFT; |
234 | end = start + len; | 234 | end = start + len; |
235 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | 235 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, |
236 | start, len))) | 236 | (void __user *)start, len))) |
237 | goto slow_irqon; | 237 | goto slow_irqon; |
238 | 238 | ||
239 | /* | 239 | /* |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 8396868e82c5..c483f4242079 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -334,7 +334,6 @@ int devmem_is_allowed(unsigned long pagenr) | |||
334 | return 0; | 334 | return 0; |
335 | } | 335 | } |
336 | 336 | ||
337 | #ifdef CONFIG_HIGHMEM | ||
338 | pte_t *kmap_pte; | 337 | pte_t *kmap_pte; |
339 | pgprot_t kmap_prot; | 338 | pgprot_t kmap_prot; |
340 | 339 | ||
@@ -357,6 +356,7 @@ static void __init kmap_init(void) | |||
357 | kmap_prot = PAGE_KERNEL; | 356 | kmap_prot = PAGE_KERNEL; |
358 | } | 357 | } |
359 | 358 | ||
359 | #ifdef CONFIG_HIGHMEM | ||
360 | static void __init permanent_kmaps_init(pgd_t *pgd_base) | 360 | static void __init permanent_kmaps_init(pgd_t *pgd_base) |
361 | { | 361 | { |
362 | unsigned long vaddr; | 362 | unsigned long vaddr; |
@@ -436,7 +436,6 @@ static void __init set_highmem_pages_init(void) | |||
436 | #endif /* !CONFIG_NUMA */ | 436 | #endif /* !CONFIG_NUMA */ |
437 | 437 | ||
438 | #else | 438 | #else |
439 | # define kmap_init() do { } while (0) | ||
440 | # define permanent_kmaps_init(pgd_base) do { } while (0) | 439 | # define permanent_kmaps_init(pgd_base) do { } while (0) |
441 | # define set_highmem_pages_init() do { } while (0) | 440 | # define set_highmem_pages_init() do { } while (0) |
442 | #endif /* CONFIG_HIGHMEM */ | 441 | #endif /* CONFIG_HIGHMEM */ |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index b8e461d49412..9db01db6e3cd 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -350,8 +350,10 @@ phys_pte_init(pte_t *pte_page, unsigned long addr, unsigned long end, | |||
350 | * pagetable pages as RO. So assume someone who pre-setup | 350 | * pagetable pages as RO. So assume someone who pre-setup |
351 | * these mappings are more intelligent. | 351 | * these mappings are more intelligent. |
352 | */ | 352 | */ |
353 | if (pte_val(*pte)) | 353 | if (pte_val(*pte)) { |
354 | pages++; | ||
354 | continue; | 355 | continue; |
356 | } | ||
355 | 357 | ||
356 | if (0) | 358 | if (0) |
357 | printk(" pte=%p addr=%lx pte=%016lx\n", | 359 | printk(" pte=%p addr=%lx pte=%016lx\n", |
@@ -418,8 +420,10 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, | |||
418 | * not differ with respect to page frame and | 420 | * not differ with respect to page frame and |
419 | * attributes. | 421 | * attributes. |
420 | */ | 422 | */ |
421 | if (page_size_mask & (1 << PG_LEVEL_2M)) | 423 | if (page_size_mask & (1 << PG_LEVEL_2M)) { |
424 | pages++; | ||
422 | continue; | 425 | continue; |
426 | } | ||
423 | new_prot = pte_pgprot(pte_clrhuge(*(pte_t *)pmd)); | 427 | new_prot = pte_pgprot(pte_clrhuge(*(pte_t *)pmd)); |
424 | } | 428 | } |
425 | 429 | ||
@@ -499,8 +503,10 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, | |||
499 | * not differ with respect to page frame and | 503 | * not differ with respect to page frame and |
500 | * attributes. | 504 | * attributes. |
501 | */ | 505 | */ |
502 | if (page_size_mask & (1 << PG_LEVEL_1G)) | 506 | if (page_size_mask & (1 << PG_LEVEL_1G)) { |
507 | pages++; | ||
503 | continue; | 508 | continue; |
509 | } | ||
504 | prot = pte_pgprot(pte_clrhuge(*(pte_t *)pud)); | 510 | prot = pte_pgprot(pte_clrhuge(*(pte_t *)pud)); |
505 | } | 511 | } |
506 | 512 | ||
@@ -665,12 +671,13 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
665 | unsigned long last_map_addr = 0; | 671 | unsigned long last_map_addr = 0; |
666 | unsigned long page_size_mask = 0; | 672 | unsigned long page_size_mask = 0; |
667 | unsigned long start_pfn, end_pfn; | 673 | unsigned long start_pfn, end_pfn; |
674 | unsigned long pos; | ||
668 | 675 | ||
669 | struct map_range mr[NR_RANGE_MR]; | 676 | struct map_range mr[NR_RANGE_MR]; |
670 | int nr_range, i; | 677 | int nr_range, i; |
671 | int use_pse, use_gbpages; | 678 | int use_pse, use_gbpages; |
672 | 679 | ||
673 | printk(KERN_INFO "init_memory_mapping\n"); | 680 | printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end); |
674 | 681 | ||
675 | /* | 682 | /* |
676 | * Find space for the kernel direct mapping tables. | 683 | * Find space for the kernel direct mapping tables. |
@@ -704,35 +711,50 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
704 | 711 | ||
705 | /* head if not big page alignment ?*/ | 712 | /* head if not big page alignment ?*/ |
706 | start_pfn = start >> PAGE_SHIFT; | 713 | start_pfn = start >> PAGE_SHIFT; |
707 | end_pfn = ((start + (PMD_SIZE - 1)) >> PMD_SHIFT) | 714 | pos = start_pfn << PAGE_SHIFT; |
715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) | ||
708 | << (PMD_SHIFT - PAGE_SHIFT); | 716 | << (PMD_SHIFT - PAGE_SHIFT); |
709 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | 717 | if (start_pfn < end_pfn) { |
718 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | ||
719 | pos = end_pfn << PAGE_SHIFT; | ||
720 | } | ||
710 | 721 | ||
711 | /* big page (2M) range*/ | 722 | /* big page (2M) range*/ |
712 | start_pfn = ((start + (PMD_SIZE - 1))>>PMD_SHIFT) | 723 | start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT) |
713 | << (PMD_SHIFT - PAGE_SHIFT); | 724 | << (PMD_SHIFT - PAGE_SHIFT); |
714 | end_pfn = ((start + (PUD_SIZE - 1))>>PUD_SHIFT) | 725 | end_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT) |
715 | << (PUD_SHIFT - PAGE_SHIFT); | 726 | << (PUD_SHIFT - PAGE_SHIFT); |
716 | if (end_pfn > ((end>>PUD_SHIFT)<<(PUD_SHIFT - PAGE_SHIFT))) | 727 | if (end_pfn > ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT))) |
717 | end_pfn = ((end>>PUD_SHIFT)<<(PUD_SHIFT - PAGE_SHIFT)); | 728 | end_pfn = ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT)); |
718 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | 729 | if (start_pfn < end_pfn) { |
719 | page_size_mask & (1<<PG_LEVEL_2M)); | 730 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, |
731 | page_size_mask & (1<<PG_LEVEL_2M)); | ||
732 | pos = end_pfn << PAGE_SHIFT; | ||
733 | } | ||
720 | 734 | ||
721 | /* big page (1G) range */ | 735 | /* big page (1G) range */ |
722 | start_pfn = end_pfn; | 736 | start_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT) |
723 | end_pfn = (end>>PUD_SHIFT) << (PUD_SHIFT - PAGE_SHIFT); | 737 | << (PUD_SHIFT - PAGE_SHIFT); |
724 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | 738 | end_pfn = (end >> PUD_SHIFT) << (PUD_SHIFT - PAGE_SHIFT); |
739 | if (start_pfn < end_pfn) { | ||
740 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | ||
725 | page_size_mask & | 741 | page_size_mask & |
726 | ((1<<PG_LEVEL_2M)|(1<<PG_LEVEL_1G))); | 742 | ((1<<PG_LEVEL_2M)|(1<<PG_LEVEL_1G))); |
743 | pos = end_pfn << PAGE_SHIFT; | ||
744 | } | ||
727 | 745 | ||
728 | /* tail is not big page (1G) alignment */ | 746 | /* tail is not big page (1G) alignment */ |
729 | start_pfn = end_pfn; | 747 | start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT) |
730 | end_pfn = (end>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT); | 748 | << (PMD_SHIFT - PAGE_SHIFT); |
731 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | 749 | end_pfn = (end >> PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT); |
732 | page_size_mask & (1<<PG_LEVEL_2M)); | 750 | if (start_pfn < end_pfn) { |
751 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | ||
752 | page_size_mask & (1<<PG_LEVEL_2M)); | ||
753 | pos = end_pfn << PAGE_SHIFT; | ||
754 | } | ||
733 | 755 | ||
734 | /* tail is not big page (2M) alignment */ | 756 | /* tail is not big page (2M) alignment */ |
735 | start_pfn = end_pfn; | 757 | start_pfn = pos>>PAGE_SHIFT; |
736 | end_pfn = end>>PAGE_SHIFT; | 758 | end_pfn = end>>PAGE_SHIFT; |
737 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | 759 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); |
738 | 760 | ||
@@ -831,12 +853,12 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
831 | unsigned long nr_pages = size >> PAGE_SHIFT; | 853 | unsigned long nr_pages = size >> PAGE_SHIFT; |
832 | int ret; | 854 | int ret; |
833 | 855 | ||
834 | last_mapped_pfn = init_memory_mapping(start, start + size-1); | 856 | last_mapped_pfn = init_memory_mapping(start, start + size); |
835 | if (last_mapped_pfn > max_pfn_mapped) | 857 | if (last_mapped_pfn > max_pfn_mapped) |
836 | max_pfn_mapped = last_mapped_pfn; | 858 | max_pfn_mapped = last_mapped_pfn; |
837 | 859 | ||
838 | ret = __add_pages(zone, start_pfn, nr_pages); | 860 | ret = __add_pages(zone, start_pfn, nr_pages); |
839 | WARN_ON(1); | 861 | WARN_ON_ONCE(ret); |
840 | 862 | ||
841 | return ret; | 863 | return ret; |
842 | } | 864 | } |
@@ -878,6 +900,7 @@ static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, | |||
878 | void __init mem_init(void) | 900 | void __init mem_init(void) |
879 | { | 901 | { |
880 | long codesize, reservedpages, datasize, initsize; | 902 | long codesize, reservedpages, datasize, initsize; |
903 | unsigned long absent_pages; | ||
881 | 904 | ||
882 | start_periodic_check_for_corruption(); | 905 | start_periodic_check_for_corruption(); |
883 | 906 | ||
@@ -893,8 +916,9 @@ void __init mem_init(void) | |||
893 | #else | 916 | #else |
894 | totalram_pages = free_all_bootmem(); | 917 | totalram_pages = free_all_bootmem(); |
895 | #endif | 918 | #endif |
896 | reservedpages = max_pfn - totalram_pages - | 919 | |
897 | absent_pages_in_range(0, max_pfn); | 920 | absent_pages = absent_pages_in_range(0, max_pfn); |
921 | reservedpages = max_pfn - totalram_pages - absent_pages; | ||
898 | after_bootmem = 1; | 922 | after_bootmem = 1; |
899 | 923 | ||
900 | codesize = (unsigned long) &_etext - (unsigned long) &_text; | 924 | codesize = (unsigned long) &_etext - (unsigned long) &_text; |
@@ -911,10 +935,11 @@ void __init mem_init(void) | |||
911 | VSYSCALL_END - VSYSCALL_START); | 935 | VSYSCALL_END - VSYSCALL_START); |
912 | 936 | ||
913 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " | 937 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " |
914 | "%ldk reserved, %ldk data, %ldk init)\n", | 938 | "%ldk absent, %ldk reserved, %ldk data, %ldk init)\n", |
915 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), | 939 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), |
916 | max_pfn << (PAGE_SHIFT-10), | 940 | max_pfn << (PAGE_SHIFT-10), |
917 | codesize >> 10, | 941 | codesize >> 10, |
942 | absent_pages << (PAGE_SHIFT-10), | ||
918 | reservedpages << (PAGE_SHIFT-10), | 943 | reservedpages << (PAGE_SHIFT-10), |
919 | datasize >> 10, | 944 | datasize >> 10, |
920 | initsize >> 10); | 945 | initsize >> 10); |
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c new file mode 100644 index 000000000000..d0151d8ce452 --- /dev/null +++ b/arch/x86/mm/iomap_32.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright © 2008 Ingo Molnar | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
17 | */ | ||
18 | |||
19 | #include <asm/iomap.h> | ||
20 | #include <linux/module.h> | ||
21 | |||
22 | /* Map 'pfn' using fixed map 'type' and protections 'prot' | ||
23 | */ | ||
24 | void * | ||
25 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) | ||
26 | { | ||
27 | enum fixed_addresses idx; | ||
28 | unsigned long vaddr; | ||
29 | |||
30 | pagefault_disable(); | ||
31 | |||
32 | idx = type + KM_TYPE_NR*smp_processor_id(); | ||
33 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | ||
34 | set_pte(kmap_pte-idx, pfn_pte(pfn, prot)); | ||
35 | arch_flush_lazy_mmu_mode(); | ||
36 | |||
37 | return (void*) vaddr; | ||
38 | } | ||
39 | EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn); | ||
40 | |||
41 | void | ||
42 | iounmap_atomic(void *kvaddr, enum km_type type) | ||
43 | { | ||
44 | unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; | ||
45 | enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); | ||
46 | |||
47 | /* | ||
48 | * Force other mappings to Oops if they'll try to access this pte | ||
49 | * without first remap it. Keeping stale mappings around is a bad idea | ||
50 | * also, in case the page changes cacheability attributes or becomes | ||
51 | * a protected page in a hypervisor. | ||
52 | */ | ||
53 | if (vaddr == __fix_to_virt(FIX_KMAP_BEGIN+idx)) | ||
54 | kpte_clear_flush(kmap_pte-idx, vaddr); | ||
55 | |||
56 | arch_flush_lazy_mmu_mode(); | ||
57 | pagefault_enable(); | ||
58 | } | ||
59 | EXPORT_SYMBOL_GPL(iounmap_atomic); | ||
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index ae71e11eb3e5..d4c4307ff3e0 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -387,7 +387,7 @@ static void __iomem *ioremap_default(resource_size_t phys_addr, | |||
387 | unsigned long size) | 387 | unsigned long size) |
388 | { | 388 | { |
389 | unsigned long flags; | 389 | unsigned long flags; |
390 | void *ret; | 390 | void __iomem *ret; |
391 | int err; | 391 | int err; |
392 | 392 | ||
393 | /* | 393 | /* |
@@ -399,11 +399,11 @@ static void __iomem *ioremap_default(resource_size_t phys_addr, | |||
399 | if (err < 0) | 399 | if (err < 0) |
400 | return NULL; | 400 | return NULL; |
401 | 401 | ||
402 | ret = (void *) __ioremap_caller(phys_addr, size, flags, | 402 | ret = __ioremap_caller(phys_addr, size, flags, |
403 | __builtin_return_address(0)); | 403 | __builtin_return_address(0)); |
404 | 404 | ||
405 | free_memtype(phys_addr, phys_addr + size); | 405 | free_memtype(phys_addr, phys_addr + size); |
406 | return (void __iomem *)ret; | 406 | return ret; |
407 | } | 407 | } |
408 | 408 | ||
409 | void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, | 409 | void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, |
@@ -622,7 +622,7 @@ static inline void __init early_clear_fixmap(enum fixed_addresses idx) | |||
622 | __early_set_fixmap(idx, 0, __pgprot(0)); | 622 | __early_set_fixmap(idx, 0, __pgprot(0)); |
623 | } | 623 | } |
624 | 624 | ||
625 | static void *prev_map[FIX_BTMAPS_SLOTS] __initdata; | 625 | static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata; |
626 | static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata; | 626 | static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata; |
627 | static int __init check_early_ioremap_leak(void) | 627 | static int __init check_early_ioremap_leak(void) |
628 | { | 628 | { |
@@ -645,7 +645,7 @@ static int __init check_early_ioremap_leak(void) | |||
645 | } | 645 | } |
646 | late_initcall(check_early_ioremap_leak); | 646 | late_initcall(check_early_ioremap_leak); |
647 | 647 | ||
648 | static void __init *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) | 648 | static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) |
649 | { | 649 | { |
650 | unsigned long offset, last_addr; | 650 | unsigned long offset, last_addr; |
651 | unsigned int nrpages; | 651 | unsigned int nrpages; |
@@ -713,23 +713,23 @@ static void __init *__early_ioremap(unsigned long phys_addr, unsigned long size, | |||
713 | if (early_ioremap_debug) | 713 | if (early_ioremap_debug) |
714 | printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0)); | 714 | printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0)); |
715 | 715 | ||
716 | prev_map[slot] = (void *) (offset + fix_to_virt(idx0)); | 716 | prev_map[slot] = (void __iomem *)(offset + fix_to_virt(idx0)); |
717 | return prev_map[slot]; | 717 | return prev_map[slot]; |
718 | } | 718 | } |
719 | 719 | ||
720 | /* Remap an IO device */ | 720 | /* Remap an IO device */ |
721 | void __init *early_ioremap(unsigned long phys_addr, unsigned long size) | 721 | void __init __iomem *early_ioremap(unsigned long phys_addr, unsigned long size) |
722 | { | 722 | { |
723 | return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO); | 723 | return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO); |
724 | } | 724 | } |
725 | 725 | ||
726 | /* Remap memory */ | 726 | /* Remap memory */ |
727 | void __init *early_memremap(unsigned long phys_addr, unsigned long size) | 727 | void __init __iomem *early_memremap(unsigned long phys_addr, unsigned long size) |
728 | { | 728 | { |
729 | return __early_ioremap(phys_addr, size, PAGE_KERNEL); | 729 | return __early_ioremap(phys_addr, size, PAGE_KERNEL); |
730 | } | 730 | } |
731 | 731 | ||
732 | void __init early_iounmap(void *addr, unsigned long size) | 732 | void __init early_iounmap(void __iomem *addr, unsigned long size) |
733 | { | 733 | { |
734 | unsigned long virt_addr; | 734 | unsigned long virt_addr; |
735 | unsigned long offset; | 735 | unsigned long offset; |
@@ -779,7 +779,7 @@ void __init early_iounmap(void *addr, unsigned long size) | |||
779 | --idx; | 779 | --idx; |
780 | --nrpages; | 780 | --nrpages; |
781 | } | 781 | } |
782 | prev_map[slot] = 0; | 782 | prev_map[slot] = NULL; |
783 | } | 783 | } |
784 | 784 | ||
785 | void __this_fixmap_does_not_exist(void) | 785 | void __this_fixmap_does_not_exist(void) |
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c index 847c164725f4..8518c678d83f 100644 --- a/arch/x86/mm/numa_32.c +++ b/arch/x86/mm/numa_32.c | |||
@@ -222,6 +222,41 @@ static void __init remap_numa_kva(void) | |||
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | #ifdef CONFIG_HIBERNATION | ||
226 | /** | ||
227 | * resume_map_numa_kva - add KVA mapping to the temporary page tables created | ||
228 | * during resume from hibernation | ||
229 | * @pgd_base - temporary resume page directory | ||
230 | */ | ||
231 | void resume_map_numa_kva(pgd_t *pgd_base) | ||
232 | { | ||
233 | int node; | ||
234 | |||
235 | for_each_online_node(node) { | ||
236 | unsigned long start_va, start_pfn, size, pfn; | ||
237 | |||
238 | start_va = (unsigned long)node_remap_start_vaddr[node]; | ||
239 | start_pfn = node_remap_start_pfn[node]; | ||
240 | size = node_remap_size[node]; | ||
241 | |||
242 | printk(KERN_DEBUG "%s: node %d\n", __FUNCTION__, node); | ||
243 | |||
244 | for (pfn = 0; pfn < size; pfn += PTRS_PER_PTE) { | ||
245 | unsigned long vaddr = start_va + (pfn << PAGE_SHIFT); | ||
246 | pgd_t *pgd = pgd_base + pgd_index(vaddr); | ||
247 | pud_t *pud = pud_offset(pgd, vaddr); | ||
248 | pmd_t *pmd = pmd_offset(pud, vaddr); | ||
249 | |||
250 | set_pmd(pmd, pfn_pmd(start_pfn + pfn, | ||
251 | PAGE_KERNEL_LARGE_EXEC)); | ||
252 | |||
253 | printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n", | ||
254 | __FUNCTION__, vaddr, start_pfn + pfn); | ||
255 | } | ||
256 | } | ||
257 | } | ||
258 | #endif | ||
259 | |||
225 | static unsigned long calculate_numa_remap_pages(void) | 260 | static unsigned long calculate_numa_remap_pages(void) |
226 | { | 261 | { |
227 | int nid; | 262 | int nid; |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index f1dc1b75d166..e89d24815f26 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -67,18 +67,18 @@ static void split_page_count(int level) | |||
67 | 67 | ||
68 | void arch_report_meminfo(struct seq_file *m) | 68 | void arch_report_meminfo(struct seq_file *m) |
69 | { | 69 | { |
70 | seq_printf(m, "DirectMap4k: %8lu kB\n", | 70 | seq_printf(m, "DirectMap4k: %8lu kB\n", |
71 | direct_pages_count[PG_LEVEL_4K] << 2); | 71 | direct_pages_count[PG_LEVEL_4K] << 2); |
72 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) | 72 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) |
73 | seq_printf(m, "DirectMap2M: %8lu kB\n", | 73 | seq_printf(m, "DirectMap2M: %8lu kB\n", |
74 | direct_pages_count[PG_LEVEL_2M] << 11); | 74 | direct_pages_count[PG_LEVEL_2M] << 11); |
75 | #else | 75 | #else |
76 | seq_printf(m, "DirectMap4M: %8lu kB\n", | 76 | seq_printf(m, "DirectMap4M: %8lu kB\n", |
77 | direct_pages_count[PG_LEVEL_2M] << 12); | 77 | direct_pages_count[PG_LEVEL_2M] << 12); |
78 | #endif | 78 | #endif |
79 | #ifdef CONFIG_X86_64 | 79 | #ifdef CONFIG_X86_64 |
80 | if (direct_gbpages) | 80 | if (direct_gbpages) |
81 | seq_printf(m, "DirectMap1G: %8lu kB\n", | 81 | seq_printf(m, "DirectMap1G: %8lu kB\n", |
82 | direct_pages_count[PG_LEVEL_1G] << 20); | 82 | direct_pages_count[PG_LEVEL_1G] << 20); |
83 | #endif | 83 | #endif |
84 | } | 84 | } |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 738fd0f24958..eb1bf000d12e 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -481,12 +481,16 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) | |||
481 | return 1; | 481 | return 1; |
482 | } | 482 | } |
483 | #else | 483 | #else |
484 | /* This check is needed to avoid cache aliasing when PAT is enabled */ | ||
484 | static inline int range_is_allowed(unsigned long pfn, unsigned long size) | 485 | static inline int range_is_allowed(unsigned long pfn, unsigned long size) |
485 | { | 486 | { |
486 | u64 from = ((u64)pfn) << PAGE_SHIFT; | 487 | u64 from = ((u64)pfn) << PAGE_SHIFT; |
487 | u64 to = from + size; | 488 | u64 to = from + size; |
488 | u64 cursor = from; | 489 | u64 cursor = from; |
489 | 490 | ||
491 | if (!pat_enabled) | ||
492 | return 1; | ||
493 | |||
490 | while (cursor < to) { | 494 | while (cursor < to) { |
491 | if (!devmem_is_allowed(pfn)) { | 495 | if (!devmem_is_allowed(pfn)) { |
492 | printk(KERN_INFO | 496 | printk(KERN_INFO |
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 022cd41ea9b4..202864ad49a7 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -401,14 +401,13 @@ static int __init ppro_init(char **cpu_type) | |||
401 | *cpu_type = "i386/pii"; | 401 | *cpu_type = "i386/pii"; |
402 | break; | 402 | break; |
403 | case 6 ... 8: | 403 | case 6 ... 8: |
404 | case 10 ... 11: | ||
404 | *cpu_type = "i386/piii"; | 405 | *cpu_type = "i386/piii"; |
405 | break; | 406 | break; |
406 | case 9: | 407 | case 9: |
408 | case 13: | ||
407 | *cpu_type = "i386/p6_mobile"; | 409 | *cpu_type = "i386/p6_mobile"; |
408 | break; | 410 | break; |
409 | case 10 ... 13: | ||
410 | *cpu_type = "i386/p6"; | ||
411 | break; | ||
412 | case 14: | 411 | case 14: |
413 | *cpu_type = "i386/core"; | 412 | *cpu_type = "i386/core"; |
414 | break; | 413 | break; |
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index 0620d6d45f7d..e9f80c744cf3 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
@@ -27,8 +27,7 @@ static int num_counters = 2; | |||
27 | static int counter_width = 32; | 27 | static int counter_width = 32; |
28 | 28 | ||
29 | #define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) | 29 | #define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) |
30 | #define CTR_READ(l, h, msrs, c) do {rdmsr(msrs->counters[(c)].addr, (l), (h)); } while (0) | 30 | #define CTR_OVERFLOWED(n) (!((n) & (1ULL<<(counter_width-1)))) |
31 | #define CTR_OVERFLOWED(n) (!((n) & (1U<<(counter_width-1)))) | ||
32 | 31 | ||
33 | #define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) | 32 | #define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) |
34 | #define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls[(c)].addr), (l), (h)); } while (0) | 33 | #define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls[(c)].addr), (l), (h)); } while (0) |
@@ -70,7 +69,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
70 | int i; | 69 | int i; |
71 | 70 | ||
72 | if (!reset_value) { | 71 | if (!reset_value) { |
73 | reset_value = kmalloc(sizeof(unsigned) * num_counters, | 72 | reset_value = kmalloc(sizeof(reset_value[0]) * num_counters, |
74 | GFP_ATOMIC); | 73 | GFP_ATOMIC); |
75 | if (!reset_value) | 74 | if (!reset_value) |
76 | return; | 75 | return; |
@@ -124,14 +123,14 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
124 | static int ppro_check_ctrs(struct pt_regs * const regs, | 123 | static int ppro_check_ctrs(struct pt_regs * const regs, |
125 | struct op_msrs const * const msrs) | 124 | struct op_msrs const * const msrs) |
126 | { | 125 | { |
127 | unsigned int low, high; | 126 | u64 val; |
128 | int i; | 127 | int i; |
129 | 128 | ||
130 | for (i = 0 ; i < num_counters; ++i) { | 129 | for (i = 0 ; i < num_counters; ++i) { |
131 | if (!reset_value[i]) | 130 | if (!reset_value[i]) |
132 | continue; | 131 | continue; |
133 | CTR_READ(low, high, msrs, i); | 132 | rdmsrl(msrs->counters[i].addr, val); |
134 | if (CTR_OVERFLOWED(low)) { | 133 | if (CTR_OVERFLOWED(val)) { |
135 | oprofile_add_sample(regs, i); | 134 | oprofile_add_sample(regs, i); |
136 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); | 135 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); |
137 | } | 136 | } |
@@ -157,6 +156,8 @@ static void ppro_start(struct op_msrs const * const msrs) | |||
157 | unsigned int low, high; | 156 | unsigned int low, high; |
158 | int i; | 157 | int i; |
159 | 158 | ||
159 | if (!reset_value) | ||
160 | return; | ||
160 | for (i = 0; i < num_counters; ++i) { | 161 | for (i = 0; i < num_counters; ++i) { |
161 | if (reset_value[i]) { | 162 | if (reset_value[i]) { |
162 | CTRL_READ(low, high, msrs, i); | 163 | CTRL_READ(low, high, msrs, i); |
@@ -172,6 +173,8 @@ static void ppro_stop(struct op_msrs const * const msrs) | |||
172 | unsigned int low, high; | 173 | unsigned int low, high; |
173 | int i; | 174 | int i; |
174 | 175 | ||
176 | if (!reset_value) | ||
177 | return; | ||
175 | for (i = 0; i < num_counters; ++i) { | 178 | for (i = 0; i < num_counters; ++i) { |
176 | if (!reset_value[i]) | 179 | if (!reset_value[i]) |
177 | continue; | 180 | continue; |
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 3c27a809393b..2051dc96b8e9 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c | |||
@@ -496,21 +496,24 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015, | |||
496 | pci_siemens_interrupt_controller); | 496 | pci_siemens_interrupt_controller); |
497 | 497 | ||
498 | /* | 498 | /* |
499 | * Regular PCI devices have 256 bytes, but AMD Family 10h Opteron ext config | 499 | * Regular PCI devices have 256 bytes, but AMD Family 10h/11h CPUs have |
500 | * have 4096 bytes. Even if the device is capable, that doesn't mean we can | 500 | * 4096 bytes configuration space for each function of their processor |
501 | * access it. Maybe we don't have a way to generate extended config space | 501 | * configuration space. |
502 | * accesses. So check it | ||
503 | */ | 502 | */ |
504 | static void fam10h_pci_cfg_space_size(struct pci_dev *dev) | 503 | static void amd_cpu_pci_cfg_space_size(struct pci_dev *dev) |
505 | { | 504 | { |
506 | dev->cfg_size = pci_cfg_space_size_ext(dev); | 505 | dev->cfg_size = pci_cfg_space_size_ext(dev); |
507 | } | 506 | } |
508 | 507 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, amd_cpu_pci_cfg_space_size); | |
509 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, fam10h_pci_cfg_space_size); | 508 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, amd_cpu_pci_cfg_space_size); |
510 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, fam10h_pci_cfg_space_size); | 509 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, amd_cpu_pci_cfg_space_size); |
511 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, fam10h_pci_cfg_space_size); | 510 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, amd_cpu_pci_cfg_space_size); |
512 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, fam10h_pci_cfg_space_size); | 511 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, amd_cpu_pci_cfg_space_size); |
513 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, fam10h_pci_cfg_space_size); | 512 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1300, amd_cpu_pci_cfg_space_size); |
513 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1301, amd_cpu_pci_cfg_space_size); | ||
514 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1302, amd_cpu_pci_cfg_space_size); | ||
515 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1303, amd_cpu_pci_cfg_space_size); | ||
516 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1304, amd_cpu_pci_cfg_space_size); | ||
514 | 517 | ||
515 | /* | 518 | /* |
516 | * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from | 519 | * SB600: Disable BAR1 on device 14.0 to avoid HPET resources from |
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c index f2b6e3f11bfc..81197c62d5b3 100644 --- a/arch/x86/power/hibernate_32.c +++ b/arch/x86/power/hibernate_32.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/system.h> | 12 | #include <asm/system.h> |
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | #include <asm/pgtable.h> | 14 | #include <asm/pgtable.h> |
15 | #include <asm/mmzone.h> | ||
15 | 16 | ||
16 | /* Defined in hibernate_asm_32.S */ | 17 | /* Defined in hibernate_asm_32.S */ |
17 | extern int restore_image(void); | 18 | extern int restore_image(void); |
@@ -127,6 +128,9 @@ static int resume_physical_mapping_init(pgd_t *pgd_base) | |||
127 | } | 128 | } |
128 | } | 129 | } |
129 | } | 130 | } |
131 | |||
132 | resume_map_numa_kva(pgd_base); | ||
133 | |||
130 | return 0; | 134 | return 0; |
131 | } | 135 | } |
132 | 136 | ||
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile index 313947940a1a..6dcefba7836f 100644 --- a/arch/x86/xen/Makefile +++ b/arch/x86/xen/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | ifdef CONFIG_FTRACE | 1 | ifdef CONFIG_FUNCTION_TRACER |
2 | # Do not profile debug and lowlevel utilities | 2 | # Do not profile debug and lowlevel utilities |
3 | CFLAGS_REMOVE_spinlock.o = -pg | 3 | CFLAGS_REMOVE_spinlock.o = -pg |
4 | CFLAGS_REMOVE_time.o = -pg | 4 | CFLAGS_REMOVE_time.o = -pg |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index b61534c7a4c4..5e4686d70f62 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -863,15 +863,16 @@ static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned l | |||
863 | if (PagePinned(virt_to_page(mm->pgd))) { | 863 | if (PagePinned(virt_to_page(mm->pgd))) { |
864 | SetPagePinned(page); | 864 | SetPagePinned(page); |
865 | 865 | ||
866 | vm_unmap_aliases(); | ||
866 | if (!PageHighMem(page)) { | 867 | if (!PageHighMem(page)) { |
867 | make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn))); | 868 | make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn))); |
868 | if (level == PT_PTE && USE_SPLIT_PTLOCKS) | 869 | if (level == PT_PTE && USE_SPLIT_PTLOCKS) |
869 | pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn); | 870 | pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn); |
870 | } else | 871 | } else { |
871 | /* make sure there are no stray mappings of | 872 | /* make sure there are no stray mappings of |
872 | this page */ | 873 | this page */ |
873 | kmap_flush_unused(); | 874 | kmap_flush_unused(); |
874 | vm_unmap_aliases(); | 875 | } |
875 | } | 876 | } |
876 | } | 877 | } |
877 | 878 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index d4d52f5a1cf7..636ef4caa52d 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -246,11 +246,21 @@ xmaddr_t arbitrary_virt_to_machine(void *vaddr) | |||
246 | { | 246 | { |
247 | unsigned long address = (unsigned long)vaddr; | 247 | unsigned long address = (unsigned long)vaddr; |
248 | unsigned int level; | 248 | unsigned int level; |
249 | pte_t *pte = lookup_address(address, &level); | 249 | pte_t *pte; |
250 | unsigned offset = address & ~PAGE_MASK; | 250 | unsigned offset; |
251 | 251 | ||
252 | BUG_ON(pte == NULL); | 252 | /* |
253 | * if the PFN is in the linear mapped vaddr range, we can just use | ||
254 | * the (quick) virt_to_machine() p2m lookup | ||
255 | */ | ||
256 | if (virt_addr_valid(vaddr)) | ||
257 | return virt_to_machine(vaddr); | ||
253 | 258 | ||
259 | /* otherwise we have to do a (slower) full page-table walk */ | ||
260 | |||
261 | pte = lookup_address(address, &level); | ||
262 | BUG_ON(pte == NULL); | ||
263 | offset = address & ~PAGE_MASK; | ||
254 | return XMADDR(((phys_addr_t)pte_mfn(*pte) << PAGE_SHIFT) + offset); | 264 | return XMADDR(((phys_addr_t)pte_mfn(*pte) << PAGE_SHIFT) + offset); |
255 | } | 265 | } |
256 | 266 | ||
@@ -410,7 +420,7 @@ void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr, | |||
410 | 420 | ||
411 | xen_mc_batch(); | 421 | xen_mc_batch(); |
412 | 422 | ||
413 | u.ptr = virt_to_machine(ptep).maddr | MMU_PT_UPDATE_PRESERVE_AD; | 423 | u.ptr = arbitrary_virt_to_machine(ptep).maddr | MMU_PT_UPDATE_PRESERVE_AD; |
414 | u.val = pte_val_ma(pte); | 424 | u.val = pte_val_ma(pte); |
415 | xen_extend_mmu_update(&u); | 425 | xen_extend_mmu_update(&u); |
416 | 426 | ||
@@ -651,12 +661,11 @@ void xen_set_pgd(pgd_t *ptr, pgd_t val) | |||
651 | * For 64-bit, we must skip the Xen hole in the middle of the address | 661 | * For 64-bit, we must skip the Xen hole in the middle of the address |
652 | * space, just after the big x86-64 virtual hole. | 662 | * space, just after the big x86-64 virtual hole. |
653 | */ | 663 | */ |
654 | static int xen_pgd_walk(struct mm_struct *mm, | 664 | static int __xen_pgd_walk(struct mm_struct *mm, pgd_t *pgd, |
655 | int (*func)(struct mm_struct *mm, struct page *, | 665 | int (*func)(struct mm_struct *mm, struct page *, |
656 | enum pt_level), | 666 | enum pt_level), |
657 | unsigned long limit) | 667 | unsigned long limit) |
658 | { | 668 | { |
659 | pgd_t *pgd = mm->pgd; | ||
660 | int flush = 0; | 669 | int flush = 0; |
661 | unsigned hole_low, hole_high; | 670 | unsigned hole_low, hole_high; |
662 | unsigned pgdidx_limit, pudidx_limit, pmdidx_limit; | 671 | unsigned pgdidx_limit, pudidx_limit, pmdidx_limit; |
@@ -743,6 +752,14 @@ out: | |||
743 | return flush; | 752 | return flush; |
744 | } | 753 | } |
745 | 754 | ||
755 | static int xen_pgd_walk(struct mm_struct *mm, | ||
756 | int (*func)(struct mm_struct *mm, struct page *, | ||
757 | enum pt_level), | ||
758 | unsigned long limit) | ||
759 | { | ||
760 | return __xen_pgd_walk(mm, mm->pgd, func, limit); | ||
761 | } | ||
762 | |||
746 | /* If we're using split pte locks, then take the page's lock and | 763 | /* If we're using split pte locks, then take the page's lock and |
747 | return a pointer to it. Otherwise return NULL. */ | 764 | return a pointer to it. Otherwise return NULL. */ |
748 | static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm) | 765 | static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm) |
@@ -840,13 +857,16 @@ static int xen_pin_page(struct mm_struct *mm, struct page *page, | |||
840 | read-only, and can be pinned. */ | 857 | read-only, and can be pinned. */ |
841 | static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) | 858 | static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) |
842 | { | 859 | { |
860 | vm_unmap_aliases(); | ||
861 | |||
843 | xen_mc_batch(); | 862 | xen_mc_batch(); |
844 | 863 | ||
845 | if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { | 864 | if (__xen_pgd_walk(mm, pgd, xen_pin_page, USER_LIMIT)) { |
846 | /* re-enable interrupts for kmap_flush_unused */ | 865 | /* re-enable interrupts for flushing */ |
847 | xen_mc_issue(0); | 866 | xen_mc_issue(0); |
867 | |||
848 | kmap_flush_unused(); | 868 | kmap_flush_unused(); |
849 | vm_unmap_aliases(); | 869 | |
850 | xen_mc_batch(); | 870 | xen_mc_batch(); |
851 | } | 871 | } |
852 | 872 | ||
@@ -864,7 +884,7 @@ static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) | |||
864 | #else /* CONFIG_X86_32 */ | 884 | #else /* CONFIG_X86_32 */ |
865 | #ifdef CONFIG_X86_PAE | 885 | #ifdef CONFIG_X86_PAE |
866 | /* Need to make sure unshared kernel PMD is pinnable */ | 886 | /* Need to make sure unshared kernel PMD is pinnable */ |
867 | xen_pin_page(mm, virt_to_page(pgd_page(pgd[pgd_index(TASK_SIZE)])), | 887 | xen_pin_page(mm, pgd_page(pgd[pgd_index(TASK_SIZE)]), |
868 | PT_PMD); | 888 | PT_PMD); |
869 | #endif | 889 | #endif |
870 | xen_do_pin(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(pgd))); | 890 | xen_do_pin(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(pgd))); |
@@ -981,11 +1001,11 @@ static void __xen_pgd_unpin(struct mm_struct *mm, pgd_t *pgd) | |||
981 | 1001 | ||
982 | #ifdef CONFIG_X86_PAE | 1002 | #ifdef CONFIG_X86_PAE |
983 | /* Need to make sure unshared kernel PMD is unpinned */ | 1003 | /* Need to make sure unshared kernel PMD is unpinned */ |
984 | xen_unpin_page(mm, virt_to_page(pgd_page(pgd[pgd_index(TASK_SIZE)])), | 1004 | xen_unpin_page(mm, pgd_page(pgd[pgd_index(TASK_SIZE)]), |
985 | PT_PMD); | 1005 | PT_PMD); |
986 | #endif | 1006 | #endif |
987 | 1007 | ||
988 | xen_pgd_walk(mm, xen_unpin_page, USER_LIMIT); | 1008 | __xen_pgd_walk(mm, pgd, xen_unpin_page, USER_LIMIT); |
989 | 1009 | ||
990 | xen_mc_issue(0); | 1010 | xen_mc_issue(0); |
991 | } | 1011 | } |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index d77da613b1d2..acd9b6705e02 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -362,7 +362,7 @@ static void xen_cpu_die(unsigned int cpu) | |||
362 | alternatives_smp_switch(0); | 362 | alternatives_smp_switch(0); |
363 | } | 363 | } |
364 | 364 | ||
365 | static void xen_play_dead(void) | 365 | static void __cpuinit xen_play_dead(void) /* used only with CPU_HOTPLUG */ |
366 | { | 366 | { |
367 | play_dead_common(); | 367 | play_dead_common(); |
368 | HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL); | 368 | HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL); |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index d7422dc2a55c..9e1afae8461f 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -49,7 +49,7 @@ bool xen_vcpu_stolen(int vcpu); | |||
49 | 49 | ||
50 | void xen_mark_init_mm_pinned(void); | 50 | void xen_mark_init_mm_pinned(void); |
51 | 51 | ||
52 | void __init xen_setup_vcpu_info_placement(void); | 52 | void xen_setup_vcpu_info_placement(void); |
53 | 53 | ||
54 | #ifdef CONFIG_SMP | 54 | #ifdef CONFIG_SMP |
55 | void xen_smp_init(void); | 55 | void xen_smp_init(void); |