diff options
Diffstat (limited to 'arch/x86/include/asm')
26 files changed, 157 insertions, 94 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 4ef949c1972e..394d177d721b 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -379,6 +379,7 @@ static inline u32 safe_apic_wait_icr_idle(void) | |||
379 | 379 | ||
380 | static inline void ack_APIC_irq(void) | 380 | static inline void ack_APIC_irq(void) |
381 | { | 381 | { |
382 | #ifdef CONFIG_X86_LOCAL_APIC | ||
382 | /* | 383 | /* |
383 | * ack_APIC_irq() actually gets compiled as a single instruction | 384 | * ack_APIC_irq() actually gets compiled as a single instruction |
384 | * ... yummie. | 385 | * ... yummie. |
@@ -386,6 +387,7 @@ static inline void ack_APIC_irq(void) | |||
386 | 387 | ||
387 | /* Docs say use 0 for future compatibility */ | 388 | /* Docs say use 0 for future compatibility */ |
388 | apic_write(APIC_EOI, 0); | 389 | apic_write(APIC_EOI, 0); |
390 | #endif | ||
389 | } | 391 | } |
390 | 392 | ||
391 | static inline unsigned default_get_apic_id(unsigned long x) | 393 | static inline unsigned default_get_apic_id(unsigned long x) |
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h index 63134e31e8b9..bc9514fb3b13 100644 --- a/arch/x86/include/asm/apicdef.h +++ b/arch/x86/include/asm/apicdef.h | |||
@@ -53,6 +53,7 @@ | |||
53 | #define APIC_ESR_SENDILL 0x00020 | 53 | #define APIC_ESR_SENDILL 0x00020 |
54 | #define APIC_ESR_RECVILL 0x00040 | 54 | #define APIC_ESR_RECVILL 0x00040 |
55 | #define APIC_ESR_ILLREGA 0x00080 | 55 | #define APIC_ESR_ILLREGA 0x00080 |
56 | #define APIC_LVTCMCI 0x2f0 | ||
56 | #define APIC_ICR 0x300 | 57 | #define APIC_ICR 0x300 |
57 | #define APIC_DEST_SELF 0x40000 | 58 | #define APIC_DEST_SELF 0x40000 |
58 | #define APIC_DEST_ALLINC 0x80000 | 59 | #define APIC_DEST_ALLINC 0x80000 |
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h index 2f8466540fb5..5b301b7ff5f4 100644 --- a/arch/x86/include/asm/cacheflush.h +++ b/arch/x86/include/asm/cacheflush.h | |||
@@ -5,24 +5,43 @@ | |||
5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | 6 | ||
7 | /* Caches aren't brain-dead on the intel. */ | 7 | /* Caches aren't brain-dead on the intel. */ |
8 | #define flush_cache_all() do { } while (0) | 8 | static inline void flush_cache_all(void) { } |
9 | #define flush_cache_mm(mm) do { } while (0) | 9 | static inline void flush_cache_mm(struct mm_struct *mm) { } |
10 | #define flush_cache_dup_mm(mm) do { } while (0) | 10 | static inline void flush_cache_dup_mm(struct mm_struct *mm) { } |
11 | #define flush_cache_range(vma, start, end) do { } while (0) | 11 | static inline void flush_cache_range(struct vm_area_struct *vma, |
12 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) | 12 | unsigned long start, unsigned long end) { } |
13 | #define flush_dcache_page(page) do { } while (0) | 13 | static inline void flush_cache_page(struct vm_area_struct *vma, |
14 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 14 | unsigned long vmaddr, unsigned long pfn) { } |
15 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 15 | static inline void flush_dcache_page(struct page *page) { } |
16 | #define flush_icache_range(start, end) do { } while (0) | 16 | static inline void flush_dcache_mmap_lock(struct address_space *mapping) { } |
17 | #define flush_icache_page(vma, pg) do { } while (0) | 17 | static inline void flush_dcache_mmap_unlock(struct address_space *mapping) { } |
18 | #define flush_icache_user_range(vma, pg, adr, len) do { } while (0) | 18 | static inline void flush_icache_range(unsigned long start, |
19 | #define flush_cache_vmap(start, end) do { } while (0) | 19 | unsigned long end) { } |
20 | #define flush_cache_vunmap(start, end) do { } while (0) | 20 | static inline void flush_icache_page(struct vm_area_struct *vma, |
21 | struct page *page) { } | ||
22 | static inline void flush_icache_user_range(struct vm_area_struct *vma, | ||
23 | struct page *page, | ||
24 | unsigned long addr, | ||
25 | unsigned long len) { } | ||
26 | static inline void flush_cache_vmap(unsigned long start, unsigned long end) { } | ||
27 | static inline void flush_cache_vunmap(unsigned long start, | ||
28 | unsigned long end) { } | ||
21 | 29 | ||
22 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 30 | static inline void copy_to_user_page(struct vm_area_struct *vma, |
23 | memcpy((dst), (src), (len)) | 31 | struct page *page, unsigned long vaddr, |
24 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 32 | void *dst, const void *src, |
25 | memcpy((dst), (src), (len)) | 33 | unsigned long len) |
34 | { | ||
35 | memcpy(dst, src, len); | ||
36 | } | ||
37 | |||
38 | static inline void copy_from_user_page(struct vm_area_struct *vma, | ||
39 | struct page *page, unsigned long vaddr, | ||
40 | void *dst, const void *src, | ||
41 | unsigned long len) | ||
42 | { | ||
43 | memcpy(dst, src, len); | ||
44 | } | ||
26 | 45 | ||
27 | #define PG_non_WB PG_arch_1 | 46 | #define PG_non_WB PG_arch_1 |
28 | PAGEFLAG(NonWB, non_WB) | 47 | PAGEFLAG(NonWB, non_WB) |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index ca5ffb2856b6..edc90f23e708 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -37,8 +37,6 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
37 | 37 | ||
38 | #else /* !CONFIG_X86_32 */ | 38 | #else /* !CONFIG_X86_32 */ |
39 | 39 | ||
40 | #define MAX_EFI_IO_PAGES 100 | ||
41 | |||
42 | extern u64 efi_call0(void *fp); | 40 | extern u64 efi_call0(void *fp); |
43 | extern u64 efi_call1(void *fp, u64 arg1); | 41 | extern u64 efi_call1(void *fp, u64 arg1); |
44 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); | 42 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); |
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h index 854d538ae857..c2e6bedaf258 100644 --- a/arch/x86/include/asm/entry_arch.h +++ b/arch/x86/include/asm/entry_arch.h | |||
@@ -33,6 +33,8 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7, | |||
33 | smp_invalidate_interrupt) | 33 | smp_invalidate_interrupt) |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | BUILD_INTERRUPT(generic_interrupt, GENERIC_INTERRUPT_VECTOR) | ||
37 | |||
36 | /* | 38 | /* |
37 | * every pentium local APIC has two 'local interrupts', with a | 39 | * every pentium local APIC has two 'local interrupts', with a |
38 | * soft-definable vector attached to both interrupts, one of | 40 | * soft-definable vector attached to both interrupts, one of |
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index dca8f03da5b2..63a79c77d220 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h | |||
@@ -24,9 +24,6 @@ | |||
24 | #include <asm/kmap_types.h> | 24 | #include <asm/kmap_types.h> |
25 | #else | 25 | #else |
26 | #include <asm/vsyscall.h> | 26 | #include <asm/vsyscall.h> |
27 | #ifdef CONFIG_EFI | ||
28 | #include <asm/efi.h> | ||
29 | #endif | ||
30 | #endif | 27 | #endif |
31 | 28 | ||
32 | /* | 29 | /* |
@@ -92,13 +89,6 @@ enum fixed_addresses { | |||
92 | FIX_IO_APIC_BASE_0, | 89 | FIX_IO_APIC_BASE_0, |
93 | FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1, | 90 | FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1, |
94 | #endif | 91 | #endif |
95 | #ifdef CONFIG_X86_64 | ||
96 | #ifdef CONFIG_EFI | ||
97 | FIX_EFI_IO_MAP_LAST_PAGE, | ||
98 | FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE | ||
99 | + MAX_EFI_IO_PAGES - 1, | ||
100 | #endif | ||
101 | #endif | ||
102 | #ifdef CONFIG_X86_VISWS_APIC | 92 | #ifdef CONFIG_X86_VISWS_APIC |
103 | FIX_CO_CPU, /* Cobalt timer */ | 93 | FIX_CO_CPU, /* Cobalt timer */ |
104 | FIX_CO_APIC, /* Cobalt APIC Redirection Table */ | 94 | FIX_CO_APIC, /* Cobalt APIC Redirection Table */ |
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 176f058e7159..039db6aa8e02 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h | |||
@@ -12,6 +12,7 @@ typedef struct { | |||
12 | unsigned int apic_timer_irqs; /* arch dependent */ | 12 | unsigned int apic_timer_irqs; /* arch dependent */ |
13 | unsigned int irq_spurious_count; | 13 | unsigned int irq_spurious_count; |
14 | #endif | 14 | #endif |
15 | unsigned int generic_irqs; /* arch dependent */ | ||
15 | #ifdef CONFIG_SMP | 16 | #ifdef CONFIG_SMP |
16 | unsigned int irq_resched_count; | 17 | unsigned int irq_resched_count; |
17 | unsigned int irq_call_count; | 18 | unsigned int irq_call_count; |
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index 370e1c83bb49..b762ea49bd70 100644 --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | /* Interrupt handlers registered during init_IRQ */ | 28 | /* Interrupt handlers registered during init_IRQ */ |
29 | extern void apic_timer_interrupt(void); | 29 | extern void apic_timer_interrupt(void); |
30 | extern void generic_interrupt(void); | ||
30 | extern void error_interrupt(void); | 31 | extern void error_interrupt(void); |
31 | extern void spurious_interrupt(void); | 32 | extern void spurious_interrupt(void); |
32 | extern void thermal_interrupt(void); | 33 | extern void thermal_interrupt(void); |
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 48f0004db8c9..71c9e5183982 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
@@ -172,7 +172,13 @@ static inline void __save_init_fpu(struct task_struct *tsk) | |||
172 | 172 | ||
173 | #else /* CONFIG_X86_32 */ | 173 | #else /* CONFIG_X86_32 */ |
174 | 174 | ||
175 | extern void finit(void); | 175 | #ifdef CONFIG_MATH_EMULATION |
176 | extern void finit_task(struct task_struct *tsk); | ||
177 | #else | ||
178 | static inline void finit_task(struct task_struct *tsk) | ||
179 | { | ||
180 | } | ||
181 | #endif | ||
176 | 182 | ||
177 | static inline void tolerant_fwait(void) | 183 | static inline void tolerant_fwait(void) |
178 | { | 184 | { |
diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h new file mode 100644 index 000000000000..36fb1a6a5109 --- /dev/null +++ b/arch/x86/include/asm/init.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _ASM_X86_INIT_32_H | ||
2 | #define _ASM_X86_INIT_32_H | ||
3 | |||
4 | #ifdef CONFIG_X86_32 | ||
5 | extern void __init early_ioremap_page_table_range_init(void); | ||
6 | #endif | ||
7 | |||
8 | extern unsigned long __init | ||
9 | kernel_physical_mapping_init(unsigned long start, | ||
10 | unsigned long end, | ||
11 | unsigned long page_size_mask); | ||
12 | |||
13 | |||
14 | extern unsigned long __initdata e820_table_start; | ||
15 | extern unsigned long __meminitdata e820_table_end; | ||
16 | extern unsigned long __meminitdata e820_table_top; | ||
17 | |||
18 | #endif /* _ASM_X86_INIT_32_H */ | ||
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 683d0b4c00fc..e5383e3d2f8c 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h | |||
@@ -172,8 +172,6 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size) | |||
172 | 172 | ||
173 | extern void iounmap(volatile void __iomem *addr); | 173 | extern void iounmap(volatile void __iomem *addr); |
174 | 174 | ||
175 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
176 | |||
177 | 175 | ||
178 | #ifdef CONFIG_X86_32 | 176 | #ifdef CONFIG_X86_32 |
179 | # include "io_32.h" | 177 | # include "io_32.h" |
@@ -198,7 +196,6 @@ extern void early_ioremap_reset(void); | |||
198 | extern void __iomem *early_ioremap(unsigned long offset, unsigned long size); | 196 | extern void __iomem *early_ioremap(unsigned long offset, unsigned long size); |
199 | extern void __iomem *early_memremap(unsigned long offset, unsigned long size); | 197 | extern void __iomem *early_memremap(unsigned long offset, unsigned long size); |
200 | extern void early_iounmap(void __iomem *addr, unsigned long size); | 198 | extern void early_iounmap(void __iomem *addr, unsigned long size); |
201 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
202 | 199 | ||
203 | #define IO_SPACE_LIMIT 0xffff | 200 | #define IO_SPACE_LIMIT 0xffff |
204 | 201 | ||
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h index 107eb2196691..f38481bcd455 100644 --- a/arch/x86/include/asm/irq.h +++ b/arch/x86/include/asm/irq.h | |||
@@ -36,6 +36,7 @@ static inline int irq_canonicalize(int irq) | |||
36 | extern void fixup_irqs(void); | 36 | extern void fixup_irqs(void); |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | extern void (*generic_interrupt_extension)(void); | ||
39 | extern void init_IRQ(void); | 40 | extern void init_IRQ(void); |
40 | extern void native_init_IRQ(void); | 41 | extern void native_init_IRQ(void); |
41 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); | 42 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); |
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 8a285f356f8a..3cbd79bbb47c 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h | |||
@@ -112,6 +112,11 @@ | |||
112 | #define LOCAL_PERF_VECTOR 0xee | 112 | #define LOCAL_PERF_VECTOR 0xee |
113 | 113 | ||
114 | /* | 114 | /* |
115 | * Generic system vector for platform specific use | ||
116 | */ | ||
117 | #define GENERIC_INTERRUPT_VECTOR 0xed | ||
118 | |||
119 | /* | ||
115 | * First APIC vector available to drivers: (vectors 0x30-0xee) we | 120 | * First APIC vector available to drivers: (vectors 0x30-0xee) we |
116 | * start at 0x31(0x41) to spread out vectors evenly between priority | 121 | * start at 0x31(0x41) to spread out vectors evenly between priority |
117 | * levels. (0x80 is the syscall vector) | 122 | * levels. (0x80 is the syscall vector) |
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h index 0ceb6d19ed30..317ff1703d0b 100644 --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h | |||
@@ -9,13 +9,13 @@ | |||
9 | # define PAGES_NR 4 | 9 | # define PAGES_NR 4 |
10 | #else | 10 | #else |
11 | # define PA_CONTROL_PAGE 0 | 11 | # define PA_CONTROL_PAGE 0 |
12 | # define PA_TABLE_PAGE 1 | 12 | # define VA_CONTROL_PAGE 1 |
13 | # define PAGES_NR 2 | 13 | # define PA_TABLE_PAGE 2 |
14 | # define PA_SWAP_PAGE 3 | ||
15 | # define PAGES_NR 4 | ||
14 | #endif | 16 | #endif |
15 | 17 | ||
16 | #ifdef CONFIG_X86_32 | ||
17 | # define KEXEC_CONTROL_CODE_MAX_SIZE 2048 | 18 | # define KEXEC_CONTROL_CODE_MAX_SIZE 2048 |
18 | #endif | ||
19 | 19 | ||
20 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
21 | 21 | ||
@@ -136,10 +136,11 @@ relocate_kernel(unsigned long indirection_page, | |||
136 | unsigned int has_pae, | 136 | unsigned int has_pae, |
137 | unsigned int preserve_context); | 137 | unsigned int preserve_context); |
138 | #else | 138 | #else |
139 | NORET_TYPE void | 139 | unsigned long |
140 | relocate_kernel(unsigned long indirection_page, | 140 | relocate_kernel(unsigned long indirection_page, |
141 | unsigned long page_list, | 141 | unsigned long page_list, |
142 | unsigned long start_address) ATTRIB_NORET; | 142 | unsigned long start_address, |
143 | unsigned int preserve_context); | ||
143 | #endif | 144 | #endif |
144 | 145 | ||
145 | #define ARCH_HAS_KIMAGE_ARCH | 146 | #define ARCH_HAS_KIMAGE_ARCH |
diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h index 9320e2a8a26a..a0d70b46c27c 100644 --- a/arch/x86/include/asm/linkage.h +++ b/arch/x86/include/asm/linkage.h | |||
@@ -4,11 +4,6 @@ | |||
4 | #undef notrace | 4 | #undef notrace |
5 | #define notrace __attribute__((no_instrument_function)) | 5 | #define notrace __attribute__((no_instrument_function)) |
6 | 6 | ||
7 | #ifdef CONFIG_X86_64 | ||
8 | #define __ALIGN .p2align 4,,15 | ||
9 | #define __ALIGN_STR ".p2align 4,,15" | ||
10 | #endif | ||
11 | |||
12 | #ifdef CONFIG_X86_32 | 7 | #ifdef CONFIG_X86_32 |
13 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) | 8 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) |
14 | /* | 9 | /* |
@@ -50,16 +45,25 @@ | |||
50 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ | 45 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ |
51 | "g" (arg4), "g" (arg5), "g" (arg6)) | 46 | "g" (arg4), "g" (arg5), "g" (arg6)) |
52 | 47 | ||
53 | #endif | 48 | #endif /* CONFIG_X86_32 */ |
49 | |||
50 | #ifdef __ASSEMBLY__ | ||
54 | 51 | ||
55 | #define GLOBAL(name) \ | 52 | #define GLOBAL(name) \ |
56 | .globl name; \ | 53 | .globl name; \ |
57 | name: | 54 | name: |
58 | 55 | ||
56 | #ifdef CONFIG_X86_64 | ||
57 | #define __ALIGN .p2align 4,,15 | ||
58 | #define __ALIGN_STR ".p2align 4,,15" | ||
59 | #endif | ||
60 | |||
59 | #ifdef CONFIG_X86_ALIGNMENT_16 | 61 | #ifdef CONFIG_X86_ALIGNMENT_16 |
60 | #define __ALIGN .align 16,0x90 | 62 | #define __ALIGN .align 16,0x90 |
61 | #define __ALIGN_STR ".align 16,0x90" | 63 | #define __ALIGN_STR ".align 16,0x90" |
62 | #endif | 64 | #endif |
63 | 65 | ||
66 | #endif /* __ASSEMBLY__ */ | ||
67 | |||
64 | #endif /* _ASM_X86_LINKAGE_H */ | 68 | #endif /* _ASM_X86_LINKAGE_H */ |
65 | 69 | ||
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 32c6e17b960b..563933e06a35 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -11,6 +11,8 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ | 13 | #define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ |
14 | #define MCG_EXT_P (1ULL<<9) /* Extended registers available */ | ||
15 | #define MCG_CMCI_P (1ULL<<10) /* CMCI supported */ | ||
14 | 16 | ||
15 | #define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ | 17 | #define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ |
16 | #define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ | 18 | #define MCG_STATUS_EIPV (1UL<<1) /* ip points to correct instruction */ |
@@ -90,14 +92,29 @@ extern int mce_disabled; | |||
90 | 92 | ||
91 | #include <asm/atomic.h> | 93 | #include <asm/atomic.h> |
92 | 94 | ||
95 | void mce_setup(struct mce *m); | ||
93 | void mce_log(struct mce *m); | 96 | void mce_log(struct mce *m); |
94 | DECLARE_PER_CPU(struct sys_device, device_mce); | 97 | DECLARE_PER_CPU(struct sys_device, device_mce); |
95 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); | 98 | extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); |
96 | 99 | ||
100 | /* | ||
101 | * To support more than 128 would need to escape the predefined | ||
102 | * Linux defined extended banks first. | ||
103 | */ | ||
104 | #define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1) | ||
105 | |||
97 | #ifdef CONFIG_X86_MCE_INTEL | 106 | #ifdef CONFIG_X86_MCE_INTEL |
98 | void mce_intel_feature_init(struct cpuinfo_x86 *c); | 107 | void mce_intel_feature_init(struct cpuinfo_x86 *c); |
108 | void cmci_clear(void); | ||
109 | void cmci_reenable(void); | ||
110 | void cmci_rediscover(int dying); | ||
111 | void cmci_recheck(void); | ||
99 | #else | 112 | #else |
100 | static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } | 113 | static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } |
114 | static inline void cmci_clear(void) {} | ||
115 | static inline void cmci_reenable(void) {} | ||
116 | static inline void cmci_rediscover(int dying) {} | ||
117 | static inline void cmci_recheck(void) {} | ||
101 | #endif | 118 | #endif |
102 | 119 | ||
103 | #ifdef CONFIG_X86_MCE_AMD | 120 | #ifdef CONFIG_X86_MCE_AMD |
@@ -106,11 +123,23 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c); | |||
106 | static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } | 123 | static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } |
107 | #endif | 124 | #endif |
108 | 125 | ||
109 | void mce_log_therm_throt_event(unsigned int cpu, __u64 status); | 126 | extern int mce_available(struct cpuinfo_x86 *c); |
127 | |||
128 | void mce_log_therm_throt_event(__u64 status); | ||
110 | 129 | ||
111 | extern atomic_t mce_entry; | 130 | extern atomic_t mce_entry; |
112 | 131 | ||
113 | extern void do_machine_check(struct pt_regs *, long); | 132 | extern void do_machine_check(struct pt_regs *, long); |
133 | |||
134 | typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS); | ||
135 | DECLARE_PER_CPU(mce_banks_t, mce_poll_banks); | ||
136 | |||
137 | enum mcp_flags { | ||
138 | MCP_TIMESTAMP = (1 << 0), /* log time stamp */ | ||
139 | MCP_UC = (1 << 1), /* log uncorrected errors */ | ||
140 | }; | ||
141 | extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b); | ||
142 | |||
114 | extern int mce_notify_user(void); | 143 | extern int mce_notify_user(void); |
115 | 144 | ||
116 | #endif /* !CONFIG_X86_32 */ | 145 | #endif /* !CONFIG_X86_32 */ |
@@ -120,8 +149,8 @@ extern void mcheck_init(struct cpuinfo_x86 *c); | |||
120 | #else | 149 | #else |
121 | #define mcheck_init(c) do { } while (0) | 150 | #define mcheck_init(c) do { } while (0) |
122 | #endif | 151 | #endif |
123 | extern void stop_mce(void); | 152 | |
124 | extern void restart_mce(void); | 153 | extern void (*mce_threshold_vector)(void); |
125 | 154 | ||
126 | #endif /* __KERNEL__ */ | 155 | #endif /* __KERNEL__ */ |
127 | #endif /* _ASM_X86_MCE_H */ | 156 | #endif /* _ASM_X86_MCE_H */ |
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 105fb90a0635..ede6998bd92c 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h | |||
@@ -91,46 +91,9 @@ static inline int pfn_valid(int pfn) | |||
91 | #endif /* CONFIG_DISCONTIGMEM */ | 91 | #endif /* CONFIG_DISCONTIGMEM */ |
92 | 92 | ||
93 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 93 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
94 | 94 | /* always use node 0 for bootmem on this numa platform */ | |
95 | /* | 95 | #define bootmem_arch_preferred_node(__bdata, size, align, goal, limit) \ |
96 | * Following are macros that are specific to this numa platform. | 96 | (NODE_DATA(0)->bdata) |
97 | */ | ||
98 | #define reserve_bootmem(addr, size, flags) \ | ||
99 | reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags)) | ||
100 | #define alloc_bootmem(x) \ | ||
101 | __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | ||
102 | #define alloc_bootmem_nopanic(x) \ | ||
103 | __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), SMP_CACHE_BYTES, \ | ||
104 | __pa(MAX_DMA_ADDRESS)) | ||
105 | #define alloc_bootmem_low(x) \ | ||
106 | __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0) | ||
107 | #define alloc_bootmem_pages(x) \ | ||
108 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | ||
109 | #define alloc_bootmem_pages_nopanic(x) \ | ||
110 | __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), PAGE_SIZE, \ | ||
111 | __pa(MAX_DMA_ADDRESS)) | ||
112 | #define alloc_bootmem_low_pages(x) \ | ||
113 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) | ||
114 | #define alloc_bootmem_node(pgdat, x) \ | ||
115 | ({ \ | ||
116 | struct pglist_data __maybe_unused \ | ||
117 | *__alloc_bootmem_node__pgdat = (pgdat); \ | ||
118 | __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, \ | ||
119 | __pa(MAX_DMA_ADDRESS)); \ | ||
120 | }) | ||
121 | #define alloc_bootmem_pages_node(pgdat, x) \ | ||
122 | ({ \ | ||
123 | struct pglist_data __maybe_unused \ | ||
124 | *__alloc_bootmem_node__pgdat = (pgdat); \ | ||
125 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, \ | ||
126 | __pa(MAX_DMA_ADDRESS)); \ | ||
127 | }) | ||
128 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | ||
129 | ({ \ | ||
130 | struct pglist_data __maybe_unused \ | ||
131 | *__alloc_bootmem_node__pgdat = (pgdat); \ | ||
132 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0); \ | ||
133 | }) | ||
134 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ | 97 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ |
135 | 98 | ||
136 | #endif /* _ASM_X86_MMZONE_32_H */ | 99 | #endif /* _ASM_X86_MMZONE_32_H */ |
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 358acc59ae04..2dbd2314139e 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h | |||
@@ -77,6 +77,11 @@ | |||
77 | #define MSR_IA32_MC0_ADDR 0x00000402 | 77 | #define MSR_IA32_MC0_ADDR 0x00000402 |
78 | #define MSR_IA32_MC0_MISC 0x00000403 | 78 | #define MSR_IA32_MC0_MISC 0x00000403 |
79 | 79 | ||
80 | /* These are consecutive and not in the normal 4er MCE bank block */ | ||
81 | #define MSR_IA32_MC0_CTL2 0x00000280 | ||
82 | #define CMCI_EN (1ULL << 30) | ||
83 | #define CMCI_THRESHOLD_MASK 0xffffULL | ||
84 | |||
80 | #define MSR_P6_PERFCTR0 0x000000c1 | 85 | #define MSR_P6_PERFCTR0 0x000000c1 |
81 | #define MSR_P6_PERFCTR1 0x000000c2 | 86 | #define MSR_P6_PERFCTR1 0x000000c2 |
82 | #define MSR_P6_EVNTSEL0 0x00000186 | 87 | #define MSR_P6_EVNTSEL0 0x00000186 |
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h index 2d625da6603c..826ad37006ab 100644 --- a/arch/x86/include/asm/page_types.h +++ b/arch/x86/include/asm/page_types.h | |||
@@ -40,14 +40,8 @@ | |||
40 | 40 | ||
41 | #ifndef __ASSEMBLY__ | 41 | #ifndef __ASSEMBLY__ |
42 | 42 | ||
43 | struct pgprot; | ||
44 | |||
45 | extern int page_is_ram(unsigned long pagenr); | 43 | extern int page_is_ram(unsigned long pagenr); |
46 | extern int devmem_is_allowed(unsigned long pagenr); | 44 | extern int devmem_is_allowed(unsigned long pagenr); |
47 | extern void map_devmem(unsigned long pfn, unsigned long size, | ||
48 | struct pgprot vma_prot); | ||
49 | extern void unmap_devmem(unsigned long pfn, unsigned long size, | ||
50 | struct pgprot vma_prot); | ||
51 | 45 | ||
52 | extern unsigned long max_low_pfn_mapped; | 46 | extern unsigned long max_low_pfn_mapped; |
53 | extern unsigned long max_pfn_mapped; | 47 | extern unsigned long max_pfn_mapped; |
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h index b0e70056838e..2cd07b9422f4 100644 --- a/arch/x86/include/asm/pat.h +++ b/arch/x86/include/asm/pat.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ASM_X86_PAT_H | 2 | #define _ASM_X86_PAT_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <asm/pgtable_types.h> | ||
5 | 6 | ||
6 | #ifdef CONFIG_X86_PAT | 7 | #ifdef CONFIG_X86_PAT |
7 | extern int pat_enabled; | 8 | extern int pat_enabled; |
@@ -17,5 +18,9 @@ extern int free_memtype(u64 start, u64 end); | |||
17 | 18 | ||
18 | extern int kernel_map_sync_memtype(u64 base, unsigned long size, | 19 | extern int kernel_map_sync_memtype(u64 base, unsigned long size, |
19 | unsigned long flag); | 20 | unsigned long flag); |
21 | extern void map_devmem(unsigned long pfn, unsigned long size, | ||
22 | struct pgprot vma_prot); | ||
23 | extern void unmap_devmem(unsigned long pfn, unsigned long size, | ||
24 | struct pgprot vma_prot); | ||
20 | 25 | ||
21 | #endif /* _ASM_X86_PAT_H */ | 26 | #endif /* _ASM_X86_PAT_H */ |
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index aee103b26d01..8f1d2fbec1d4 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h | |||
@@ -43,6 +43,14 @@ | |||
43 | #else /* ...!ASSEMBLY */ | 43 | #else /* ...!ASSEMBLY */ |
44 | 44 | ||
45 | #include <linux/stringify.h> | 45 | #include <linux/stringify.h> |
46 | #include <asm/sections.h> | ||
47 | |||
48 | #define __addr_to_pcpu_ptr(addr) \ | ||
49 | (void *)((unsigned long)(addr) - (unsigned long)pcpu_base_addr \ | ||
50 | + (unsigned long)__per_cpu_start) | ||
51 | #define __pcpu_ptr_to_addr(ptr) \ | ||
52 | (void *)((unsigned long)(ptr) + (unsigned long)pcpu_base_addr \ | ||
53 | - (unsigned long)__per_cpu_start) | ||
46 | 54 | ||
47 | #ifdef CONFIG_SMP | 55 | #ifdef CONFIG_SMP |
48 | #define __percpu_arg(x) "%%"__stringify(__percpu_seg)":%P" #x | 56 | #define __percpu_arg(x) "%%"__stringify(__percpu_seg)":%P" #x |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 1c097a3a6669..d0812e155f1d 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -288,6 +288,8 @@ static inline int is_new_memtype_allowed(unsigned long flags, | |||
288 | return 1; | 288 | return 1; |
289 | } | 289 | } |
290 | 290 | ||
291 | pmd_t *populate_extra_pmd(unsigned long vaddr); | ||
292 | pte_t *populate_extra_pte(unsigned long vaddr); | ||
291 | #endif /* __ASSEMBLY__ */ | 293 | #endif /* __ASSEMBLY__ */ |
292 | 294 | ||
293 | #ifdef CONFIG_X86_32 | 295 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h index bd8df3b2fe04..2733fad45f98 100644 --- a/arch/x86/include/asm/pgtable_32_types.h +++ b/arch/x86/include/asm/pgtable_32_types.h | |||
@@ -25,6 +25,11 @@ | |||
25 | * area for the same reason. ;) | 25 | * area for the same reason. ;) |
26 | */ | 26 | */ |
27 | #define VMALLOC_OFFSET (8 * 1024 * 1024) | 27 | #define VMALLOC_OFFSET (8 * 1024 * 1024) |
28 | |||
29 | #ifndef __ASSEMBLER__ | ||
30 | extern bool __vmalloc_start_set; /* set once high_memory is set */ | ||
31 | #endif | ||
32 | |||
28 | #define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET) | 33 | #define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET) |
29 | #ifdef CONFIG_X86_PAE | 34 | #ifdef CONFIG_X86_PAE |
30 | #define LAST_PKMAP 512 | 35 | #define LAST_PKMAP 512 |
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 4d258ad76a0f..b8238dc8786d 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h | |||
@@ -273,6 +273,7 @@ typedef struct page *pgtable_t; | |||
273 | 273 | ||
274 | extern pteval_t __supported_pte_mask; | 274 | extern pteval_t __supported_pte_mask; |
275 | extern int nx_enabled; | 275 | extern int nx_enabled; |
276 | extern void set_nx(void); | ||
276 | 277 | ||
277 | #define pgprot_writecombine pgprot_writecombine | 278 | #define pgprot_writecombine pgprot_writecombine |
278 | extern pgprot_t pgprot_writecombine(pgprot_t prot); | 279 | extern pgprot_t pgprot_writecombine(pgprot_t prot); |
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 777327ef05c1..9f4dfba33b28 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -199,6 +199,10 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); | |||
199 | #define SCIR_CPU_ACTIVITY 0x02 /* not idle */ | 199 | #define SCIR_CPU_ACTIVITY 0x02 /* not idle */ |
200 | #define SCIR_CPU_HB_INTERVAL (HZ) /* once per second */ | 200 | #define SCIR_CPU_HB_INTERVAL (HZ) /* once per second */ |
201 | 201 | ||
202 | /* Loop through all installed blades */ | ||
203 | #define for_each_possible_blade(bid) \ | ||
204 | for ((bid) = 0; (bid) < uv_num_possible_blades(); (bid)++) | ||
205 | |||
202 | /* | 206 | /* |
203 | * Macros for converting between kernel virtual addresses, socket local physical | 207 | * Macros for converting between kernel virtual addresses, socket local physical |
204 | * addresses, and UV global physical addresses. | 208 | * addresses, and UV global physical addresses. |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 4bd990ee43df..1a918dde46b5 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
@@ -164,6 +164,7 @@ static inline pte_t __pte_ma(pteval_t x) | |||
164 | 164 | ||
165 | 165 | ||
166 | xmaddr_t arbitrary_virt_to_machine(void *address); | 166 | xmaddr_t arbitrary_virt_to_machine(void *address); |
167 | unsigned long arbitrary_virt_to_mfn(void *vaddr); | ||
167 | void make_lowmem_page_readonly(void *vaddr); | 168 | void make_lowmem_page_readonly(void *vaddr); |
168 | void make_lowmem_page_readwrite(void *vaddr); | 169 | void make_lowmem_page_readwrite(void *vaddr); |
169 | 170 | ||