diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-10-17 19:09:09 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-10-17 19:12:33 -0400 |
commit | 0f8f86c7bdd1c954fbe153af437a0d91a6c5721a (patch) | |
tree | 94a8d419a470a4f9852ca397bb9bbe48db92ff5c /arch/x86/include/asm | |
parent | dca2d6ac09d9ef59ff46820d4f0c94b08a671202 (diff) | |
parent | f39cdf25bf77219676ec5360980ac40b1a7e144a (diff) |
Merge commit 'perf/core' into perf/hw-breakpoint
Conflicts:
kernel/Makefile
kernel/trace/Makefile
kernel/trace/trace.h
samples/Makefile
Merge reason: We need to be uptodate with the perf events development
branch because we plan to rewrite the breakpoints API on top of
perf events.
Diffstat (limited to 'arch/x86/include/asm')
50 files changed, 475 insertions, 375 deletions
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 20d1465a2ab0..4518dc500903 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
@@ -144,7 +144,6 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate) | |||
144 | 144 | ||
145 | #else /* !CONFIG_ACPI */ | 145 | #else /* !CONFIG_ACPI */ |
146 | 146 | ||
147 | #define acpi_disabled 1 | ||
148 | #define acpi_lapic 0 | 147 | #define acpi_lapic 0 |
149 | #define acpi_ioapic 0 | 148 | #define acpi_ioapic 0 |
150 | static inline void acpi_noirq_set(void) { } | 149 | static inline void acpi_noirq_set(void) { } |
diff --git a/arch/x86/include/asm/agp.h b/arch/x86/include/asm/agp.h index 9825cd64c9b6..eec2a70d4376 100644 --- a/arch/x86/include/asm/agp.h +++ b/arch/x86/include/asm/agp.h | |||
@@ -22,10 +22,6 @@ | |||
22 | */ | 22 | */ |
23 | #define flush_agp_cache() wbinvd() | 23 | #define flush_agp_cache() wbinvd() |
24 | 24 | ||
25 | /* Convert a physical address to an address suitable for the GART. */ | ||
26 | #define phys_to_gart(x) (x) | ||
27 | #define gart_to_phys(x) (x) | ||
28 | |||
29 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ | 25 | /* GATT allocation. Returns/accepts GATT kernel virtual address. */ |
30 | #define alloc_gatt_pages(order) \ | 26 | #define alloc_gatt_pages(order) \ |
31 | ((char *)__get_free_pages(GFP_KERNEL, (order))) | 27 | ((char *)__get_free_pages(GFP_KERNEL, (order))) |
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 586b7adb8e53..474d80d3e6cc 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -66,13 +66,23 @@ static inline void default_inquire_remote_apic(int apicid) | |||
66 | } | 66 | } |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * With 82489DX we can't rely on apic feature bit | ||
70 | * retrieved via cpuid but still have to deal with | ||
71 | * such an apic chip so we assume that SMP configuration | ||
72 | * is found from MP table (64bit case uses ACPI mostly | ||
73 | * which set smp presence flag as well so we are safe | ||
74 | * to use this helper too). | ||
75 | */ | ||
76 | static inline bool apic_from_smp_config(void) | ||
77 | { | ||
78 | return smp_found_config && !disable_apic; | ||
79 | } | ||
80 | |||
81 | /* | ||
69 | * Basic functions accessing APICs. | 82 | * Basic functions accessing APICs. |
70 | */ | 83 | */ |
71 | #ifdef CONFIG_PARAVIRT | 84 | #ifdef CONFIG_PARAVIRT |
72 | #include <asm/paravirt.h> | 85 | #include <asm/paravirt.h> |
73 | #else | ||
74 | #define setup_boot_clock setup_boot_APIC_clock | ||
75 | #define setup_secondary_clock setup_secondary_APIC_clock | ||
76 | #endif | 86 | #endif |
77 | 87 | ||
78 | #ifdef CONFIG_X86_64 | 88 | #ifdef CONFIG_X86_64 |
@@ -252,6 +262,8 @@ static inline void lapic_shutdown(void) { } | |||
252 | static inline void init_apic_mappings(void) { } | 262 | static inline void init_apic_mappings(void) { } |
253 | static inline void disable_local_APIC(void) { } | 263 | static inline void disable_local_APIC(void) { } |
254 | static inline void apic_disable(void) { } | 264 | static inline void apic_disable(void) { } |
265 | # define setup_boot_APIC_clock x86_init_noop | ||
266 | # define setup_secondary_APIC_clock x86_init_noop | ||
255 | #endif /* !CONFIG_X86_LOCAL_APIC */ | 267 | #endif /* !CONFIG_X86_LOCAL_APIC */ |
256 | 268 | ||
257 | #ifdef CONFIG_X86_64 | 269 | #ifdef CONFIG_X86_64 |
@@ -300,7 +312,7 @@ struct apic { | |||
300 | int (*cpu_present_to_apicid)(int mps_cpu); | 312 | int (*cpu_present_to_apicid)(int mps_cpu); |
301 | physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); | 313 | physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); |
302 | void (*setup_portio_remap)(void); | 314 | void (*setup_portio_remap)(void); |
303 | int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); | 315 | int (*check_phys_apicid_present)(int phys_apicid); |
304 | void (*enable_apic_mode)(void); | 316 | void (*enable_apic_mode)(void); |
305 | int (*phys_pkg_id)(int cpuid_apic, int index_msb); | 317 | int (*phys_pkg_id)(int cpuid_apic, int index_msb); |
306 | 318 | ||
@@ -434,7 +446,7 @@ extern struct apic apic_x2apic_uv_x; | |||
434 | DECLARE_PER_CPU(int, x2apic_extra_bits); | 446 | DECLARE_PER_CPU(int, x2apic_extra_bits); |
435 | 447 | ||
436 | extern int default_cpu_present_to_apicid(int mps_cpu); | 448 | extern int default_cpu_present_to_apicid(int mps_cpu); |
437 | extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid); | 449 | extern int default_check_phys_apicid_present(int phys_apicid); |
438 | #endif | 450 | #endif |
439 | 451 | ||
440 | static inline void default_wait_for_init_deassert(atomic_t *deassert) | 452 | static inline void default_wait_for_init_deassert(atomic_t *deassert) |
@@ -550,9 +562,9 @@ static inline int __default_cpu_present_to_apicid(int mps_cpu) | |||
550 | } | 562 | } |
551 | 563 | ||
552 | static inline int | 564 | static inline int |
553 | __default_check_phys_apicid_present(int boot_cpu_physical_apicid) | 565 | __default_check_phys_apicid_present(int phys_apicid) |
554 | { | 566 | { |
555 | return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map); | 567 | return physid_isset(phys_apicid, phys_cpu_present_map); |
556 | } | 568 | } |
557 | 569 | ||
558 | #ifdef CONFIG_X86_32 | 570 | #ifdef CONFIG_X86_32 |
@@ -562,13 +574,13 @@ static inline int default_cpu_present_to_apicid(int mps_cpu) | |||
562 | } | 574 | } |
563 | 575 | ||
564 | static inline int | 576 | static inline int |
565 | default_check_phys_apicid_present(int boot_cpu_physical_apicid) | 577 | default_check_phys_apicid_present(int phys_apicid) |
566 | { | 578 | { |
567 | return __default_check_phys_apicid_present(boot_cpu_physical_apicid); | 579 | return __default_check_phys_apicid_present(phys_apicid); |
568 | } | 580 | } |
569 | #else | 581 | #else |
570 | extern int default_cpu_present_to_apicid(int mps_cpu); | 582 | extern int default_cpu_present_to_apicid(int mps_cpu); |
571 | extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid); | 583 | extern int default_check_phys_apicid_present(int phys_apicid); |
572 | #endif | 584 | #endif |
573 | 585 | ||
574 | static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) | 586 | static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) |
diff --git a/arch/x86/include/asm/bootparam.h b/arch/x86/include/asm/bootparam.h index 1724e8de317c..6be33d83c716 100644 --- a/arch/x86/include/asm/bootparam.h +++ b/arch/x86/include/asm/bootparam.h | |||
@@ -85,7 +85,8 @@ struct efi_info { | |||
85 | struct boot_params { | 85 | struct boot_params { |
86 | struct screen_info screen_info; /* 0x000 */ | 86 | struct screen_info screen_info; /* 0x000 */ |
87 | struct apm_bios_info apm_bios_info; /* 0x040 */ | 87 | struct apm_bios_info apm_bios_info; /* 0x040 */ |
88 | __u8 _pad2[12]; /* 0x054 */ | 88 | __u8 _pad2[4]; /* 0x054 */ |
89 | __u64 tboot_addr; /* 0x058 */ | ||
89 | struct ist_info ist_info; /* 0x060 */ | 90 | struct ist_info ist_info; /* 0x060 */ |
90 | __u8 _pad3[16]; /* 0x070 */ | 91 | __u8 _pad3[16]; /* 0x070 */ |
91 | __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ | 92 | __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ |
@@ -109,4 +110,14 @@ struct boot_params { | |||
109 | __u8 _pad9[276]; /* 0xeec */ | 110 | __u8 _pad9[276]; /* 0xeec */ |
110 | } __attribute__((packed)); | 111 | } __attribute__((packed)); |
111 | 112 | ||
113 | enum { | ||
114 | X86_SUBARCH_PC = 0, | ||
115 | X86_SUBARCH_LGUEST, | ||
116 | X86_SUBARCH_XEN, | ||
117 | X86_SUBARCH_MRST, | ||
118 | X86_NR_SUBARCHS, | ||
119 | }; | ||
120 | |||
121 | |||
122 | |||
112 | #endif /* _ASM_X86_BOOTPARAM_H */ | 123 | #endif /* _ASM_X86_BOOTPARAM_H */ |
diff --git a/arch/x86/include/asm/cache.h b/arch/x86/include/asm/cache.h index 5d367caa0e36..549860d3be8f 100644 --- a/arch/x86/include/asm/cache.h +++ b/arch/x86/include/asm/cache.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ASM_X86_CACHE_H | 1 | #ifndef _ASM_X86_CACHE_H |
2 | #define _ASM_X86_CACHE_H | 2 | #define _ASM_X86_CACHE_H |
3 | 3 | ||
4 | #include <linux/linkage.h> | ||
5 | |||
4 | /* L1 cache line size */ | 6 | /* L1 cache line size */ |
5 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) | 7 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) |
6 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
@@ -13,7 +15,7 @@ | |||
13 | #ifdef CONFIG_SMP | 15 | #ifdef CONFIG_SMP |
14 | #define __cacheline_aligned_in_smp \ | 16 | #define __cacheline_aligned_in_smp \ |
15 | __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ | 17 | __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ |
16 | __attribute__((__section__(".data.page_aligned"))) | 18 | __page_aligned_data |
17 | #endif | 19 | #endif |
18 | #endif | 20 | #endif |
19 | 21 | ||
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h index e55dfc1ad453..b54f6afe7ec4 100644 --- a/arch/x86/include/asm/cacheflush.h +++ b/arch/x86/include/asm/cacheflush.h | |||
@@ -43,8 +43,58 @@ static inline void copy_from_user_page(struct vm_area_struct *vma, | |||
43 | memcpy(dst, src, len); | 43 | memcpy(dst, src, len); |
44 | } | 44 | } |
45 | 45 | ||
46 | #define PG_non_WB PG_arch_1 | 46 | #define PG_WC PG_arch_1 |
47 | PAGEFLAG(NonWB, non_WB) | 47 | PAGEFLAG(WC, WC) |
48 | |||
49 | #ifdef CONFIG_X86_PAT | ||
50 | /* | ||
51 | * X86 PAT uses page flags WC and Uncached together to keep track of | ||
52 | * memory type of pages that have backing page struct. X86 PAT supports 3 | ||
53 | * different memory types, _PAGE_CACHE_WB, _PAGE_CACHE_WC and | ||
54 | * _PAGE_CACHE_UC_MINUS and fourth state where page's memory type has not | ||
55 | * been changed from its default (value of -1 used to denote this). | ||
56 | * Note we do not support _PAGE_CACHE_UC here. | ||
57 | * | ||
58 | * Caller must hold memtype_lock for atomicity. | ||
59 | */ | ||
60 | static inline unsigned long get_page_memtype(struct page *pg) | ||
61 | { | ||
62 | if (!PageUncached(pg) && !PageWC(pg)) | ||
63 | return -1; | ||
64 | else if (!PageUncached(pg) && PageWC(pg)) | ||
65 | return _PAGE_CACHE_WC; | ||
66 | else if (PageUncached(pg) && !PageWC(pg)) | ||
67 | return _PAGE_CACHE_UC_MINUS; | ||
68 | else | ||
69 | return _PAGE_CACHE_WB; | ||
70 | } | ||
71 | |||
72 | static inline void set_page_memtype(struct page *pg, unsigned long memtype) | ||
73 | { | ||
74 | switch (memtype) { | ||
75 | case _PAGE_CACHE_WC: | ||
76 | ClearPageUncached(pg); | ||
77 | SetPageWC(pg); | ||
78 | break; | ||
79 | case _PAGE_CACHE_UC_MINUS: | ||
80 | SetPageUncached(pg); | ||
81 | ClearPageWC(pg); | ||
82 | break; | ||
83 | case _PAGE_CACHE_WB: | ||
84 | SetPageUncached(pg); | ||
85 | SetPageWC(pg); | ||
86 | break; | ||
87 | default: | ||
88 | case -1: | ||
89 | ClearPageUncached(pg); | ||
90 | ClearPageWC(pg); | ||
91 | break; | ||
92 | } | ||
93 | } | ||
94 | #else | ||
95 | static inline unsigned long get_page_memtype(struct page *pg) { return -1; } | ||
96 | static inline void set_page_memtype(struct page *pg, unsigned long memtype) { } | ||
97 | #endif | ||
48 | 98 | ||
49 | /* | 99 | /* |
50 | * The set_memory_* API can be used to change various attributes of a virtual | 100 | * The set_memory_* API can be used to change various attributes of a virtual |
diff --git a/arch/x86/include/asm/checksum_32.h b/arch/x86/include/asm/checksum_32.h index 7c5ef8b14d92..46fc474fd819 100644 --- a/arch/x86/include/asm/checksum_32.h +++ b/arch/x86/include/asm/checksum_32.h | |||
@@ -161,7 +161,8 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
161 | "adcl $0, %0 ;\n" | 161 | "adcl $0, %0 ;\n" |
162 | : "=&r" (sum) | 162 | : "=&r" (sum) |
163 | : "r" (saddr), "r" (daddr), | 163 | : "r" (saddr), "r" (daddr), |
164 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)); | 164 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) |
165 | : "memory"); | ||
165 | 166 | ||
166 | return csum_fold(sum); | 167 | return csum_fold(sum); |
167 | } | 168 | } |
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h index 82ceb788a981..ee1931be6593 100644 --- a/arch/x86/include/asm/cmpxchg_32.h +++ b/arch/x86/include/asm/cmpxchg_32.h | |||
@@ -312,19 +312,23 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old, | |||
312 | 312 | ||
313 | extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64); | 313 | extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64); |
314 | 314 | ||
315 | #define cmpxchg64(ptr, o, n) \ | 315 | #define cmpxchg64(ptr, o, n) \ |
316 | ({ \ | 316 | ({ \ |
317 | __typeof__(*(ptr)) __ret; \ | 317 | __typeof__(*(ptr)) __ret; \ |
318 | if (likely(boot_cpu_data.x86 > 4)) \ | 318 | __typeof__(*(ptr)) __old = (o); \ |
319 | __ret = (__typeof__(*(ptr)))__cmpxchg64((ptr), \ | 319 | __typeof__(*(ptr)) __new = (n); \ |
320 | (unsigned long long)(o), \ | 320 | alternative_io("call cmpxchg8b_emu", \ |
321 | (unsigned long long)(n)); \ | 321 | "lock; cmpxchg8b (%%esi)" , \ |
322 | else \ | 322 | X86_FEATURE_CX8, \ |
323 | __ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr), \ | 323 | "=A" (__ret), \ |
324 | (unsigned long long)(o), \ | 324 | "S" ((ptr)), "0" (__old), \ |
325 | (unsigned long long)(n)); \ | 325 | "b" ((unsigned int)__new), \ |
326 | __ret; \ | 326 | "c" ((unsigned int)(__new>>32)) \ |
327 | }) | 327 | : "memory"); \ |
328 | __ret; }) | ||
329 | |||
330 | |||
331 | |||
328 | #define cmpxchg64_local(ptr, o, n) \ | 332 | #define cmpxchg64_local(ptr, o, n) \ |
329 | ({ \ | 333 | ({ \ |
330 | __typeof__(*(ptr)) __ret; \ | 334 | __typeof__(*(ptr)) __ret; \ |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 847fee6493a2..9cfc88b97742 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -96,6 +96,7 @@ | |||
96 | #define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */ | 96 | #define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */ |
97 | #define X86_FEATURE_EXTD_APICID (3*32+26) /* has extended APICID (8 bits) */ | 97 | #define X86_FEATURE_EXTD_APICID (3*32+26) /* has extended APICID (8 bits) */ |
98 | #define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */ | 98 | #define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */ |
99 | #define X86_FEATURE_APERFMPERF (3*32+28) /* APERFMPERF */ | ||
99 | 100 | ||
100 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 101 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
101 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ | 102 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ |
diff --git a/arch/x86/include/asm/do_timer.h b/arch/x86/include/asm/do_timer.h deleted file mode 100644 index 23ecda0b28a0..000000000000 --- a/arch/x86/include/asm/do_timer.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* defines for inline arch setup functions */ | ||
2 | #include <linux/clockchips.h> | ||
3 | |||
4 | #include <asm/i8259.h> | ||
5 | #include <asm/i8253.h> | ||
6 | |||
7 | /** | ||
8 | * do_timer_interrupt_hook - hook into timer tick | ||
9 | * | ||
10 | * Call the pit clock event handler. see asm/i8253.h | ||
11 | **/ | ||
12 | |||
13 | static inline void do_timer_interrupt_hook(void) | ||
14 | { | ||
15 | global_clock_event->event_handler(global_clock_event); | ||
16 | } | ||
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h index 7ecba4d85089..40b4e614fe71 100644 --- a/arch/x86/include/asm/e820.h +++ b/arch/x86/include/asm/e820.h | |||
@@ -126,8 +126,6 @@ extern void e820_reserve_resources(void); | |||
126 | extern void e820_reserve_resources_late(void); | 126 | extern void e820_reserve_resources_late(void); |
127 | extern void setup_memory_map(void); | 127 | extern void setup_memory_map(void); |
128 | extern char *default_machine_specific_memory_setup(void); | 128 | extern char *default_machine_specific_memory_setup(void); |
129 | extern char *machine_specific_memory_setup(void); | ||
130 | extern char *memory_setup(void); | ||
131 | #endif /* __KERNEL__ */ | 129 | #endif /* __KERNEL__ */ |
132 | #endif /* __ASSEMBLY__ */ | 130 | #endif /* __ASSEMBLY__ */ |
133 | 131 | ||
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 83c1bc8d2e8a..456a304b8172 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h | |||
@@ -299,6 +299,8 @@ do { \ | |||
299 | 299 | ||
300 | #ifdef CONFIG_X86_32 | 300 | #ifdef CONFIG_X86_32 |
301 | 301 | ||
302 | #define STACK_RND_MASK (0x7ff) | ||
303 | |||
302 | #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) | 304 | #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) |
303 | 305 | ||
304 | #define ARCH_DLINFO ARCH_DLINFO_IA32(vdso_enabled) | 306 | #define ARCH_DLINFO ARCH_DLINFO_IA32(vdso_enabled) |
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h index ff8cbfa07851..f5693c81a1db 100644 --- a/arch/x86/include/asm/entry_arch.h +++ b/arch/x86/include/asm/entry_arch.h | |||
@@ -49,7 +49,7 @@ BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR) | |||
49 | BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) | 49 | BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) |
50 | BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) | 50 | BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) |
51 | 51 | ||
52 | #ifdef CONFIG_PERF_COUNTERS | 52 | #ifdef CONFIG_PERF_EVENTS |
53 | BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR) | 53 | BUILD_INTERRUPT(perf_pending_interrupt, LOCAL_PENDING_VECTOR) |
54 | #endif | 54 | #endif |
55 | 55 | ||
@@ -61,7 +61,7 @@ BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR) | |||
61 | BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR) | 61 | BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR) |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | #ifdef CONFIG_X86_NEW_MCE | 64 | #ifdef CONFIG_X86_MCE |
65 | BUILD_INTERRUPT(mce_self_interrupt,MCE_SELF_VECTOR) | 65 | BUILD_INTERRUPT(mce_self_interrupt,MCE_SELF_VECTOR) |
66 | #endif | 66 | #endif |
67 | 67 | ||
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 7b2d71df39a6..14f9890eb495 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h | |||
@@ -132,6 +132,9 @@ enum fixed_addresses { | |||
132 | #ifdef CONFIG_X86_32 | 132 | #ifdef CONFIG_X86_32 |
133 | FIX_WP_TEST, | 133 | FIX_WP_TEST, |
134 | #endif | 134 | #endif |
135 | #ifdef CONFIG_INTEL_TXT | ||
136 | FIX_TBOOT_BASE, | ||
137 | #endif | ||
135 | __end_of_fixed_addresses | 138 | __end_of_fixed_addresses |
136 | }; | 139 | }; |
137 | 140 | ||
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h index 369f5c5d09a1..b78c0941e422 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #ifndef ASM_X86__HYPERVISOR_H | 20 | #ifndef ASM_X86__HYPERVISOR_H |
21 | #define ASM_X86__HYPERVISOR_H | 21 | #define ASM_X86__HYPERVISOR_H |
22 | 22 | ||
23 | extern unsigned long get_hypervisor_tsc_freq(void); | ||
24 | extern void init_hypervisor(struct cpuinfo_x86 *c); | 23 | extern void init_hypervisor(struct cpuinfo_x86 *c); |
24 | extern void init_hypervisor_platform(void); | ||
25 | 25 | ||
26 | #endif | 26 | #endif |
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 85232d32fcb8..7c7c16cde1f8 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -143,6 +143,8 @@ extern int noioapicreroute; | |||
143 | /* 1 if the timer IRQ uses the '8259A Virtual Wire' mode */ | 143 | /* 1 if the timer IRQ uses the '8259A Virtual Wire' mode */ |
144 | extern int timer_through_8259; | 144 | extern int timer_through_8259; |
145 | 145 | ||
146 | extern void io_apic_disable_legacy(void); | ||
147 | |||
146 | /* | 148 | /* |
147 | * If we use the IO-APIC for IRQ routing, disable automatic | 149 | * If we use the IO-APIC for IRQ routing, disable automatic |
148 | * assignment of PCI IRQ's. | 150 | * assignment of PCI IRQ's. |
@@ -176,6 +178,7 @@ extern int setup_ioapic_entry(int apic, int irq, | |||
176 | int polarity, int vector, int pin); | 178 | int polarity, int vector, int pin); |
177 | extern void ioapic_write_entry(int apic, int pin, | 179 | extern void ioapic_write_entry(int apic, int pin, |
178 | struct IO_APIC_route_entry e); | 180 | struct IO_APIC_route_entry e); |
181 | extern void setup_ioapic_ids_from_mpc(void); | ||
179 | 182 | ||
180 | struct mp_ioapic_gsi{ | 183 | struct mp_ioapic_gsi{ |
181 | int gsi_base; | 184 | int gsi_base; |
@@ -187,12 +190,14 @@ int mp_find_ioapic_pin(int ioapic, int gsi); | |||
187 | void __init mp_register_ioapic(int id, u32 address, u32 gsi_base); | 190 | void __init mp_register_ioapic(int id, u32 address, u32 gsi_base); |
188 | 191 | ||
189 | #else /* !CONFIG_X86_IO_APIC */ | 192 | #else /* !CONFIG_X86_IO_APIC */ |
193 | |||
190 | #define io_apic_assign_pci_irqs 0 | 194 | #define io_apic_assign_pci_irqs 0 |
195 | #define setup_ioapic_ids_from_mpc x86_init_noop | ||
191 | static const int timer_through_8259 = 0; | 196 | static const int timer_through_8259 = 0; |
192 | static inline void ioapic_init_mappings(void) { } | 197 | static inline void ioapic_init_mappings(void) { } |
193 | static inline void ioapic_insert_resources(void) { } | 198 | static inline void ioapic_insert_resources(void) { } |
194 | |||
195 | static inline void probe_nr_irqs_gsi(void) { } | 199 | static inline void probe_nr_irqs_gsi(void) { } |
200 | |||
196 | #endif | 201 | #endif |
197 | 202 | ||
198 | #endif /* _ASM_X86_IO_APIC_H */ | 203 | #endif /* _ASM_X86_IO_APIC_H */ |
diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h index 0e9fe1d9d971..f35eb45d6576 100644 --- a/arch/x86/include/asm/iomap.h +++ b/arch/x86/include/asm/iomap.h | |||
@@ -26,13 +26,16 @@ | |||
26 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
27 | #include <asm/tlbflush.h> | 27 | #include <asm/tlbflush.h> |
28 | 28 | ||
29 | int | ||
30 | is_io_mapping_possible(resource_size_t base, unsigned long size); | ||
31 | |||
32 | void * | 29 | void * |
33 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); | 30 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); |
34 | 31 | ||
35 | void | 32 | void |
36 | iounmap_atomic(void *kvaddr, enum km_type type); | 33 | iounmap_atomic(void *kvaddr, enum km_type type); |
37 | 34 | ||
35 | int | ||
36 | iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot); | ||
37 | |||
38 | void | ||
39 | iomap_free(resource_size_t base, unsigned long size); | ||
40 | |||
38 | #endif /* _ASM_X86_IOMAP_H */ | 41 | #endif /* _ASM_X86_IOMAP_H */ |
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h index f38481bcd455..ddda6cbed6f4 100644 --- a/arch/x86/include/asm/irq.h +++ b/arch/x86/include/asm/irq.h | |||
@@ -37,7 +37,6 @@ extern void fixup_irqs(void); | |||
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | extern void (*generic_interrupt_extension)(void); | 39 | extern void (*generic_interrupt_extension)(void); |
40 | extern void init_IRQ(void); | ||
41 | extern void native_init_IRQ(void); | 40 | extern void native_init_IRQ(void); |
42 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); | 41 | extern bool handle_irq(unsigned irq, struct pt_regs *regs); |
43 | 42 | ||
@@ -47,4 +46,6 @@ extern unsigned int do_IRQ(struct pt_regs *regs); | |||
47 | extern DECLARE_BITMAP(used_vectors, NR_VECTORS); | 46 | extern DECLARE_BITMAP(used_vectors, NR_VECTORS); |
48 | extern int vector_used_by_percpu_irq(unsigned int vector); | 47 | extern int vector_used_by_percpu_irq(unsigned int vector); |
49 | 48 | ||
49 | extern void init_ISA_irqs(void); | ||
50 | |||
50 | #endif /* _ASM_X86_IRQ_H */ | 51 | #endif /* _ASM_X86_IRQ_H */ |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 3be000435fad..d83892226f73 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -796,6 +796,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void); | |||
796 | #define KVM_ARCH_WANT_MMU_NOTIFIER | 796 | #define KVM_ARCH_WANT_MMU_NOTIFIER |
797 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); | 797 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); |
798 | int kvm_age_hva(struct kvm *kvm, unsigned long hva); | 798 | int kvm_age_hva(struct kvm *kvm, unsigned long hva); |
799 | void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); | ||
799 | int cpuid_maxphyaddr(struct kvm_vcpu *vcpu); | 800 | int cpuid_maxphyaddr(struct kvm_vcpu *vcpu); |
800 | int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); | 801 | int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); |
801 | int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); | 802 | int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); |
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 5cdd8d100ec9..f1363b72364f 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define MCG_BANKCNT_MASK 0xff /* Number of Banks */ | 11 | #define MCG_BANKCNT_MASK 0xff /* Number of Banks */ |
12 | #define MCG_CTL_P (1ULL<<8) /* MCG_CAP register available */ | 12 | #define MCG_CTL_P (1ULL<<8) /* MCG_CTL register available */ |
13 | #define MCG_EXT_P (1ULL<<9) /* Extended registers available */ | 13 | #define MCG_EXT_P (1ULL<<9) /* Extended registers available */ |
14 | #define MCG_CMCI_P (1ULL<<10) /* CMCI supported */ | 14 | #define MCG_CMCI_P (1ULL<<10) /* CMCI supported */ |
15 | #define MCG_EXT_CNT_MASK 0xff0000 /* Number of Extended registers */ | 15 | #define MCG_EXT_CNT_MASK 0xff0000 /* Number of Extended registers */ |
@@ -38,6 +38,14 @@ | |||
38 | #define MCM_ADDR_MEM 3 /* memory address */ | 38 | #define MCM_ADDR_MEM 3 /* memory address */ |
39 | #define MCM_ADDR_GENERIC 7 /* generic */ | 39 | #define MCM_ADDR_GENERIC 7 /* generic */ |
40 | 40 | ||
41 | #define MCJ_CTX_MASK 3 | ||
42 | #define MCJ_CTX(flags) ((flags) & MCJ_CTX_MASK) | ||
43 | #define MCJ_CTX_RANDOM 0 /* inject context: random */ | ||
44 | #define MCJ_CTX_PROCESS 1 /* inject context: process */ | ||
45 | #define MCJ_CTX_IRQ 2 /* inject context: IRQ */ | ||
46 | #define MCJ_NMI_BROADCAST 4 /* do NMI broadcasting */ | ||
47 | #define MCJ_EXCEPTION 8 /* raise as exception */ | ||
48 | |||
41 | /* Fields are zero when not available */ | 49 | /* Fields are zero when not available */ |
42 | struct mce { | 50 | struct mce { |
43 | __u64 status; | 51 | __u64 status; |
@@ -48,8 +56,8 @@ struct mce { | |||
48 | __u64 tsc; /* cpu time stamp counter */ | 56 | __u64 tsc; /* cpu time stamp counter */ |
49 | __u64 time; /* wall time_t when error was detected */ | 57 | __u64 time; /* wall time_t when error was detected */ |
50 | __u8 cpuvendor; /* cpu vendor as encoded in system.h */ | 58 | __u8 cpuvendor; /* cpu vendor as encoded in system.h */ |
51 | __u8 pad1; | 59 | __u8 inject_flags; /* software inject flags */ |
52 | __u16 pad2; | 60 | __u16 pad; |
53 | __u32 cpuid; /* CPUID 1 EAX */ | 61 | __u32 cpuid; /* CPUID 1 EAX */ |
54 | __u8 cs; /* code segment */ | 62 | __u8 cs; /* code segment */ |
55 | __u8 bank; /* machine check bank */ | 63 | __u8 bank; /* machine check bank */ |
@@ -115,13 +123,6 @@ void mcheck_init(struct cpuinfo_x86 *c); | |||
115 | static inline void mcheck_init(struct cpuinfo_x86 *c) {} | 123 | static inline void mcheck_init(struct cpuinfo_x86 *c) {} |
116 | #endif | 124 | #endif |
117 | 125 | ||
118 | #ifdef CONFIG_X86_OLD_MCE | ||
119 | extern int nr_mce_banks; | ||
120 | void amd_mcheck_init(struct cpuinfo_x86 *c); | ||
121 | void intel_p4_mcheck_init(struct cpuinfo_x86 *c); | ||
122 | void intel_p6_mcheck_init(struct cpuinfo_x86 *c); | ||
123 | #endif | ||
124 | |||
125 | #ifdef CONFIG_X86_ANCIENT_MCE | 126 | #ifdef CONFIG_X86_ANCIENT_MCE |
126 | void intel_p5_mcheck_init(struct cpuinfo_x86 *c); | 127 | void intel_p5_mcheck_init(struct cpuinfo_x86 *c); |
127 | void winchip_mcheck_init(struct cpuinfo_x86 *c); | 128 | void winchip_mcheck_init(struct cpuinfo_x86 *c); |
@@ -132,15 +133,18 @@ static inline void winchip_mcheck_init(struct cpuinfo_x86 *c) {} | |||
132 | static inline void enable_p5_mce(void) {} | 133 | static inline void enable_p5_mce(void) {} |
133 | #endif | 134 | #endif |
134 | 135 | ||
136 | extern void (*x86_mce_decode_callback)(struct mce *m); | ||
137 | |||
135 | void mce_setup(struct mce *m); | 138 | void mce_setup(struct mce *m); |
136 | void mce_log(struct mce *m); | 139 | void mce_log(struct mce *m); |
137 | DECLARE_PER_CPU(struct sys_device, mce_dev); | 140 | DECLARE_PER_CPU(struct sys_device, mce_dev); |
138 | 141 | ||
139 | /* | 142 | /* |
140 | * To support more than 128 would need to escape the predefined | 143 | * Maximum banks number. |
141 | * Linux defined extended banks first. | 144 | * This is the limit of the current register layout on |
145 | * Intel CPUs. | ||
142 | */ | 146 | */ |
143 | #define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1) | 147 | #define MAX_NR_BANKS 32 |
144 | 148 | ||
145 | #ifdef CONFIG_X86_MCE_INTEL | 149 | #ifdef CONFIG_X86_MCE_INTEL |
146 | extern int mce_cmci_disabled; | 150 | extern int mce_cmci_disabled; |
@@ -208,11 +212,7 @@ extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); | |||
208 | 212 | ||
209 | void intel_init_thermal(struct cpuinfo_x86 *c); | 213 | void intel_init_thermal(struct cpuinfo_x86 *c); |
210 | 214 | ||
211 | #ifdef CONFIG_X86_NEW_MCE | ||
212 | void mce_log_therm_throt_event(__u64 status); | 215 | void mce_log_therm_throt_event(__u64 status); |
213 | #else | ||
214 | static inline void mce_log_therm_throt_event(__u64 status) {} | ||
215 | #endif | ||
216 | 216 | ||
217 | #endif /* __KERNEL__ */ | 217 | #endif /* __KERNEL__ */ |
218 | #endif /* _ASM_X86_MCE_H */ | 218 | #endif /* _ASM_X86_MCE_H */ |
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h index f923203dc39a..4a2d4e0c18d9 100644 --- a/arch/x86/include/asm/mmu_context.h +++ b/arch/x86/include/asm/mmu_context.h | |||
@@ -37,12 +37,12 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
37 | 37 | ||
38 | if (likely(prev != next)) { | 38 | if (likely(prev != next)) { |
39 | /* stop flush ipis for the previous mm */ | 39 | /* stop flush ipis for the previous mm */ |
40 | cpu_clear(cpu, prev->cpu_vm_mask); | 40 | cpumask_clear_cpu(cpu, mm_cpumask(prev)); |
41 | #ifdef CONFIG_SMP | 41 | #ifdef CONFIG_SMP |
42 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); | 42 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); |
43 | percpu_write(cpu_tlbstate.active_mm, next); | 43 | percpu_write(cpu_tlbstate.active_mm, next); |
44 | #endif | 44 | #endif |
45 | cpu_set(cpu, next->cpu_vm_mask); | 45 | cpumask_set_cpu(cpu, mm_cpumask(next)); |
46 | 46 | ||
47 | /* Re-load page tables */ | 47 | /* Re-load page tables */ |
48 | load_cr3(next->pgd); | 48 | load_cr3(next->pgd); |
@@ -58,7 +58,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
58 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); | 58 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); |
59 | BUG_ON(percpu_read(cpu_tlbstate.active_mm) != next); | 59 | BUG_ON(percpu_read(cpu_tlbstate.active_mm) != next); |
60 | 60 | ||
61 | if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) { | 61 | if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))) { |
62 | /* We were in lazy tlb mode and leave_mm disabled | 62 | /* We were in lazy tlb mode and leave_mm disabled |
63 | * tlb flush IPI delivery. We must reload CR3 | 63 | * tlb flush IPI delivery. We must reload CR3 |
64 | * to make sure to use no freed page tables. | 64 | * to make sure to use no freed page tables. |
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index e2a1bb6d71ea..79c94500c0bb 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
5 | 5 | ||
6 | #include <asm/mpspec_def.h> | 6 | #include <asm/mpspec_def.h> |
7 | #include <asm/x86_init.h> | ||
7 | 8 | ||
8 | extern int apic_version[MAX_APICS]; | 9 | extern int apic_version[MAX_APICS]; |
9 | extern int pic_mode; | 10 | extern int pic_mode; |
@@ -41,9 +42,6 @@ extern int quad_local_to_mp_bus_id [NR_CPUS/4][4]; | |||
41 | 42 | ||
42 | #endif /* CONFIG_X86_64 */ | 43 | #endif /* CONFIG_X86_64 */ |
43 | 44 | ||
44 | extern void early_find_smp_config(void); | ||
45 | extern void early_get_smp_config(void); | ||
46 | |||
47 | #if defined(CONFIG_MCA) || defined(CONFIG_EISA) | 45 | #if defined(CONFIG_MCA) || defined(CONFIG_EISA) |
48 | extern int mp_bus_id_to_type[MAX_MP_BUSSES]; | 46 | extern int mp_bus_id_to_type[MAX_MP_BUSSES]; |
49 | #endif | 47 | #endif |
@@ -52,20 +50,55 @@ extern DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); | |||
52 | 50 | ||
53 | extern unsigned int boot_cpu_physical_apicid; | 51 | extern unsigned int boot_cpu_physical_apicid; |
54 | extern unsigned int max_physical_apicid; | 52 | extern unsigned int max_physical_apicid; |
55 | extern int smp_found_config; | ||
56 | extern int mpc_default_type; | 53 | extern int mpc_default_type; |
57 | extern unsigned long mp_lapic_addr; | 54 | extern unsigned long mp_lapic_addr; |
58 | 55 | ||
59 | extern void get_smp_config(void); | 56 | #ifdef CONFIG_X86_LOCAL_APIC |
57 | extern int smp_found_config; | ||
58 | #else | ||
59 | # define smp_found_config 0 | ||
60 | #endif | ||
61 | |||
62 | static inline void get_smp_config(void) | ||
63 | { | ||
64 | x86_init.mpparse.get_smp_config(0); | ||
65 | } | ||
66 | |||
67 | static inline void early_get_smp_config(void) | ||
68 | { | ||
69 | x86_init.mpparse.get_smp_config(1); | ||
70 | } | ||
71 | |||
72 | static inline void find_smp_config(void) | ||
73 | { | ||
74 | x86_init.mpparse.find_smp_config(1); | ||
75 | } | ||
76 | |||
77 | static inline void early_find_smp_config(void) | ||
78 | { | ||
79 | x86_init.mpparse.find_smp_config(0); | ||
80 | } | ||
60 | 81 | ||
61 | #ifdef CONFIG_X86_MPPARSE | 82 | #ifdef CONFIG_X86_MPPARSE |
62 | extern void find_smp_config(void); | ||
63 | extern void early_reserve_e820_mpc_new(void); | 83 | extern void early_reserve_e820_mpc_new(void); |
64 | extern int enable_update_mptable; | 84 | extern int enable_update_mptable; |
85 | extern int default_mpc_apic_id(struct mpc_cpu *m); | ||
86 | extern void default_smp_read_mpc_oem(struct mpc_table *mpc); | ||
87 | # ifdef CONFIG_X86_IO_APIC | ||
88 | extern void default_mpc_oem_bus_info(struct mpc_bus *m, char *str); | ||
89 | # else | ||
90 | # define default_mpc_oem_bus_info NULL | ||
91 | # endif | ||
92 | extern void default_find_smp_config(unsigned int reserve); | ||
93 | extern void default_get_smp_config(unsigned int early); | ||
65 | #else | 94 | #else |
66 | static inline void find_smp_config(void) { } | ||
67 | static inline void early_reserve_e820_mpc_new(void) { } | 95 | static inline void early_reserve_e820_mpc_new(void) { } |
68 | #define enable_update_mptable 0 | 96 | #define enable_update_mptable 0 |
97 | #define default_mpc_apic_id NULL | ||
98 | #define default_smp_read_mpc_oem NULL | ||
99 | #define default_mpc_oem_bus_info NULL | ||
100 | #define default_find_smp_config x86_init_uint_noop | ||
101 | #define default_get_smp_config x86_init_uint_noop | ||
69 | #endif | 102 | #endif |
70 | 103 | ||
71 | void __cpuinit generic_processor_info(int apicid, int version); | 104 | void __cpuinit generic_processor_info(int apicid, int version); |
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index bd5549034a95..4ffe09b2ad75 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h | |||
@@ -81,8 +81,15 @@ | |||
81 | #define MSR_IA32_MC0_ADDR 0x00000402 | 81 | #define MSR_IA32_MC0_ADDR 0x00000402 |
82 | #define MSR_IA32_MC0_MISC 0x00000403 | 82 | #define MSR_IA32_MC0_MISC 0x00000403 |
83 | 83 | ||
84 | #define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) | ||
85 | #define MSR_IA32_MCx_STATUS(x) (MSR_IA32_MC0_STATUS + 4*(x)) | ||
86 | #define MSR_IA32_MCx_ADDR(x) (MSR_IA32_MC0_ADDR + 4*(x)) | ||
87 | #define MSR_IA32_MCx_MISC(x) (MSR_IA32_MC0_MISC + 4*(x)) | ||
88 | |||
84 | /* These are consecutive and not in the normal 4er MCE bank block */ | 89 | /* These are consecutive and not in the normal 4er MCE bank block */ |
85 | #define MSR_IA32_MC0_CTL2 0x00000280 | 90 | #define MSR_IA32_MC0_CTL2 0x00000280 |
91 | #define MSR_IA32_MCx_CTL2(x) (MSR_IA32_MC0_CTL2 + (x)) | ||
92 | |||
86 | #define CMCI_EN (1ULL << 30) | 93 | #define CMCI_EN (1ULL << 30) |
87 | #define CMCI_THRESHOLD_MASK 0xffffULL | 94 | #define CMCI_THRESHOLD_MASK 0xffffULL |
88 | 95 | ||
@@ -215,6 +222,10 @@ | |||
215 | 222 | ||
216 | #define THERM_STATUS_PROCHOT (1 << 0) | 223 | #define THERM_STATUS_PROCHOT (1 << 0) |
217 | 224 | ||
225 | #define MSR_THERM2_CTL 0x0000019d | ||
226 | |||
227 | #define MSR_THERM2_CTL_TM_SELECT (1ULL << 16) | ||
228 | |||
218 | #define MSR_IA32_MISC_ENABLE 0x000001a0 | 229 | #define MSR_IA32_MISC_ENABLE 0x000001a0 |
219 | 230 | ||
220 | /* MISC_ENABLE bits: architectural */ | 231 | /* MISC_ENABLE bits: architectural */ |
diff --git a/arch/x86/include/asm/mtrr.h b/arch/x86/include/asm/mtrr.h index a51ada8467de..4365ffdb461f 100644 --- a/arch/x86/include/asm/mtrr.h +++ b/arch/x86/include/asm/mtrr.h | |||
@@ -121,6 +121,9 @@ extern int mtrr_del_page(int reg, unsigned long base, unsigned long size); | |||
121 | extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); | 121 | extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); |
122 | extern void mtrr_ap_init(void); | 122 | extern void mtrr_ap_init(void); |
123 | extern void mtrr_bp_init(void); | 123 | extern void mtrr_bp_init(void); |
124 | extern void set_mtrr_aps_delayed_init(void); | ||
125 | extern void mtrr_aps_init(void); | ||
126 | extern void mtrr_bp_restore(void); | ||
124 | extern int mtrr_trim_uncached_memory(unsigned long end_pfn); | 127 | extern int mtrr_trim_uncached_memory(unsigned long end_pfn); |
125 | extern int amd_special_default_mtrr(void); | 128 | extern int amd_special_default_mtrr(void); |
126 | # else | 129 | # else |
@@ -161,6 +164,9 @@ static inline void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) | |||
161 | 164 | ||
162 | #define mtrr_ap_init() do {} while (0) | 165 | #define mtrr_ap_init() do {} while (0) |
163 | #define mtrr_bp_init() do {} while (0) | 166 | #define mtrr_bp_init() do {} while (0) |
167 | #define set_mtrr_aps_delayed_init() do {} while (0) | ||
168 | #define mtrr_aps_init() do {} while (0) | ||
169 | #define mtrr_bp_restore() do {} while (0) | ||
164 | # endif | 170 | # endif |
165 | 171 | ||
166 | #ifdef CONFIG_COMPAT | 172 | #ifdef CONFIG_COMPAT |
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h index e63cf7d441e1..139d4c1a33a7 100644 --- a/arch/x86/include/asm/nmi.h +++ b/arch/x86/include/asm/nmi.h | |||
@@ -40,8 +40,7 @@ extern unsigned int nmi_watchdog; | |||
40 | #define NMI_INVALID 3 | 40 | #define NMI_INVALID 3 |
41 | 41 | ||
42 | struct ctl_table; | 42 | struct ctl_table; |
43 | struct file; | 43 | extern int proc_nmi_enabled(struct ctl_table *, int , |
44 | extern int proc_nmi_enabled(struct ctl_table *, int , struct file *, | ||
45 | void __user *, size_t *, loff_t *); | 44 | void __user *, size_t *, loff_t *); |
46 | extern int unknown_nmi_panic; | 45 | extern int unknown_nmi_panic; |
47 | 46 | ||
diff --git a/arch/x86/include/asm/nops.h b/arch/x86/include/asm/nops.h index ad2668ee1aa7..6d8723a766cc 100644 --- a/arch/x86/include/asm/nops.h +++ b/arch/x86/include/asm/nops.h | |||
@@ -65,6 +65,8 @@ | |||
65 | 6: osp nopl 0x00(%eax,%eax,1) | 65 | 6: osp nopl 0x00(%eax,%eax,1) |
66 | 7: nopl 0x00000000(%eax) | 66 | 7: nopl 0x00000000(%eax) |
67 | 8: nopl 0x00000000(%eax,%eax,1) | 67 | 8: nopl 0x00000000(%eax,%eax,1) |
68 | Note: All the above are assumed to be a single instruction. | ||
69 | There is kernel code that depends on this. | ||
68 | */ | 70 | */ |
69 | #define P6_NOP1 GENERIC_NOP1 | 71 | #define P6_NOP1 GENERIC_NOP1 |
70 | #define P6_NOP2 ".byte 0x66,0x90\n" | 72 | #define P6_NOP2 ".byte 0x66,0x90\n" |
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 40d6586af25b..efb38994859c 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
@@ -24,22 +24,6 @@ static inline void load_sp0(struct tss_struct *tss, | |||
24 | PVOP_VCALL2(pv_cpu_ops.load_sp0, tss, thread); | 24 | PVOP_VCALL2(pv_cpu_ops.load_sp0, tss, thread); |
25 | } | 25 | } |
26 | 26 | ||
27 | #define ARCH_SETUP pv_init_ops.arch_setup(); | ||
28 | static inline unsigned long get_wallclock(void) | ||
29 | { | ||
30 | return PVOP_CALL0(unsigned long, pv_time_ops.get_wallclock); | ||
31 | } | ||
32 | |||
33 | static inline int set_wallclock(unsigned long nowtime) | ||
34 | { | ||
35 | return PVOP_CALL1(int, pv_time_ops.set_wallclock, nowtime); | ||
36 | } | ||
37 | |||
38 | static inline void (*choose_time_init(void))(void) | ||
39 | { | ||
40 | return pv_time_ops.time_init; | ||
41 | } | ||
42 | |||
43 | /* The paravirtualized CPUID instruction. */ | 27 | /* The paravirtualized CPUID instruction. */ |
44 | static inline void __cpuid(unsigned int *eax, unsigned int *ebx, | 28 | static inline void __cpuid(unsigned int *eax, unsigned int *ebx, |
45 | unsigned int *ecx, unsigned int *edx) | 29 | unsigned int *ecx, unsigned int *edx) |
@@ -245,7 +229,6 @@ static inline unsigned long long paravirt_sched_clock(void) | |||
245 | { | 229 | { |
246 | return PVOP_CALL0(unsigned long long, pv_time_ops.sched_clock); | 230 | return PVOP_CALL0(unsigned long long, pv_time_ops.sched_clock); |
247 | } | 231 | } |
248 | #define calibrate_tsc() (pv_time_ops.get_tsc_khz()) | ||
249 | 232 | ||
250 | static inline unsigned long long paravirt_read_pmc(int counter) | 233 | static inline unsigned long long paravirt_read_pmc(int counter) |
251 | { | 234 | { |
@@ -363,34 +346,6 @@ static inline void slow_down_io(void) | |||
363 | #endif | 346 | #endif |
364 | } | 347 | } |
365 | 348 | ||
366 | #ifdef CONFIG_X86_LOCAL_APIC | ||
367 | static inline void setup_boot_clock(void) | ||
368 | { | ||
369 | PVOP_VCALL0(pv_apic_ops.setup_boot_clock); | ||
370 | } | ||
371 | |||
372 | static inline void setup_secondary_clock(void) | ||
373 | { | ||
374 | PVOP_VCALL0(pv_apic_ops.setup_secondary_clock); | ||
375 | } | ||
376 | #endif | ||
377 | |||
378 | static inline void paravirt_post_allocator_init(void) | ||
379 | { | ||
380 | if (pv_init_ops.post_allocator_init) | ||
381 | (*pv_init_ops.post_allocator_init)(); | ||
382 | } | ||
383 | |||
384 | static inline void paravirt_pagetable_setup_start(pgd_t *base) | ||
385 | { | ||
386 | (*pv_mmu_ops.pagetable_setup_start)(base); | ||
387 | } | ||
388 | |||
389 | static inline void paravirt_pagetable_setup_done(pgd_t *base) | ||
390 | { | ||
391 | (*pv_mmu_ops.pagetable_setup_done)(base); | ||
392 | } | ||
393 | |||
394 | #ifdef CONFIG_SMP | 349 | #ifdef CONFIG_SMP |
395 | static inline void startup_ipi_hook(int phys_apicid, unsigned long start_eip, | 350 | static inline void startup_ipi_hook(int phys_apicid, unsigned long start_eip, |
396 | unsigned long start_esp) | 351 | unsigned long start_esp) |
@@ -885,42 +840,22 @@ static __always_inline void __raw_spin_unlock(struct raw_spinlock *lock) | |||
885 | 840 | ||
886 | static inline unsigned long __raw_local_save_flags(void) | 841 | static inline unsigned long __raw_local_save_flags(void) |
887 | { | 842 | { |
888 | unsigned long f; | 843 | return PVOP_CALLEE0(unsigned long, pv_irq_ops.save_fl); |
889 | |||
890 | asm volatile(paravirt_alt(PARAVIRT_CALL) | ||
891 | : "=a"(f) | ||
892 | : paravirt_type(pv_irq_ops.save_fl), | ||
893 | paravirt_clobber(CLBR_EAX) | ||
894 | : "memory", "cc"); | ||
895 | return f; | ||
896 | } | 844 | } |
897 | 845 | ||
898 | static inline void raw_local_irq_restore(unsigned long f) | 846 | static inline void raw_local_irq_restore(unsigned long f) |
899 | { | 847 | { |
900 | asm volatile(paravirt_alt(PARAVIRT_CALL) | 848 | PVOP_VCALLEE1(pv_irq_ops.restore_fl, f); |
901 | : "=a"(f) | ||
902 | : PV_FLAGS_ARG(f), | ||
903 | paravirt_type(pv_irq_ops.restore_fl), | ||
904 | paravirt_clobber(CLBR_EAX) | ||
905 | : "memory", "cc"); | ||
906 | } | 849 | } |
907 | 850 | ||
908 | static inline void raw_local_irq_disable(void) | 851 | static inline void raw_local_irq_disable(void) |
909 | { | 852 | { |
910 | asm volatile(paravirt_alt(PARAVIRT_CALL) | 853 | PVOP_VCALLEE0(pv_irq_ops.irq_disable); |
911 | : | ||
912 | : paravirt_type(pv_irq_ops.irq_disable), | ||
913 | paravirt_clobber(CLBR_EAX) | ||
914 | : "memory", "eax", "cc"); | ||
915 | } | 854 | } |
916 | 855 | ||
917 | static inline void raw_local_irq_enable(void) | 856 | static inline void raw_local_irq_enable(void) |
918 | { | 857 | { |
919 | asm volatile(paravirt_alt(PARAVIRT_CALL) | 858 | PVOP_VCALLEE0(pv_irq_ops.irq_enable); |
920 | : | ||
921 | : paravirt_type(pv_irq_ops.irq_enable), | ||
922 | paravirt_clobber(CLBR_EAX) | ||
923 | : "memory", "eax", "cc"); | ||
924 | } | 859 | } |
925 | 860 | ||
926 | static inline unsigned long __raw_local_irq_save(void) | 861 | static inline unsigned long __raw_local_irq_save(void) |
@@ -948,6 +883,8 @@ static inline unsigned long __raw_local_irq_save(void) | |||
948 | #undef PVOP_VCALL4 | 883 | #undef PVOP_VCALL4 |
949 | #undef PVOP_CALL4 | 884 | #undef PVOP_CALL4 |
950 | 885 | ||
886 | extern void default_banner(void); | ||
887 | |||
951 | #else /* __ASSEMBLY__ */ | 888 | #else /* __ASSEMBLY__ */ |
952 | 889 | ||
953 | #define _PVSITE(ptype, clobbers, ops, word, algn) \ | 890 | #define _PVSITE(ptype, clobbers, ops, word, algn) \ |
@@ -1088,5 +1025,7 @@ static inline unsigned long __raw_local_irq_save(void) | |||
1088 | #endif /* CONFIG_X86_32 */ | 1025 | #endif /* CONFIG_X86_32 */ |
1089 | 1026 | ||
1090 | #endif /* __ASSEMBLY__ */ | 1027 | #endif /* __ASSEMBLY__ */ |
1091 | #endif /* CONFIG_PARAVIRT */ | 1028 | #else /* CONFIG_PARAVIRT */ |
1029 | # define default_banner x86_init_noop | ||
1030 | #endif /* !CONFIG_PARAVIRT */ | ||
1092 | #endif /* _ASM_X86_PARAVIRT_H */ | 1031 | #endif /* _ASM_X86_PARAVIRT_H */ |
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index 25402d0006e7..9357473c8da0 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h | |||
@@ -78,14 +78,6 @@ struct pv_init_ops { | |||
78 | */ | 78 | */ |
79 | unsigned (*patch)(u8 type, u16 clobber, void *insnbuf, | 79 | unsigned (*patch)(u8 type, u16 clobber, void *insnbuf, |
80 | unsigned long addr, unsigned len); | 80 | unsigned long addr, unsigned len); |
81 | |||
82 | /* Basic arch-specific setup */ | ||
83 | void (*arch_setup)(void); | ||
84 | char *(*memory_setup)(void); | ||
85 | void (*post_allocator_init)(void); | ||
86 | |||
87 | /* Print a banner to identify the environment */ | ||
88 | void (*banner)(void); | ||
89 | }; | 81 | }; |
90 | 82 | ||
91 | 83 | ||
@@ -96,12 +88,6 @@ struct pv_lazy_ops { | |||
96 | }; | 88 | }; |
97 | 89 | ||
98 | struct pv_time_ops { | 90 | struct pv_time_ops { |
99 | void (*time_init)(void); | ||
100 | |||
101 | /* Set and set time of day */ | ||
102 | unsigned long (*get_wallclock)(void); | ||
103 | int (*set_wallclock)(unsigned long); | ||
104 | |||
105 | unsigned long long (*sched_clock)(void); | 91 | unsigned long long (*sched_clock)(void); |
106 | unsigned long (*get_tsc_khz)(void); | 92 | unsigned long (*get_tsc_khz)(void); |
107 | }; | 93 | }; |
@@ -203,8 +189,6 @@ struct pv_cpu_ops { | |||
203 | }; | 189 | }; |
204 | 190 | ||
205 | struct pv_irq_ops { | 191 | struct pv_irq_ops { |
206 | void (*init_IRQ)(void); | ||
207 | |||
208 | /* | 192 | /* |
209 | * Get/set interrupt state. save_fl and restore_fl are only | 193 | * Get/set interrupt state. save_fl and restore_fl are only |
210 | * expected to use X86_EFLAGS_IF; all other bits | 194 | * expected to use X86_EFLAGS_IF; all other bits |
@@ -229,9 +213,6 @@ struct pv_irq_ops { | |||
229 | 213 | ||
230 | struct pv_apic_ops { | 214 | struct pv_apic_ops { |
231 | #ifdef CONFIG_X86_LOCAL_APIC | 215 | #ifdef CONFIG_X86_LOCAL_APIC |
232 | void (*setup_boot_clock)(void); | ||
233 | void (*setup_secondary_clock)(void); | ||
234 | |||
235 | void (*startup_ipi_hook)(int phys_apicid, | 216 | void (*startup_ipi_hook)(int phys_apicid, |
236 | unsigned long start_eip, | 217 | unsigned long start_eip, |
237 | unsigned long start_esp); | 218 | unsigned long start_esp); |
@@ -239,15 +220,6 @@ struct pv_apic_ops { | |||
239 | }; | 220 | }; |
240 | 221 | ||
241 | struct pv_mmu_ops { | 222 | struct pv_mmu_ops { |
242 | /* | ||
243 | * Called before/after init_mm pagetable setup. setup_start | ||
244 | * may reset %cr3, and may pre-install parts of the pagetable; | ||
245 | * pagetable setup is expected to preserve any existing | ||
246 | * mapping. | ||
247 | */ | ||
248 | void (*pagetable_setup_start)(pgd_t *pgd_base); | ||
249 | void (*pagetable_setup_done)(pgd_t *pgd_base); | ||
250 | |||
251 | unsigned long (*read_cr2)(void); | 223 | unsigned long (*read_cr2)(void); |
252 | void (*write_cr2)(unsigned long); | 224 | void (*write_cr2)(unsigned long); |
253 | 225 | ||
@@ -522,10 +494,11 @@ int paravirt_disable_iospace(void); | |||
522 | #define EXTRA_CLOBBERS | 494 | #define EXTRA_CLOBBERS |
523 | #define VEXTRA_CLOBBERS | 495 | #define VEXTRA_CLOBBERS |
524 | #else /* CONFIG_X86_64 */ | 496 | #else /* CONFIG_X86_64 */ |
497 | /* [re]ax isn't an arg, but the return val */ | ||
525 | #define PVOP_VCALL_ARGS \ | 498 | #define PVOP_VCALL_ARGS \ |
526 | unsigned long __edi = __edi, __esi = __esi, \ | 499 | unsigned long __edi = __edi, __esi = __esi, \ |
527 | __edx = __edx, __ecx = __ecx | 500 | __edx = __edx, __ecx = __ecx, __eax = __eax |
528 | #define PVOP_CALL_ARGS PVOP_VCALL_ARGS, __eax | 501 | #define PVOP_CALL_ARGS PVOP_VCALL_ARGS |
529 | 502 | ||
530 | #define PVOP_CALL_ARG1(x) "D" ((unsigned long)(x)) | 503 | #define PVOP_CALL_ARG1(x) "D" ((unsigned long)(x)) |
531 | #define PVOP_CALL_ARG2(x) "S" ((unsigned long)(x)) | 504 | #define PVOP_CALL_ARG2(x) "S" ((unsigned long)(x)) |
@@ -537,6 +510,7 @@ int paravirt_disable_iospace(void); | |||
537 | "=c" (__ecx) | 510 | "=c" (__ecx) |
538 | #define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS, "=a" (__eax) | 511 | #define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS, "=a" (__eax) |
539 | 512 | ||
513 | /* void functions are still allowed [re]ax for scratch */ | ||
540 | #define PVOP_VCALLEE_CLOBBERS "=a" (__eax) | 514 | #define PVOP_VCALLEE_CLOBBERS "=a" (__eax) |
541 | #define PVOP_CALLEE_CLOBBERS PVOP_VCALLEE_CLOBBERS | 515 | #define PVOP_CALLEE_CLOBBERS PVOP_VCALLEE_CLOBBERS |
542 | 516 | ||
@@ -611,8 +585,8 @@ int paravirt_disable_iospace(void); | |||
611 | VEXTRA_CLOBBERS, \ | 585 | VEXTRA_CLOBBERS, \ |
612 | pre, post, ##__VA_ARGS__) | 586 | pre, post, ##__VA_ARGS__) |
613 | 587 | ||
614 | #define __PVOP_VCALLEESAVE(rettype, op, pre, post, ...) \ | 588 | #define __PVOP_VCALLEESAVE(op, pre, post, ...) \ |
615 | ____PVOP_CALL(rettype, op.func, CLBR_RET_REG, \ | 589 | ____PVOP_VCALL(op.func, CLBR_RET_REG, \ |
616 | PVOP_VCALLEE_CLOBBERS, , \ | 590 | PVOP_VCALLEE_CLOBBERS, , \ |
617 | pre, post, ##__VA_ARGS__) | 591 | pre, post, ##__VA_ARGS__) |
618 | 592 | ||
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h index 7af14e512f97..e2c1668dde7a 100644 --- a/arch/x86/include/asm/pat.h +++ b/arch/x86/include/asm/pat.h | |||
@@ -19,4 +19,9 @@ extern int free_memtype(u64 start, u64 end); | |||
19 | extern int kernel_map_sync_memtype(u64 base, unsigned long size, | 19 | extern int kernel_map_sync_memtype(u64 base, unsigned long size, |
20 | unsigned long flag); | 20 | unsigned long flag); |
21 | 21 | ||
22 | int io_reserve_memtype(resource_size_t start, resource_size_t end, | ||
23 | unsigned long *type); | ||
24 | |||
25 | void io_free_memtype(resource_size_t start, resource_size_t end); | ||
26 | |||
22 | #endif /* _ASM_X86_PAT_H */ | 27 | #endif /* _ASM_X86_PAT_H */ |
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 1ff685ca221c..ada8c201d513 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -48,7 +48,6 @@ extern unsigned int pcibios_assign_all_busses(void); | |||
48 | #else | 48 | #else |
49 | #define pcibios_assign_all_busses() 0 | 49 | #define pcibios_assign_all_busses() 0 |
50 | #endif | 50 | #endif |
51 | #define pcibios_scan_all_fns(a, b) 0 | ||
52 | 51 | ||
53 | extern unsigned long pci_mem_start; | 52 | extern unsigned long pci_mem_start; |
54 | #define PCIBIOS_MIN_IO 0x1000 | 53 | #define PCIBIOS_MIN_IO 0x1000 |
@@ -144,7 +143,11 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) | |||
144 | static inline const struct cpumask * | 143 | static inline const struct cpumask * |
145 | cpumask_of_pcibus(const struct pci_bus *bus) | 144 | cpumask_of_pcibus(const struct pci_bus *bus) |
146 | { | 145 | { |
147 | return cpumask_of_node(__pcibus_to_node(bus)); | 146 | int node; |
147 | |||
148 | node = __pcibus_to_node(bus); | ||
149 | return (node == -1) ? cpu_online_mask : | ||
150 | cpumask_of_node(node); | ||
148 | } | 151 | } |
149 | #endif | 152 | #endif |
150 | 153 | ||
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 04eacefcfd26..b65a36defeb7 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h | |||
@@ -168,15 +168,6 @@ do { \ | |||
168 | /* We can use this directly for local CPU (faster). */ | 168 | /* We can use this directly for local CPU (faster). */ |
169 | DECLARE_PER_CPU(unsigned long, this_cpu_off); | 169 | DECLARE_PER_CPU(unsigned long, this_cpu_off); |
170 | 170 | ||
171 | #ifdef CONFIG_NEED_MULTIPLE_NODES | ||
172 | void *pcpu_lpage_remapped(void *kaddr); | ||
173 | #else | ||
174 | static inline void *pcpu_lpage_remapped(void *kaddr) | ||
175 | { | ||
176 | return NULL; | ||
177 | } | ||
178 | #endif | ||
179 | |||
180 | #endif /* !__ASSEMBLY__ */ | 171 | #endif /* !__ASSEMBLY__ */ |
181 | 172 | ||
182 | #ifdef CONFIG_SMP | 173 | #ifdef CONFIG_SMP |
diff --git a/arch/x86/include/asm/perf_counter.h b/arch/x86/include/asm/perf_event.h index e7b7c938ae27..8d9f8548a870 100644 --- a/arch/x86/include/asm/perf_counter.h +++ b/arch/x86/include/asm/perf_event.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifndef _ASM_X86_PERF_COUNTER_H | 1 | #ifndef _ASM_X86_PERF_EVENT_H |
2 | #define _ASM_X86_PERF_COUNTER_H | 2 | #define _ASM_X86_PERF_EVENT_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Performance counter hw details: | 5 | * Performance event hw details: |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define X86_PMC_MAX_GENERIC 8 | 8 | #define X86_PMC_MAX_GENERIC 8 |
@@ -28,9 +28,20 @@ | |||
28 | */ | 28 | */ |
29 | #define ARCH_PERFMON_EVENT_MASK 0xffff | 29 | #define ARCH_PERFMON_EVENT_MASK 0xffff |
30 | 30 | ||
31 | /* | ||
32 | * filter mask to validate fixed counter events. | ||
33 | * the following filters disqualify for fixed counters: | ||
34 | * - inv | ||
35 | * - edge | ||
36 | * - cnt-mask | ||
37 | * The other filters are supported by fixed counters. | ||
38 | * The any-thread option is supported starting with v3. | ||
39 | */ | ||
40 | #define ARCH_PERFMON_EVENT_FILTER_MASK 0xff840000 | ||
41 | |||
31 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c | 42 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c |
32 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) | 43 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) |
33 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0 | 44 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0 |
34 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ | 45 | #define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ |
35 | (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) | 46 | (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) |
36 | 47 | ||
@@ -43,7 +54,7 @@ | |||
43 | union cpuid10_eax { | 54 | union cpuid10_eax { |
44 | struct { | 55 | struct { |
45 | unsigned int version_id:8; | 56 | unsigned int version_id:8; |
46 | unsigned int num_counters:8; | 57 | unsigned int num_events:8; |
47 | unsigned int bit_width:8; | 58 | unsigned int bit_width:8; |
48 | unsigned int mask_length:8; | 59 | unsigned int mask_length:8; |
49 | } split; | 60 | } split; |
@@ -52,7 +63,7 @@ union cpuid10_eax { | |||
52 | 63 | ||
53 | union cpuid10_edx { | 64 | union cpuid10_edx { |
54 | struct { | 65 | struct { |
55 | unsigned int num_counters_fixed:4; | 66 | unsigned int num_events_fixed:4; |
56 | unsigned int reserved:28; | 67 | unsigned int reserved:28; |
57 | } split; | 68 | } split; |
58 | unsigned int full; | 69 | unsigned int full; |
@@ -60,7 +71,7 @@ union cpuid10_edx { | |||
60 | 71 | ||
61 | 72 | ||
62 | /* | 73 | /* |
63 | * Fixed-purpose performance counters: | 74 | * Fixed-purpose performance events: |
64 | */ | 75 | */ |
65 | 76 | ||
66 | /* | 77 | /* |
@@ -87,22 +98,22 @@ union cpuid10_edx { | |||
87 | /* | 98 | /* |
88 | * We model BTS tracing as another fixed-mode PMC. | 99 | * We model BTS tracing as another fixed-mode PMC. |
89 | * | 100 | * |
90 | * We choose a value in the middle of the fixed counter range, since lower | 101 | * We choose a value in the middle of the fixed event range, since lower |
91 | * values are used by actual fixed counters and higher values are used | 102 | * values are used by actual fixed events and higher values are used |
92 | * to indicate other overflow conditions in the PERF_GLOBAL_STATUS msr. | 103 | * to indicate other overflow conditions in the PERF_GLOBAL_STATUS msr. |
93 | */ | 104 | */ |
94 | #define X86_PMC_IDX_FIXED_BTS (X86_PMC_IDX_FIXED + 16) | 105 | #define X86_PMC_IDX_FIXED_BTS (X86_PMC_IDX_FIXED + 16) |
95 | 106 | ||
96 | 107 | ||
97 | #ifdef CONFIG_PERF_COUNTERS | 108 | #ifdef CONFIG_PERF_EVENTS |
98 | extern void init_hw_perf_counters(void); | 109 | extern void init_hw_perf_events(void); |
99 | extern void perf_counters_lapic_init(void); | 110 | extern void perf_events_lapic_init(void); |
100 | 111 | ||
101 | #define PERF_COUNTER_INDEX_OFFSET 0 | 112 | #define PERF_EVENT_INDEX_OFFSET 0 |
102 | 113 | ||
103 | #else | 114 | #else |
104 | static inline void init_hw_perf_counters(void) { } | 115 | static inline void init_hw_perf_events(void) { } |
105 | static inline void perf_counters_lapic_init(void) { } | 116 | static inline void perf_events_lapic_init(void) { } |
106 | #endif | 117 | #endif |
107 | 118 | ||
108 | #endif /* _ASM_X86_PERF_COUNTER_H */ | 119 | #endif /* _ASM_X86_PERF_EVENT_H */ |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 4c5b51fdc788..af6fd360ab35 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -56,16 +56,6 @@ extern struct list_head pgd_list; | |||
56 | #define pte_update(mm, addr, ptep) do { } while (0) | 56 | #define pte_update(mm, addr, ptep) do { } while (0) |
57 | #define pte_update_defer(mm, addr, ptep) do { } while (0) | 57 | #define pte_update_defer(mm, addr, ptep) do { } while (0) |
58 | 58 | ||
59 | static inline void __init paravirt_pagetable_setup_start(pgd_t *base) | ||
60 | { | ||
61 | native_pagetable_setup_start(base); | ||
62 | } | ||
63 | |||
64 | static inline void __init paravirt_pagetable_setup_done(pgd_t *base) | ||
65 | { | ||
66 | native_pagetable_setup_done(base); | ||
67 | } | ||
68 | |||
69 | #define pgd_val(x) native_pgd_val(x) | 59 | #define pgd_val(x) native_pgd_val(x) |
70 | #define __pgd(x) native_make_pgd(x) | 60 | #define __pgd(x) native_make_pgd(x) |
71 | 61 | ||
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 54cb697f4900..d1f4a760be23 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h | |||
@@ -277,6 +277,7 @@ static inline pteval_t pte_flags(pte_t pte) | |||
277 | typedef struct page *pgtable_t; | 277 | typedef struct page *pgtable_t; |
278 | 278 | ||
279 | extern pteval_t __supported_pte_mask; | 279 | extern pteval_t __supported_pte_mask; |
280 | extern void set_nx(void); | ||
280 | extern int nx_enabled; | 281 | extern int nx_enabled; |
281 | 282 | ||
282 | #define pgprot_writecombine pgprot_writecombine | 283 | #define pgprot_writecombine pgprot_writecombine |
@@ -299,8 +300,8 @@ void set_pte_vaddr(unsigned long vaddr, pte_t pte); | |||
299 | extern void native_pagetable_setup_start(pgd_t *base); | 300 | extern void native_pagetable_setup_start(pgd_t *base); |
300 | extern void native_pagetable_setup_done(pgd_t *base); | 301 | extern void native_pagetable_setup_done(pgd_t *base); |
301 | #else | 302 | #else |
302 | static inline void native_pagetable_setup_start(pgd_t *base) {} | 303 | #define native_pagetable_setup_start x86_init_pgd_noop |
303 | static inline void native_pagetable_setup_done(pgd_t *base) {} | 304 | #define native_pagetable_setup_done x86_init_pgd_noop |
304 | #endif | 305 | #endif |
305 | 306 | ||
306 | struct seq_file; | 307 | struct seq_file; |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 1153037ae9ff..61aafb71c7ef 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -27,6 +27,7 @@ struct mm_struct; | |||
27 | #include <linux/cpumask.h> | 27 | #include <linux/cpumask.h> |
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | #include <linux/threads.h> | 29 | #include <linux/threads.h> |
30 | #include <linux/math64.h> | ||
30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
31 | 32 | ||
32 | #define HBP_NUM 4 | 33 | #define HBP_NUM 4 |
@@ -1020,4 +1021,35 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip, | |||
1020 | extern int get_tsc_mode(unsigned long adr); | 1021 | extern int get_tsc_mode(unsigned long adr); |
1021 | extern int set_tsc_mode(unsigned int val); | 1022 | extern int set_tsc_mode(unsigned int val); |
1022 | 1023 | ||
1024 | extern int amd_get_nb_id(int cpu); | ||
1025 | |||
1026 | struct aperfmperf { | ||
1027 | u64 aperf, mperf; | ||
1028 | }; | ||
1029 | |||
1030 | static inline void get_aperfmperf(struct aperfmperf *am) | ||
1031 | { | ||
1032 | WARN_ON_ONCE(!boot_cpu_has(X86_FEATURE_APERFMPERF)); | ||
1033 | |||
1034 | rdmsrl(MSR_IA32_APERF, am->aperf); | ||
1035 | rdmsrl(MSR_IA32_MPERF, am->mperf); | ||
1036 | } | ||
1037 | |||
1038 | #define APERFMPERF_SHIFT 10 | ||
1039 | |||
1040 | static inline | ||
1041 | unsigned long calc_aperfmperf_ratio(struct aperfmperf *old, | ||
1042 | struct aperfmperf *new) | ||
1043 | { | ||
1044 | u64 aperf = new->aperf - old->aperf; | ||
1045 | u64 mperf = new->mperf - old->mperf; | ||
1046 | unsigned long ratio = aperf; | ||
1047 | |||
1048 | mperf >>= APERFMPERF_SHIFT; | ||
1049 | if (mperf) | ||
1050 | ratio = div64_u64(aperf, mperf); | ||
1051 | |||
1052 | return ratio; | ||
1053 | } | ||
1054 | |||
1023 | #endif /* _ASM_X86_PROCESSOR_H */ | 1055 | #endif /* _ASM_X86_PROCESSOR_H */ |
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index 4093d1ed6db2..18e496c98ff0 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h | |||
@@ -5,43 +5,6 @@ | |||
5 | 5 | ||
6 | #define COMMAND_LINE_SIZE 2048 | 6 | #define COMMAND_LINE_SIZE 2048 |
7 | 7 | ||
8 | #ifndef __ASSEMBLY__ | ||
9 | |||
10 | /* | ||
11 | * Any setup quirks to be performed? | ||
12 | */ | ||
13 | struct mpc_cpu; | ||
14 | struct mpc_bus; | ||
15 | struct mpc_oemtable; | ||
16 | |||
17 | struct x86_quirks { | ||
18 | int (*arch_pre_time_init)(void); | ||
19 | int (*arch_time_init)(void); | ||
20 | int (*arch_pre_intr_init)(void); | ||
21 | int (*arch_intr_init)(void); | ||
22 | int (*arch_trap_init)(void); | ||
23 | char * (*arch_memory_setup)(void); | ||
24 | int (*mach_get_smp_config)(unsigned int early); | ||
25 | int (*mach_find_smp_config)(unsigned int reserve); | ||
26 | |||
27 | int *mpc_record; | ||
28 | int (*mpc_apic_id)(struct mpc_cpu *m); | ||
29 | void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name); | ||
30 | void (*mpc_oem_pci_bus)(struct mpc_bus *m); | ||
31 | void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, | ||
32 | unsigned short oemsize); | ||
33 | int (*setup_ioapic_ids)(void); | ||
34 | }; | ||
35 | |||
36 | extern void x86_quirk_intr_init(void); | ||
37 | |||
38 | extern void x86_quirk_trap_init(void); | ||
39 | |||
40 | extern void x86_quirk_pre_time_init(void); | ||
41 | extern void x86_quirk_time_init(void); | ||
42 | |||
43 | #endif /* __ASSEMBLY__ */ | ||
44 | |||
45 | #ifdef __i386__ | 8 | #ifdef __i386__ |
46 | 9 | ||
47 | #include <linux/pfn.h> | 10 | #include <linux/pfn.h> |
@@ -61,6 +24,7 @@ extern void x86_quirk_time_init(void); | |||
61 | 24 | ||
62 | #ifndef __ASSEMBLY__ | 25 | #ifndef __ASSEMBLY__ |
63 | #include <asm/bootparam.h> | 26 | #include <asm/bootparam.h> |
27 | #include <asm/x86_init.h> | ||
64 | 28 | ||
65 | /* Interrupt control for vSMPowered x86_64 systems */ | 29 | /* Interrupt control for vSMPowered x86_64 systems */ |
66 | #ifdef CONFIG_X86_64 | 30 | #ifdef CONFIG_X86_64 |
@@ -79,11 +43,16 @@ static inline void visws_early_detect(void) { } | |||
79 | static inline int is_visws_box(void) { return 0; } | 43 | static inline int is_visws_box(void) { return 0; } |
80 | #endif | 44 | #endif |
81 | 45 | ||
82 | extern struct x86_quirks *x86_quirks; | ||
83 | extern unsigned long saved_video_mode; | 46 | extern unsigned long saved_video_mode; |
84 | 47 | ||
85 | #ifndef CONFIG_PARAVIRT | 48 | extern void reserve_standard_io_resources(void); |
86 | #define paravirt_post_allocator_init() do {} while (0) | 49 | extern void i386_reserve_resources(void); |
50 | extern void setup_default_timer_irq(void); | ||
51 | |||
52 | #ifdef CONFIG_X86_MRST | ||
53 | extern void x86_mrst_early_setup(void); | ||
54 | #else | ||
55 | static inline void x86_mrst_early_setup(void) { } | ||
87 | #endif | 56 | #endif |
88 | 57 | ||
89 | #ifndef _SETUP | 58 | #ifndef _SETUP |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 6a84ed166aec..1e796782cd7b 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -121,7 +121,6 @@ static inline void arch_send_call_function_single_ipi(int cpu) | |||
121 | smp_ops.send_call_func_single_ipi(cpu); | 121 | smp_ops.send_call_func_single_ipi(cpu); |
122 | } | 122 | } |
123 | 123 | ||
124 | #define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask | ||
125 | static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask) | 124 | static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask) |
126 | { | 125 | { |
127 | smp_ops.send_call_func_ipi(mask); | 126 | smp_ops.send_call_func_ipi(mask); |
diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h index c86f452256de..ae907e617181 100644 --- a/arch/x86/include/asm/string_32.h +++ b/arch/x86/include/asm/string_32.h | |||
@@ -65,7 +65,6 @@ static __always_inline void *__constant_memcpy(void *to, const void *from, | |||
65 | case 4: | 65 | case 4: |
66 | *(int *)to = *(int *)from; | 66 | *(int *)to = *(int *)from; |
67 | return to; | 67 | return to; |
68 | |||
69 | case 3: | 68 | case 3: |
70 | *(short *)to = *(short *)from; | 69 | *(short *)to = *(short *)from; |
71 | *((char *)to + 2) = *((char *)from + 2); | 70 | *((char *)to + 2) = *((char *)from + 2); |
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h index d82f39bb7905..8d33bc5462d1 100644 --- a/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Access to user system call parameters and results | 2 | * Access to user system call parameters and results |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. |
5 | * | 5 | * |
6 | * This copyrighted material is made available to anyone wishing to use, | 6 | * This copyrighted material is made available to anyone wishing to use, |
7 | * modify, copy, or redistribute it subject to the terms and conditions | 7 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -16,13 +16,13 @@ | |||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | 18 | ||
19 | static inline long syscall_get_nr(struct task_struct *task, | 19 | /* |
20 | struct pt_regs *regs) | 20 | * Only the low 32 bits of orig_ax are meaningful, so we return int. |
21 | * This importantly ignores the high bits on 64-bit, so comparisons | ||
22 | * sign-extend the low 32 bits. | ||
23 | */ | ||
24 | static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) | ||
21 | { | 25 | { |
22 | /* | ||
23 | * We always sign-extend a -1 value being set here, | ||
24 | * so this is always either -1L or a syscall number. | ||
25 | */ | ||
26 | return regs->orig_ax; | 26 | return regs->orig_ax; |
27 | } | 27 | } |
28 | 28 | ||
diff --git a/arch/x86/include/asm/time.h b/arch/x86/include/asm/time.h index 50c733aac421..7bdec4e9b739 100644 --- a/arch/x86/include/asm/time.h +++ b/arch/x86/include/asm/time.h | |||
@@ -4,60 +4,7 @@ | |||
4 | extern void hpet_time_init(void); | 4 | extern void hpet_time_init(void); |
5 | 5 | ||
6 | #include <asm/mc146818rtc.h> | 6 | #include <asm/mc146818rtc.h> |
7 | #ifdef CONFIG_X86_32 | ||
8 | #include <linux/efi.h> | ||
9 | |||
10 | static inline unsigned long native_get_wallclock(void) | ||
11 | { | ||
12 | unsigned long retval; | ||
13 | |||
14 | if (efi_enabled) | ||
15 | retval = efi_get_time(); | ||
16 | else | ||
17 | retval = mach_get_cmos_time(); | ||
18 | |||
19 | return retval; | ||
20 | } | ||
21 | |||
22 | static inline int native_set_wallclock(unsigned long nowtime) | ||
23 | { | ||
24 | int retval; | ||
25 | |||
26 | if (efi_enabled) | ||
27 | retval = efi_set_rtc_mmss(nowtime); | ||
28 | else | ||
29 | retval = mach_set_rtc_mmss(nowtime); | ||
30 | |||
31 | return retval; | ||
32 | } | ||
33 | |||
34 | #else | ||
35 | extern void native_time_init_hook(void); | ||
36 | |||
37 | static inline unsigned long native_get_wallclock(void) | ||
38 | { | ||
39 | return mach_get_cmos_time(); | ||
40 | } | ||
41 | |||
42 | static inline int native_set_wallclock(unsigned long nowtime) | ||
43 | { | ||
44 | return mach_set_rtc_mmss(nowtime); | ||
45 | } | ||
46 | |||
47 | #endif | ||
48 | 7 | ||
49 | extern void time_init(void); | 8 | extern void time_init(void); |
50 | 9 | ||
51 | #ifdef CONFIG_PARAVIRT | ||
52 | #include <asm/paravirt.h> | ||
53 | #else /* !CONFIG_PARAVIRT */ | ||
54 | |||
55 | #define get_wallclock() native_get_wallclock() | ||
56 | #define set_wallclock(x) native_set_wallclock(x) | ||
57 | #define choose_time_init() hpet_time_init | ||
58 | |||
59 | #endif /* CONFIG_PARAVIRT */ | ||
60 | |||
61 | extern unsigned long __init calibrate_cpu(void); | ||
62 | |||
63 | #endif /* _ASM_X86_TIME_H */ | 10 | #endif /* _ASM_X86_TIME_H */ |
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h index 20ca9c4d4686..5469630b27f5 100644 --- a/arch/x86/include/asm/timer.h +++ b/arch/x86/include/asm/timer.h | |||
@@ -8,20 +8,16 @@ | |||
8 | #define TICK_SIZE (tick_nsec / 1000) | 8 | #define TICK_SIZE (tick_nsec / 1000) |
9 | 9 | ||
10 | unsigned long long native_sched_clock(void); | 10 | unsigned long long native_sched_clock(void); |
11 | unsigned long native_calibrate_tsc(void); | 11 | extern int recalibrate_cpu_khz(void); |
12 | 12 | ||
13 | #ifdef CONFIG_X86_32 | 13 | #if defined(CONFIG_X86_32) && defined(CONFIG_X86_IO_APIC) |
14 | extern int timer_ack; | 14 | extern int timer_ack; |
15 | extern irqreturn_t timer_interrupt(int irq, void *dev_id); | 15 | #else |
16 | #endif /* CONFIG_X86_32 */ | 16 | # define timer_ack (0) |
17 | extern int recalibrate_cpu_khz(void); | 17 | #endif |
18 | 18 | ||
19 | extern int no_timer_check; | 19 | extern int no_timer_check; |
20 | 20 | ||
21 | #ifndef CONFIG_PARAVIRT | ||
22 | #define calibrate_tsc() native_calibrate_tsc() | ||
23 | #endif | ||
24 | |||
25 | /* Accelerators for sched_clock() | 21 | /* Accelerators for sched_clock() |
26 | * convert from cycles(64bits) => nanoseconds (64bits) | 22 | * convert from cycles(64bits) => nanoseconds (64bits) |
27 | * basic equation: | 23 | * basic equation: |
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 26d06e052a18..25a92842dd99 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
@@ -116,15 +116,11 @@ extern unsigned long node_remap_size[]; | |||
116 | 116 | ||
117 | # define SD_CACHE_NICE_TRIES 1 | 117 | # define SD_CACHE_NICE_TRIES 1 |
118 | # define SD_IDLE_IDX 1 | 118 | # define SD_IDLE_IDX 1 |
119 | # define SD_NEWIDLE_IDX 2 | ||
120 | # define SD_FORKEXEC_IDX 0 | ||
121 | 119 | ||
122 | #else | 120 | #else |
123 | 121 | ||
124 | # define SD_CACHE_NICE_TRIES 2 | 122 | # define SD_CACHE_NICE_TRIES 2 |
125 | # define SD_IDLE_IDX 2 | 123 | # define SD_IDLE_IDX 2 |
126 | # define SD_NEWIDLE_IDX 2 | ||
127 | # define SD_FORKEXEC_IDX 1 | ||
128 | 124 | ||
129 | #endif | 125 | #endif |
130 | 126 | ||
@@ -137,22 +133,20 @@ extern unsigned long node_remap_size[]; | |||
137 | .cache_nice_tries = SD_CACHE_NICE_TRIES, \ | 133 | .cache_nice_tries = SD_CACHE_NICE_TRIES, \ |
138 | .busy_idx = 3, \ | 134 | .busy_idx = 3, \ |
139 | .idle_idx = SD_IDLE_IDX, \ | 135 | .idle_idx = SD_IDLE_IDX, \ |
140 | .newidle_idx = SD_NEWIDLE_IDX, \ | 136 | .newidle_idx = 0, \ |
141 | .wake_idx = 1, \ | 137 | .wake_idx = 0, \ |
142 | .forkexec_idx = SD_FORKEXEC_IDX, \ | 138 | .forkexec_idx = 0, \ |
143 | \ | 139 | \ |
144 | .flags = 1*SD_LOAD_BALANCE \ | 140 | .flags = 1*SD_LOAD_BALANCE \ |
145 | | 1*SD_BALANCE_NEWIDLE \ | 141 | | 1*SD_BALANCE_NEWIDLE \ |
146 | | 1*SD_BALANCE_EXEC \ | 142 | | 1*SD_BALANCE_EXEC \ |
147 | | 1*SD_BALANCE_FORK \ | 143 | | 1*SD_BALANCE_FORK \ |
148 | | 0*SD_WAKE_IDLE \ | 144 | | 0*SD_BALANCE_WAKE \ |
149 | | 1*SD_WAKE_AFFINE \ | 145 | | 1*SD_WAKE_AFFINE \ |
150 | | 1*SD_WAKE_BALANCE \ | ||
151 | | 0*SD_SHARE_CPUPOWER \ | 146 | | 0*SD_SHARE_CPUPOWER \ |
152 | | 0*SD_POWERSAVINGS_BALANCE \ | 147 | | 0*SD_POWERSAVINGS_BALANCE \ |
153 | | 0*SD_SHARE_PKG_RESOURCES \ | 148 | | 0*SD_SHARE_PKG_RESOURCES \ |
154 | | 1*SD_SERIALIZE \ | 149 | | 1*SD_SERIALIZE \ |
155 | | 1*SD_WAKE_IDLE_FAR \ | ||
156 | | 0*SD_PREFER_SIBLING \ | 150 | | 0*SD_PREFER_SIBLING \ |
157 | , \ | 151 | , \ |
158 | .last_balance = jiffies, \ | 152 | .last_balance = jiffies, \ |
@@ -171,21 +165,11 @@ static inline int numa_node_id(void) | |||
171 | return 0; | 165 | return 0; |
172 | } | 166 | } |
173 | 167 | ||
174 | static inline int cpu_to_node(int cpu) | ||
175 | { | ||
176 | return 0; | ||
177 | } | ||
178 | |||
179 | static inline int early_cpu_to_node(int cpu) | 168 | static inline int early_cpu_to_node(int cpu) |
180 | { | 169 | { |
181 | return 0; | 170 | return 0; |
182 | } | 171 | } |
183 | 172 | ||
184 | static inline const struct cpumask *cpumask_of_node(int node) | ||
185 | { | ||
186 | return cpu_online_mask; | ||
187 | } | ||
188 | |||
189 | static inline void setup_node_to_cpumask_map(void) { } | 173 | static inline void setup_node_to_cpumask_map(void) { } |
190 | 174 | ||
191 | #endif | 175 | #endif |
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h index 38ae163cc91b..c0427295e8f5 100644 --- a/arch/x86/include/asm/tsc.h +++ b/arch/x86/include/asm/tsc.h | |||
@@ -48,7 +48,8 @@ static __always_inline cycles_t vget_cycles(void) | |||
48 | extern void tsc_init(void); | 48 | extern void tsc_init(void); |
49 | extern void mark_tsc_unstable(char *reason); | 49 | extern void mark_tsc_unstable(char *reason); |
50 | extern int unsynchronized_tsc(void); | 50 | extern int unsynchronized_tsc(void); |
51 | int check_tsc_unstable(void); | 51 | extern int check_tsc_unstable(void); |
52 | extern unsigned long native_calibrate_tsc(void); | ||
52 | 53 | ||
53 | /* | 54 | /* |
54 | * Boot-time check whether the TSCs are synchronized across | 55 | * Boot-time check whether the TSCs are synchronized across |
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h index 5e06259e90e5..632fb44b4cb5 100644 --- a/arch/x86/include/asm/uaccess_32.h +++ b/arch/x86/include/asm/uaccess_32.h | |||
@@ -33,7 +33,7 @@ unsigned long __must_check __copy_from_user_ll_nocache_nozero | |||
33 | * Copy data from kernel space to user space. Caller must check | 33 | * Copy data from kernel space to user space. Caller must check |
34 | * the specified block with access_ok() before calling this function. | 34 | * the specified block with access_ok() before calling this function. |
35 | * The caller should also make sure he pins the user space address | 35 | * The caller should also make sure he pins the user space address |
36 | * so that the we don't result in page fault and sleep. | 36 | * so that we don't result in page fault and sleep. |
37 | * | 37 | * |
38 | * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault | 38 | * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault |
39 | * we return the initial request size (1, 2 or 4), as copy_*_user should do. | 39 | * we return the initial request size (1, 2 or 4), as copy_*_user should do. |
diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index 8deaada61bc8..6fb3c209a7e3 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h | |||
@@ -341,7 +341,7 @@ | |||
341 | #define __NR_preadv 333 | 341 | #define __NR_preadv 333 |
342 | #define __NR_pwritev 334 | 342 | #define __NR_pwritev 334 |
343 | #define __NR_rt_tgsigqueueinfo 335 | 343 | #define __NR_rt_tgsigqueueinfo 335 |
344 | #define __NR_perf_counter_open 336 | 344 | #define __NR_perf_event_open 336 |
345 | 345 | ||
346 | #ifdef __KERNEL__ | 346 | #ifdef __KERNEL__ |
347 | 347 | ||
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index b9f3c60de5f7..8d3ad0adbc68 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
@@ -659,8 +659,8 @@ __SYSCALL(__NR_preadv, sys_preadv) | |||
659 | __SYSCALL(__NR_pwritev, sys_pwritev) | 659 | __SYSCALL(__NR_pwritev, sys_pwritev) |
660 | #define __NR_rt_tgsigqueueinfo 297 | 660 | #define __NR_rt_tgsigqueueinfo 297 |
661 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) | 661 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) |
662 | #define __NR_perf_counter_open 298 | 662 | #define __NR_perf_event_open 298 |
663 | __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) | 663 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) |
664 | 664 | ||
665 | #ifndef __NO_STUBS | 665 | #ifndef __NO_STUBS |
666 | #define __ARCH_WANT_OLD_READDIR | 666 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 77a68505419a..04eb6c958b9d 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/numa.h> | 15 | #include <linux/numa.h> |
16 | #include <linux/percpu.h> | 16 | #include <linux/percpu.h> |
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/io.h> | ||
18 | #include <asm/types.h> | 19 | #include <asm/types.h> |
19 | #include <asm/percpu.h> | 20 | #include <asm/percpu.h> |
20 | #include <asm/uv/uv_mmrs.h> | 21 | #include <asm/uv/uv_mmrs.h> |
@@ -258,13 +259,13 @@ static inline unsigned long *uv_global_mmr32_address(int pnode, | |||
258 | static inline void uv_write_global_mmr32(int pnode, unsigned long offset, | 259 | static inline void uv_write_global_mmr32(int pnode, unsigned long offset, |
259 | unsigned long val) | 260 | unsigned long val) |
260 | { | 261 | { |
261 | *uv_global_mmr32_address(pnode, offset) = val; | 262 | writeq(val, uv_global_mmr32_address(pnode, offset)); |
262 | } | 263 | } |
263 | 264 | ||
264 | static inline unsigned long uv_read_global_mmr32(int pnode, | 265 | static inline unsigned long uv_read_global_mmr32(int pnode, |
265 | unsigned long offset) | 266 | unsigned long offset) |
266 | { | 267 | { |
267 | return *uv_global_mmr32_address(pnode, offset); | 268 | return readq(uv_global_mmr32_address(pnode, offset)); |
268 | } | 269 | } |
269 | 270 | ||
270 | /* | 271 | /* |
@@ -281,13 +282,13 @@ static inline unsigned long *uv_global_mmr64_address(int pnode, | |||
281 | static inline void uv_write_global_mmr64(int pnode, unsigned long offset, | 282 | static inline void uv_write_global_mmr64(int pnode, unsigned long offset, |
282 | unsigned long val) | 283 | unsigned long val) |
283 | { | 284 | { |
284 | *uv_global_mmr64_address(pnode, offset) = val; | 285 | writeq(val, uv_global_mmr64_address(pnode, offset)); |
285 | } | 286 | } |
286 | 287 | ||
287 | static inline unsigned long uv_read_global_mmr64(int pnode, | 288 | static inline unsigned long uv_read_global_mmr64(int pnode, |
288 | unsigned long offset) | 289 | unsigned long offset) |
289 | { | 290 | { |
290 | return *uv_global_mmr64_address(pnode, offset); | 291 | return readq(uv_global_mmr64_address(pnode, offset)); |
291 | } | 292 | } |
292 | 293 | ||
293 | /* | 294 | /* |
@@ -301,22 +302,22 @@ static inline unsigned long *uv_local_mmr_address(unsigned long offset) | |||
301 | 302 | ||
302 | static inline unsigned long uv_read_local_mmr(unsigned long offset) | 303 | static inline unsigned long uv_read_local_mmr(unsigned long offset) |
303 | { | 304 | { |
304 | return *uv_local_mmr_address(offset); | 305 | return readq(uv_local_mmr_address(offset)); |
305 | } | 306 | } |
306 | 307 | ||
307 | static inline void uv_write_local_mmr(unsigned long offset, unsigned long val) | 308 | static inline void uv_write_local_mmr(unsigned long offset, unsigned long val) |
308 | { | 309 | { |
309 | *uv_local_mmr_address(offset) = val; | 310 | writeq(val, uv_local_mmr_address(offset)); |
310 | } | 311 | } |
311 | 312 | ||
312 | static inline unsigned char uv_read_local_mmr8(unsigned long offset) | 313 | static inline unsigned char uv_read_local_mmr8(unsigned long offset) |
313 | { | 314 | { |
314 | return *((unsigned char *)uv_local_mmr_address(offset)); | 315 | return readb(uv_local_mmr_address(offset)); |
315 | } | 316 | } |
316 | 317 | ||
317 | static inline void uv_write_local_mmr8(unsigned long offset, unsigned char val) | 318 | static inline void uv_write_local_mmr8(unsigned long offset, unsigned char val) |
318 | { | 319 | { |
319 | *((unsigned char *)uv_local_mmr_address(offset)) = val; | 320 | writeb(val, uv_local_mmr_address(offset)); |
320 | } | 321 | } |
321 | 322 | ||
322 | /* | 323 | /* |
@@ -422,7 +423,7 @@ static inline void uv_hub_send_ipi(int pnode, int apicid, int vector) | |||
422 | unsigned long val; | 423 | unsigned long val; |
423 | 424 | ||
424 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | 425 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
425 | ((apicid & 0x3f) << UVH_IPI_INT_APIC_ID_SHFT) | | 426 | ((apicid) << UVH_IPI_INT_APIC_ID_SHFT) | |
426 | (vector << UVH_IPI_INT_VECTOR_SHFT); | 427 | (vector << UVH_IPI_INT_VECTOR_SHFT); |
427 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | 428 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
428 | } | 429 | } |
diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h index dc27a69e5d2a..3d61e204826f 100644 --- a/arch/x86/include/asm/vgtod.h +++ b/arch/x86/include/asm/vgtod.h | |||
@@ -21,6 +21,7 @@ struct vsyscall_gtod_data { | |||
21 | u32 shift; | 21 | u32 shift; |
22 | } clock; | 22 | } clock; |
23 | struct timespec wall_to_monotonic; | 23 | struct timespec wall_to_monotonic; |
24 | struct timespec wall_time_coarse; | ||
24 | }; | 25 | }; |
25 | extern struct vsyscall_gtod_data __vsyscall_gtod_data | 26 | extern struct vsyscall_gtod_data __vsyscall_gtod_data |
26 | __section_vsyscall_gtod_data; | 27 | __section_vsyscall_gtod_data; |
diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index c11b7e100d83..e49ed6d2fd4e 100644 --- a/arch/x86/include/asm/vmware.h +++ b/arch/x86/include/asm/vmware.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #ifndef ASM_X86__VMWARE_H | 20 | #ifndef ASM_X86__VMWARE_H |
21 | #define ASM_X86__VMWARE_H | 21 | #define ASM_X86__VMWARE_H |
22 | 22 | ||
23 | extern unsigned long vmware_get_tsc_khz(void); | 23 | extern void vmware_platform_setup(void); |
24 | extern int vmware_platform(void); | 24 | extern int vmware_platform(void); |
25 | extern void vmware_set_feature_bits(struct cpuinfo_x86 *c); | 25 | extern void vmware_set_feature_bits(struct cpuinfo_x86 *c); |
26 | 26 | ||
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h new file mode 100644 index 000000000000..2c756fd4ab0e --- /dev/null +++ b/arch/x86/include/asm/x86_init.h | |||
@@ -0,0 +1,133 @@ | |||
1 | #ifndef _ASM_X86_PLATFORM_H | ||
2 | #define _ASM_X86_PLATFORM_H | ||
3 | |||
4 | #include <asm/pgtable_types.h> | ||
5 | #include <asm/bootparam.h> | ||
6 | |||
7 | struct mpc_bus; | ||
8 | struct mpc_cpu; | ||
9 | struct mpc_table; | ||
10 | |||
11 | /** | ||
12 | * struct x86_init_mpparse - platform specific mpparse ops | ||
13 | * @mpc_record: platform specific mpc record accounting | ||
14 | * @setup_ioapic_ids: platform specific ioapic id override | ||
15 | * @mpc_apic_id: platform specific mpc apic id assignment | ||
16 | * @smp_read_mpc_oem: platform specific oem mpc table setup | ||
17 | * @mpc_oem_pci_bus: platform specific pci bus setup (default NULL) | ||
18 | * @mpc_oem_bus_info: platform specific mpc bus info | ||
19 | * @find_smp_config: find the smp configuration | ||
20 | * @get_smp_config: get the smp configuration | ||
21 | */ | ||
22 | struct x86_init_mpparse { | ||
23 | void (*mpc_record)(unsigned int mode); | ||
24 | void (*setup_ioapic_ids)(void); | ||
25 | int (*mpc_apic_id)(struct mpc_cpu *m); | ||
26 | void (*smp_read_mpc_oem)(struct mpc_table *mpc); | ||
27 | void (*mpc_oem_pci_bus)(struct mpc_bus *m); | ||
28 | void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name); | ||
29 | void (*find_smp_config)(unsigned int reserve); | ||
30 | void (*get_smp_config)(unsigned int early); | ||
31 | }; | ||
32 | |||
33 | /** | ||
34 | * struct x86_init_resources - platform specific resource related ops | ||
35 | * @probe_roms: probe BIOS roms | ||
36 | * @reserve_resources: reserve the standard resources for the | ||
37 | * platform | ||
38 | * @memory_setup: platform specific memory setup | ||
39 | * | ||
40 | */ | ||
41 | struct x86_init_resources { | ||
42 | void (*probe_roms)(void); | ||
43 | void (*reserve_resources)(void); | ||
44 | char *(*memory_setup)(void); | ||
45 | }; | ||
46 | |||
47 | /** | ||
48 | * struct x86_init_irqs - platform specific interrupt setup | ||
49 | * @pre_vector_init: init code to run before interrupt vectors | ||
50 | * are set up. | ||
51 | * @intr_init: interrupt init code | ||
52 | * @trap_init: platform specific trap setup | ||
53 | */ | ||
54 | struct x86_init_irqs { | ||
55 | void (*pre_vector_init)(void); | ||
56 | void (*intr_init)(void); | ||
57 | void (*trap_init)(void); | ||
58 | }; | ||
59 | |||
60 | /** | ||
61 | * struct x86_init_oem - oem platform specific customizing functions | ||
62 | * @arch_setup: platform specific architecure setup | ||
63 | * @banner: print a platform specific banner | ||
64 | */ | ||
65 | struct x86_init_oem { | ||
66 | void (*arch_setup)(void); | ||
67 | void (*banner)(void); | ||
68 | }; | ||
69 | |||
70 | /** | ||
71 | * struct x86_init_paging - platform specific paging functions | ||
72 | * @pagetable_setup_start: platform specific pre paging_init() call | ||
73 | * @pagetable_setup_done: platform specific post paging_init() call | ||
74 | */ | ||
75 | struct x86_init_paging { | ||
76 | void (*pagetable_setup_start)(pgd_t *base); | ||
77 | void (*pagetable_setup_done)(pgd_t *base); | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * struct x86_init_timers - platform specific timer setup | ||
82 | * @setup_perpcu_clockev: set up the per cpu clock event device for the | ||
83 | * boot cpu | ||
84 | * @tsc_pre_init: platform function called before TSC init | ||
85 | * @timer_init: initialize the platform timer (default PIT/HPET) | ||
86 | */ | ||
87 | struct x86_init_timers { | ||
88 | void (*setup_percpu_clockev)(void); | ||
89 | void (*tsc_pre_init)(void); | ||
90 | void (*timer_init)(void); | ||
91 | }; | ||
92 | |||
93 | /** | ||
94 | * struct x86_init_ops - functions for platform specific setup | ||
95 | * | ||
96 | */ | ||
97 | struct x86_init_ops { | ||
98 | struct x86_init_resources resources; | ||
99 | struct x86_init_mpparse mpparse; | ||
100 | struct x86_init_irqs irqs; | ||
101 | struct x86_init_oem oem; | ||
102 | struct x86_init_paging paging; | ||
103 | struct x86_init_timers timers; | ||
104 | }; | ||
105 | |||
106 | /** | ||
107 | * struct x86_cpuinit_ops - platform specific cpu hotplug setups | ||
108 | * @setup_percpu_clockev: set up the per cpu clock event device | ||
109 | */ | ||
110 | struct x86_cpuinit_ops { | ||
111 | void (*setup_percpu_clockev)(void); | ||
112 | }; | ||
113 | |||
114 | /** | ||
115 | * struct x86_platform_ops - platform specific runtime functions | ||
116 | * @calibrate_tsc: calibrate TSC | ||
117 | * @get_wallclock: get time from HW clock like RTC etc. | ||
118 | * @set_wallclock: set time back to HW clock | ||
119 | */ | ||
120 | struct x86_platform_ops { | ||
121 | unsigned long (*calibrate_tsc)(void); | ||
122 | unsigned long (*get_wallclock)(void); | ||
123 | int (*set_wallclock)(unsigned long nowtime); | ||
124 | }; | ||
125 | |||
126 | extern struct x86_init_ops x86_init; | ||
127 | extern struct x86_cpuinit_ops x86_cpuinit; | ||
128 | extern struct x86_platform_ops x86_platform; | ||
129 | |||
130 | extern void x86_init_noop(void); | ||
131 | extern void x86_init_uint_noop(unsigned int unused); | ||
132 | |||
133 | #endif | ||