diff options
Diffstat (limited to 'arch/x86/include')
32 files changed, 466 insertions, 218 deletions
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 3ca9762e1649..3bf000fab0ae 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild | |||
@@ -5,6 +5,7 @@ genhdr-y += unistd_64.h | |||
5 | genhdr-y += unistd_x32.h | 5 | genhdr-y += unistd_x32.h |
6 | 6 | ||
7 | generic-y += clkdev.h | 7 | generic-y += clkdev.h |
8 | generic-y += early_ioremap.h | ||
9 | generic-y += cputime.h | 8 | generic-y += cputime.h |
9 | generic-y += early_ioremap.h | ||
10 | generic-y += mcs_spinlock.h | 10 | generic-y += mcs_spinlock.h |
11 | generic-y += scatterlist.h | ||
diff --git a/arch/x86/include/asm/acenv.h b/arch/x86/include/asm/acenv.h index 66873297e9f5..1b010a859b8b 100644 --- a/arch/x86/include/asm/acenv.h +++ b/arch/x86/include/asm/acenv.h | |||
@@ -18,8 +18,6 @@ | |||
18 | 18 | ||
19 | #define ACPI_FLUSH_CPU_CACHE() wbinvd() | 19 | #define ACPI_FLUSH_CPU_CACHE() wbinvd() |
20 | 20 | ||
21 | #ifdef CONFIG_ACPI | ||
22 | |||
23 | int __acpi_acquire_global_lock(unsigned int *lock); | 21 | int __acpi_acquire_global_lock(unsigned int *lock); |
24 | int __acpi_release_global_lock(unsigned int *lock); | 22 | int __acpi_release_global_lock(unsigned int *lock); |
25 | 23 | ||
@@ -44,6 +42,4 @@ int __acpi_release_global_lock(unsigned int *lock); | |||
44 | : "=r"(n_hi), "=r"(n_lo) \ | 42 | : "=r"(n_hi), "=r"(n_lo) \ |
45 | : "0"(n_hi), "1"(n_lo)) | 43 | : "0"(n_hi), "1"(n_lo)) |
46 | 44 | ||
47 | #endif | ||
48 | |||
49 | #endif /* _ASM_X86_ACENV_H */ | 45 | #endif /* _ASM_X86_ACENV_H */ |
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index e06225eda635..0ab4f9fd2687 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
@@ -121,6 +121,11 @@ static inline void arch_acpi_set_pdc_bits(u32 *buf) | |||
121 | buf[2] &= ~(ACPI_PDC_C_C2C3_FFH); | 121 | buf[2] &= ~(ACPI_PDC_C_C2C3_FFH); |
122 | } | 122 | } |
123 | 123 | ||
124 | static inline bool acpi_has_cpu_in_madt(void) | ||
125 | { | ||
126 | return !!acpi_lapic; | ||
127 | } | ||
128 | |||
124 | #else /* !CONFIG_ACPI */ | 129 | #else /* !CONFIG_ACPI */ |
125 | 130 | ||
126 | #define acpi_lapic 0 | 131 | #define acpi_lapic 0 |
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index 0a3f9c9f98d5..473bdbee378a 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h | |||
@@ -161,6 +161,20 @@ static inline int alternatives_text_reserved(void *start, void *end) | |||
161 | asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ | 161 | asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ |
162 | : : "i" (0), ## input) | 162 | : : "i" (0), ## input) |
163 | 163 | ||
164 | /* | ||
165 | * This is similar to alternative_input. But it has two features and | ||
166 | * respective instructions. | ||
167 | * | ||
168 | * If CPU has feature2, newinstr2 is used. | ||
169 | * Otherwise, if CPU has feature1, newinstr1 is used. | ||
170 | * Otherwise, oldinstr is used. | ||
171 | */ | ||
172 | #define alternative_input_2(oldinstr, newinstr1, feature1, newinstr2, \ | ||
173 | feature2, input...) \ | ||
174 | asm volatile(ALTERNATIVE_2(oldinstr, newinstr1, feature1, \ | ||
175 | newinstr2, feature2) \ | ||
176 | : : "i" (0), ## input) | ||
177 | |||
164 | /* Like alternative_input, but with a single output argument */ | 178 | /* Like alternative_input, but with a single output argument */ |
165 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | 179 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ |
166 | asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ | 180 | asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ |
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 79752f2bdec5..465b309af254 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -85,14 +85,6 @@ static inline bool apic_from_smp_config(void) | |||
85 | #include <asm/paravirt.h> | 85 | #include <asm/paravirt.h> |
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | #ifdef CONFIG_X86_64 | ||
89 | extern int is_vsmp_box(void); | ||
90 | #else | ||
91 | static inline int is_vsmp_box(void) | ||
92 | { | ||
93 | return 0; | ||
94 | } | ||
95 | #endif | ||
96 | extern int setup_profiling_timer(unsigned int); | 88 | extern int setup_profiling_timer(unsigned int); |
97 | 89 | ||
98 | static inline void native_apic_mem_write(u32 reg, u32 v) | 90 | static inline void native_apic_mem_write(u32 reg, u32 v) |
@@ -300,7 +292,6 @@ struct apic { | |||
300 | 292 | ||
301 | int dest_logical; | 293 | int dest_logical; |
302 | unsigned long (*check_apicid_used)(physid_mask_t *map, int apicid); | 294 | unsigned long (*check_apicid_used)(physid_mask_t *map, int apicid); |
303 | unsigned long (*check_apicid_present)(int apicid); | ||
304 | 295 | ||
305 | void (*vector_allocation_domain)(int cpu, struct cpumask *retmask, | 296 | void (*vector_allocation_domain)(int cpu, struct cpumask *retmask, |
306 | const struct cpumask *mask); | 297 | const struct cpumask *mask); |
@@ -309,21 +300,11 @@ struct apic { | |||
309 | void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap); | 300 | void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap); |
310 | 301 | ||
311 | void (*setup_apic_routing)(void); | 302 | void (*setup_apic_routing)(void); |
312 | int (*multi_timer_check)(int apic, int irq); | ||
313 | int (*cpu_present_to_apicid)(int mps_cpu); | 303 | int (*cpu_present_to_apicid)(int mps_cpu); |
314 | void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap); | 304 | void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap); |
315 | void (*setup_portio_remap)(void); | ||
316 | int (*check_phys_apicid_present)(int phys_apicid); | 305 | int (*check_phys_apicid_present)(int phys_apicid); |
317 | void (*enable_apic_mode)(void); | ||
318 | int (*phys_pkg_id)(int cpuid_apic, int index_msb); | 306 | int (*phys_pkg_id)(int cpuid_apic, int index_msb); |
319 | 307 | ||
320 | /* | ||
321 | * When one of the next two hooks returns 1 the apic | ||
322 | * is switched to this. Essentially they are additional | ||
323 | * probe functions: | ||
324 | */ | ||
325 | int (*mps_oem_check)(struct mpc_table *mpc, char *oem, char *productid); | ||
326 | |||
327 | unsigned int (*get_apic_id)(unsigned long x); | 308 | unsigned int (*get_apic_id)(unsigned long x); |
328 | unsigned long (*set_apic_id)(unsigned int id); | 309 | unsigned long (*set_apic_id)(unsigned int id); |
329 | unsigned long apic_id_mask; | 310 | unsigned long apic_id_mask; |
@@ -343,11 +324,7 @@ struct apic { | |||
343 | /* wakeup_secondary_cpu */ | 324 | /* wakeup_secondary_cpu */ |
344 | int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); | 325 | int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); |
345 | 326 | ||
346 | int trampoline_phys_low; | ||
347 | int trampoline_phys_high; | ||
348 | |||
349 | bool wait_for_init_deassert; | 327 | bool wait_for_init_deassert; |
350 | void (*smp_callin_clear_local_apic)(void); | ||
351 | void (*inquire_remote_apic)(int apicid); | 328 | void (*inquire_remote_apic)(int apicid); |
352 | 329 | ||
353 | /* apic ops */ | 330 | /* apic ops */ |
@@ -378,14 +355,6 @@ struct apic { | |||
378 | * won't be applied properly during early boot in this case. | 355 | * won't be applied properly during early boot in this case. |
379 | */ | 356 | */ |
380 | int (*x86_32_early_logical_apicid)(int cpu); | 357 | int (*x86_32_early_logical_apicid)(int cpu); |
381 | |||
382 | /* | ||
383 | * Optional method called from setup_local_APIC() after logical | ||
384 | * apicid is guaranteed to be known to initialize apicid -> node | ||
385 | * mapping if NUMA initialization hasn't done so already. Don't | ||
386 | * add new users. | ||
387 | */ | ||
388 | int (*x86_32_numa_cpu_node)(int cpu); | ||
389 | #endif | 358 | #endif |
390 | }; | 359 | }; |
391 | 360 | ||
@@ -496,14 +465,12 @@ static inline unsigned default_get_apic_id(unsigned long x) | |||
496 | } | 465 | } |
497 | 466 | ||
498 | /* | 467 | /* |
499 | * Warm reset vector default position: | 468 | * Warm reset vector position: |
500 | */ | 469 | */ |
501 | #define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467 | 470 | #define TRAMPOLINE_PHYS_LOW 0x467 |
502 | #define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469 | 471 | #define TRAMPOLINE_PHYS_HIGH 0x469 |
503 | 472 | ||
504 | #ifdef CONFIG_X86_64 | 473 | #ifdef CONFIG_X86_64 |
505 | extern int default_acpi_madt_oem_check(char *, char *); | ||
506 | |||
507 | extern void apic_send_IPI_self(int vector); | 474 | extern void apic_send_IPI_self(int vector); |
508 | 475 | ||
509 | DECLARE_PER_CPU(int, x2apic_extra_bits); | 476 | DECLARE_PER_CPU(int, x2apic_extra_bits); |
@@ -552,6 +519,8 @@ static inline int default_apic_id_valid(int apicid) | |||
552 | return (apicid < 255); | 519 | return (apicid < 255); |
553 | } | 520 | } |
554 | 521 | ||
522 | extern int default_acpi_madt_oem_check(char *, char *); | ||
523 | |||
555 | extern void default_setup_apic_routing(void); | 524 | extern void default_setup_apic_routing(void); |
556 | 525 | ||
557 | extern struct apic apic_noop; | 526 | extern struct apic apic_noop; |
@@ -635,11 +604,6 @@ static inline unsigned long default_check_apicid_used(physid_mask_t *map, int ap | |||
635 | return physid_isset(apicid, *map); | 604 | return physid_isset(apicid, *map); |
636 | } | 605 | } |
637 | 606 | ||
638 | static inline unsigned long default_check_apicid_present(int bit) | ||
639 | { | ||
640 | return physid_isset(bit, phys_cpu_present_map); | ||
641 | } | ||
642 | |||
643 | static inline void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) | 607 | static inline void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap) |
644 | { | 608 | { |
645 | *retmap = *phys_map; | 609 | *retmap = *phys_map; |
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index afcd35d331de..cfe3b954d5e4 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h | |||
@@ -497,8 +497,6 @@ static __always_inline int fls64(__u64 x) | |||
497 | 497 | ||
498 | #include <asm-generic/bitops/sched.h> | 498 | #include <asm-generic/bitops/sched.h> |
499 | 499 | ||
500 | #define ARCH_HAS_FAST_MULTIPLIER 1 | ||
501 | |||
502 | #include <asm/arch_hweight.h> | 500 | #include <asm/arch_hweight.h> |
503 | 501 | ||
504 | #include <asm-generic/bitops/const_hweight.h> | 502 | #include <asm-generic/bitops/const_hweight.h> |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index bb9b258d60e7..094292a63e74 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -202,6 +202,7 @@ | |||
202 | #define X86_FEATURE_DECODEASSISTS ( 8*32+12) /* AMD Decode Assists support */ | 202 | #define X86_FEATURE_DECODEASSISTS ( 8*32+12) /* AMD Decode Assists support */ |
203 | #define X86_FEATURE_PAUSEFILTER ( 8*32+13) /* AMD filtered pause intercept */ | 203 | #define X86_FEATURE_PAUSEFILTER ( 8*32+13) /* AMD filtered pause intercept */ |
204 | #define X86_FEATURE_PFTHRESHOLD ( 8*32+14) /* AMD pause filter threshold */ | 204 | #define X86_FEATURE_PFTHRESHOLD ( 8*32+14) /* AMD pause filter threshold */ |
205 | #define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer vmmcall to vmcall */ | ||
205 | 206 | ||
206 | 207 | ||
207 | /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */ | 208 | /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */ |
@@ -250,8 +251,15 @@ | |||
250 | #include <asm/asm.h> | 251 | #include <asm/asm.h> |
251 | #include <linux/bitops.h> | 252 | #include <linux/bitops.h> |
252 | 253 | ||
254 | #ifdef CONFIG_X86_FEATURE_NAMES | ||
253 | extern const char * const x86_cap_flags[NCAPINTS*32]; | 255 | extern const char * const x86_cap_flags[NCAPINTS*32]; |
254 | extern const char * const x86_power_flags[32]; | 256 | extern const char * const x86_power_flags[32]; |
257 | #define X86_CAP_FMT "%s" | ||
258 | #define x86_cap_flag(flag) x86_cap_flags[flag] | ||
259 | #else | ||
260 | #define X86_CAP_FMT "%d:%d" | ||
261 | #define x86_cap_flag(flag) ((flag) >> 5), ((flag) & 31) | ||
262 | #endif | ||
255 | 263 | ||
256 | /* | 264 | /* |
257 | * In order to save room, we index into this array by doing | 265 | * In order to save room, we index into this array by doing |
diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h new file mode 100644 index 000000000000..f498411f2500 --- /dev/null +++ b/arch/x86/include/asm/crash.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _ASM_X86_CRASH_H | ||
2 | #define _ASM_X86_CRASH_H | ||
3 | |||
4 | int crash_load_segments(struct kimage *image); | ||
5 | int crash_copy_backup_region(struct kimage *image); | ||
6 | int crash_setup_memmap_entries(struct kimage *image, | ||
7 | struct boot_params *params); | ||
8 | |||
9 | #endif /* _ASM_X86_CRASH_H */ | ||
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 044a2fd3c5fe..0ec241ede5a2 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -159,30 +159,6 @@ static inline efi_status_t efi_thunk_set_virtual_address_map( | |||
159 | } | 159 | } |
160 | #endif /* CONFIG_EFI_MIXED */ | 160 | #endif /* CONFIG_EFI_MIXED */ |
161 | 161 | ||
162 | |||
163 | /* arch specific definitions used by the stub code */ | ||
164 | |||
165 | struct efi_config { | ||
166 | u64 image_handle; | ||
167 | u64 table; | ||
168 | u64 allocate_pool; | ||
169 | u64 allocate_pages; | ||
170 | u64 get_memory_map; | ||
171 | u64 free_pool; | ||
172 | u64 free_pages; | ||
173 | u64 locate_handle; | ||
174 | u64 handle_protocol; | ||
175 | u64 exit_boot_services; | ||
176 | u64 text_output; | ||
177 | efi_status_t (*call)(unsigned long, ...); | ||
178 | bool is64; | ||
179 | } __packed; | ||
180 | |||
181 | extern struct efi_config *efi_early; | ||
182 | |||
183 | #define efi_call_early(f, ...) \ | ||
184 | efi_early->call(efi_early->f, __VA_ARGS__); | ||
185 | |||
186 | extern bool efi_reboot_required(void); | 162 | extern bool efi_reboot_required(void); |
187 | 163 | ||
188 | #else | 164 | #else |
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index b0910f97a3ea..ffb1733ac91f 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h | |||
@@ -106,14 +106,14 @@ enum fixed_addresses { | |||
106 | __end_of_permanent_fixed_addresses, | 106 | __end_of_permanent_fixed_addresses, |
107 | 107 | ||
108 | /* | 108 | /* |
109 | * 256 temporary boot-time mappings, used by early_ioremap(), | 109 | * 512 temporary boot-time mappings, used by early_ioremap(), |
110 | * before ioremap() is functional. | 110 | * before ioremap() is functional. |
111 | * | 111 | * |
112 | * If necessary we round it up to the next 256 pages boundary so | 112 | * If necessary we round it up to the next 512 pages boundary so |
113 | * that we can have a single pgd entry and a single pte table: | 113 | * that we can have a single pgd entry and a single pte table: |
114 | */ | 114 | */ |
115 | #define NR_FIX_BTMAPS 64 | 115 | #define NR_FIX_BTMAPS 64 |
116 | #define FIX_BTMAPS_SLOTS 4 | 116 | #define FIX_BTMAPS_SLOTS 8 |
117 | #define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS) | 117 | #define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS) |
118 | FIX_BTMAP_END = | 118 | FIX_BTMAP_END = |
119 | (__end_of_permanent_fixed_addresses ^ | 119 | (__end_of_permanent_fixed_addresses ^ |
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index e3b85422cf12..412ececa00b9 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h | |||
@@ -508,9 +508,12 @@ static inline void user_fpu_begin(void) | |||
508 | 508 | ||
509 | static inline void __save_fpu(struct task_struct *tsk) | 509 | static inline void __save_fpu(struct task_struct *tsk) |
510 | { | 510 | { |
511 | if (use_xsave()) | 511 | if (use_xsave()) { |
512 | xsave_state(&tsk->thread.fpu.state->xsave, -1); | 512 | if (unlikely(system_state == SYSTEM_BOOTING)) |
513 | else | 513 | xsave_state_booting(&tsk->thread.fpu.state->xsave, -1); |
514 | else | ||
515 | xsave_state(&tsk->thread.fpu.state->xsave, -1); | ||
516 | } else | ||
514 | fpu_fxsave(&tsk->thread.fpu); | 517 | fpu_fxsave(&tsk->thread.fpu); |
515 | } | 518 | } |
516 | 519 | ||
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 230853da4ec0..0f5fb6b6567e 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h | |||
@@ -40,9 +40,6 @@ typedef struct { | |||
40 | 40 | ||
41 | DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); | 41 | DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); |
42 | 42 | ||
43 | /* We can have at most NR_VECTORS irqs routed to a cpu at a time */ | ||
44 | #define MAX_HARDIRQS_PER_CPU NR_VECTORS | ||
45 | |||
46 | #define __ARCH_IRQ_STAT | 43 | #define __ARCH_IRQ_STAT |
47 | 44 | ||
48 | #define inc_irq_stat(member) this_cpu_inc(irq_stat.member) | 45 | #define inc_irq_stat(member) this_cpu_inc(irq_stat.member) |
diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h index a20365953bf8..ccffa53750a8 100644 --- a/arch/x86/include/asm/i8259.h +++ b/arch/x86/include/asm/i8259.h | |||
@@ -67,4 +67,9 @@ struct legacy_pic { | |||
67 | extern struct legacy_pic *legacy_pic; | 67 | extern struct legacy_pic *legacy_pic; |
68 | extern struct legacy_pic null_legacy_pic; | 68 | extern struct legacy_pic null_legacy_pic; |
69 | 69 | ||
70 | static inline int nr_legacy_irqs(void) | ||
71 | { | ||
72 | return legacy_pic->nr_legacy_irqs; | ||
73 | } | ||
74 | |||
70 | #endif /* _ASM_X86_I8259_H */ | 75 | #endif /* _ASM_X86_I8259_H */ |
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 90f97b4b9347..1733ab49ac5e 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -98,6 +98,8 @@ struct IR_IO_APIC_route_entry { | |||
98 | #define IOAPIC_AUTO -1 | 98 | #define IOAPIC_AUTO -1 |
99 | #define IOAPIC_EDGE 0 | 99 | #define IOAPIC_EDGE 0 |
100 | #define IOAPIC_LEVEL 1 | 100 | #define IOAPIC_LEVEL 1 |
101 | #define IOAPIC_MAP_ALLOC 0x1 | ||
102 | #define IOAPIC_MAP_CHECK 0x2 | ||
101 | 103 | ||
102 | #ifdef CONFIG_X86_IO_APIC | 104 | #ifdef CONFIG_X86_IO_APIC |
103 | 105 | ||
@@ -118,9 +120,6 @@ extern int mp_irq_entries; | |||
118 | /* MP IRQ source entries */ | 120 | /* MP IRQ source entries */ |
119 | extern struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES]; | 121 | extern struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES]; |
120 | 122 | ||
121 | /* non-0 if default (table-less) MP configuration */ | ||
122 | extern int mpc_default_type; | ||
123 | |||
124 | /* Older SiS APIC requires we rewrite the index register */ | 123 | /* Older SiS APIC requires we rewrite the index register */ |
125 | extern int sis_apic_bug; | 124 | extern int sis_apic_bug; |
126 | 125 | ||
@@ -133,9 +132,6 @@ extern int noioapicquirk; | |||
133 | /* -1 if "noapic" boot option passed */ | 132 | /* -1 if "noapic" boot option passed */ |
134 | extern int noioapicreroute; | 133 | extern int noioapicreroute; |
135 | 134 | ||
136 | /* 1 if the timer IRQ uses the '8259A Virtual Wire' mode */ | ||
137 | extern int timer_through_8259; | ||
138 | |||
139 | /* | 135 | /* |
140 | * If we use the IO-APIC for IRQ routing, disable automatic | 136 | * If we use the IO-APIC for IRQ routing, disable automatic |
141 | * assignment of PCI IRQ's. | 137 | * assignment of PCI IRQ's. |
@@ -145,24 +141,17 @@ extern int timer_through_8259; | |||
145 | 141 | ||
146 | struct io_apic_irq_attr; | 142 | struct io_apic_irq_attr; |
147 | struct irq_cfg; | 143 | struct irq_cfg; |
148 | extern int io_apic_set_pci_routing(struct device *dev, int irq, | ||
149 | struct io_apic_irq_attr *irq_attr); | ||
150 | void setup_IO_APIC_irq_extra(u32 gsi); | ||
151 | extern void ioapic_insert_resources(void); | 144 | extern void ioapic_insert_resources(void); |
152 | 145 | ||
153 | extern int native_setup_ioapic_entry(int, struct IO_APIC_route_entry *, | 146 | extern int native_setup_ioapic_entry(int, struct IO_APIC_route_entry *, |
154 | unsigned int, int, | 147 | unsigned int, int, |
155 | struct io_apic_irq_attr *); | 148 | struct io_apic_irq_attr *); |
156 | extern int native_setup_ioapic_entry(int, struct IO_APIC_route_entry *, | ||
157 | unsigned int, int, | ||
158 | struct io_apic_irq_attr *); | ||
159 | extern void eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg); | 149 | extern void eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg); |
160 | 150 | ||
161 | extern void native_compose_msi_msg(struct pci_dev *pdev, | 151 | extern void native_compose_msi_msg(struct pci_dev *pdev, |
162 | unsigned int irq, unsigned int dest, | 152 | unsigned int irq, unsigned int dest, |
163 | struct msi_msg *msg, u8 hpet_id); | 153 | struct msi_msg *msg, u8 hpet_id); |
164 | extern void native_eoi_ioapic_pin(int apic, int pin, int vector); | 154 | extern void native_eoi_ioapic_pin(int apic, int pin, int vector); |
165 | int io_apic_setup_irq_pin_once(unsigned int irq, int node, struct io_apic_irq_attr *attr); | ||
166 | 155 | ||
167 | extern int save_ioapic_entries(void); | 156 | extern int save_ioapic_entries(void); |
168 | extern void mask_ioapic_entries(void); | 157 | extern void mask_ioapic_entries(void); |
@@ -171,15 +160,40 @@ extern int restore_ioapic_entries(void); | |||
171 | extern void setup_ioapic_ids_from_mpc(void); | 160 | extern void setup_ioapic_ids_from_mpc(void); |
172 | extern void setup_ioapic_ids_from_mpc_nocheck(void); | 161 | extern void setup_ioapic_ids_from_mpc_nocheck(void); |
173 | 162 | ||
163 | enum ioapic_domain_type { | ||
164 | IOAPIC_DOMAIN_INVALID, | ||
165 | IOAPIC_DOMAIN_LEGACY, | ||
166 | IOAPIC_DOMAIN_STRICT, | ||
167 | IOAPIC_DOMAIN_DYNAMIC, | ||
168 | }; | ||
169 | |||
170 | struct device_node; | ||
171 | struct irq_domain; | ||
172 | struct irq_domain_ops; | ||
173 | |||
174 | struct ioapic_domain_cfg { | ||
175 | enum ioapic_domain_type type; | ||
176 | const struct irq_domain_ops *ops; | ||
177 | struct device_node *dev; | ||
178 | }; | ||
179 | |||
174 | struct mp_ioapic_gsi{ | 180 | struct mp_ioapic_gsi{ |
175 | u32 gsi_base; | 181 | u32 gsi_base; |
176 | u32 gsi_end; | 182 | u32 gsi_end; |
177 | }; | 183 | }; |
178 | extern struct mp_ioapic_gsi mp_gsi_routing[]; | ||
179 | extern u32 gsi_top; | 184 | extern u32 gsi_top; |
180 | int mp_find_ioapic(u32 gsi); | 185 | |
181 | int mp_find_ioapic_pin(int ioapic, u32 gsi); | 186 | extern int mp_find_ioapic(u32 gsi); |
182 | void __init mp_register_ioapic(int id, u32 address, u32 gsi_base); | 187 | extern int mp_find_ioapic_pin(int ioapic, u32 gsi); |
188 | extern u32 mp_pin_to_gsi(int ioapic, int pin); | ||
189 | extern int mp_map_gsi_to_irq(u32 gsi, unsigned int flags); | ||
190 | extern void mp_unmap_irq(int irq); | ||
191 | extern void __init mp_register_ioapic(int id, u32 address, u32 gsi_base, | ||
192 | struct ioapic_domain_cfg *cfg); | ||
193 | extern int mp_irqdomain_map(struct irq_domain *domain, unsigned int virq, | ||
194 | irq_hw_number_t hwirq); | ||
195 | extern void mp_irqdomain_unmap(struct irq_domain *domain, unsigned int virq); | ||
196 | extern int mp_set_gsi_attr(u32 gsi, int trigger, int polarity, int node); | ||
183 | extern void __init pre_init_apic_IRQ0(void); | 197 | extern void __init pre_init_apic_IRQ0(void); |
184 | 198 | ||
185 | extern void mp_save_irq(struct mpc_intsrc *m); | 199 | extern void mp_save_irq(struct mpc_intsrc *m); |
@@ -213,18 +227,19 @@ static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned | |||
213 | 227 | ||
214 | extern void io_apic_eoi(unsigned int apic, unsigned int vector); | 228 | extern void io_apic_eoi(unsigned int apic, unsigned int vector); |
215 | 229 | ||
230 | extern bool mp_should_keep_irq(struct device *dev); | ||
231 | |||
216 | #else /* !CONFIG_X86_IO_APIC */ | 232 | #else /* !CONFIG_X86_IO_APIC */ |
217 | 233 | ||
218 | #define io_apic_assign_pci_irqs 0 | 234 | #define io_apic_assign_pci_irqs 0 |
219 | #define setup_ioapic_ids_from_mpc x86_init_noop | 235 | #define setup_ioapic_ids_from_mpc x86_init_noop |
220 | static const int timer_through_8259 = 0; | ||
221 | static inline void ioapic_insert_resources(void) { } | 236 | static inline void ioapic_insert_resources(void) { } |
222 | #define gsi_top (NR_IRQS_LEGACY) | 237 | #define gsi_top (NR_IRQS_LEGACY) |
223 | static inline int mp_find_ioapic(u32 gsi) { return 0; } | 238 | static inline int mp_find_ioapic(u32 gsi) { return 0; } |
224 | 239 | static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } | |
225 | struct io_apic_irq_attr; | 240 | static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags) { return gsi; } |
226 | static inline int io_apic_set_pci_routing(struct device *dev, int irq, | 241 | static inline void mp_unmap_irq(int irq) { } |
227 | struct io_apic_irq_attr *irq_attr) { return 0; } | 242 | static inline bool mp_should_keep_irq(struct device *dev) { return 1; } |
228 | 243 | ||
229 | static inline int save_ioapic_entries(void) | 244 | static inline int save_ioapic_entries(void) |
230 | { | 245 | { |
diff --git a/arch/x86/include/asm/irq_work.h b/arch/x86/include/asm/irq_work.h new file mode 100644 index 000000000000..78162f8e248b --- /dev/null +++ b/arch/x86/include/asm/irq_work.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef _ASM_IRQ_WORK_H | ||
2 | #define _ASM_IRQ_WORK_H | ||
3 | |||
4 | #include <asm/processor.h> | ||
5 | |||
6 | static inline bool arch_irq_work_has_interrupt(void) | ||
7 | { | ||
8 | return cpu_has_apic; | ||
9 | } | ||
10 | |||
11 | #endif /* _ASM_IRQ_WORK_H */ | ||
diff --git a/arch/x86/include/asm/kexec-bzimage64.h b/arch/x86/include/asm/kexec-bzimage64.h new file mode 100644 index 000000000000..d1b5d194e31d --- /dev/null +++ b/arch/x86/include/asm/kexec-bzimage64.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_KEXEC_BZIMAGE64_H | ||
2 | #define _ASM_KEXEC_BZIMAGE64_H | ||
3 | |||
4 | extern struct kexec_file_ops kexec_bzImage64_ops; | ||
5 | |||
6 | #endif /* _ASM_KEXE_BZIMAGE64_H */ | ||
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h index 17483a492f18..d2434c1cad05 100644 --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h | |||
@@ -23,6 +23,9 @@ | |||
23 | 23 | ||
24 | #include <asm/page.h> | 24 | #include <asm/page.h> |
25 | #include <asm/ptrace.h> | 25 | #include <asm/ptrace.h> |
26 | #include <asm/bootparam.h> | ||
27 | |||
28 | struct kimage; | ||
26 | 29 | ||
27 | /* | 30 | /* |
28 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. | 31 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. |
@@ -61,6 +64,10 @@ | |||
61 | # define KEXEC_ARCH KEXEC_ARCH_X86_64 | 64 | # define KEXEC_ARCH KEXEC_ARCH_X86_64 |
62 | #endif | 65 | #endif |
63 | 66 | ||
67 | /* Memory to backup during crash kdump */ | ||
68 | #define KEXEC_BACKUP_SRC_START (0UL) | ||
69 | #define KEXEC_BACKUP_SRC_END (640 * 1024UL) /* 640K */ | ||
70 | |||
64 | /* | 71 | /* |
65 | * CPU does not save ss and sp on stack if execution is already | 72 | * CPU does not save ss and sp on stack if execution is already |
66 | * running in kernel mode at the time of NMI occurrence. This code | 73 | * running in kernel mode at the time of NMI occurrence. This code |
@@ -160,6 +167,44 @@ struct kimage_arch { | |||
160 | pud_t *pud; | 167 | pud_t *pud; |
161 | pmd_t *pmd; | 168 | pmd_t *pmd; |
162 | pte_t *pte; | 169 | pte_t *pte; |
170 | /* Details of backup region */ | ||
171 | unsigned long backup_src_start; | ||
172 | unsigned long backup_src_sz; | ||
173 | |||
174 | /* Physical address of backup segment */ | ||
175 | unsigned long backup_load_addr; | ||
176 | |||
177 | /* Core ELF header buffer */ | ||
178 | void *elf_headers; | ||
179 | unsigned long elf_headers_sz; | ||
180 | unsigned long elf_load_addr; | ||
181 | }; | ||
182 | #endif /* CONFIG_X86_32 */ | ||
183 | |||
184 | #ifdef CONFIG_X86_64 | ||
185 | /* | ||
186 | * Number of elements and order of elements in this structure should match | ||
187 | * with the ones in arch/x86/purgatory/entry64.S. If you make a change here | ||
188 | * make an appropriate change in purgatory too. | ||
189 | */ | ||
190 | struct kexec_entry64_regs { | ||
191 | uint64_t rax; | ||
192 | uint64_t rcx; | ||
193 | uint64_t rdx; | ||
194 | uint64_t rbx; | ||
195 | uint64_t rsp; | ||
196 | uint64_t rbp; | ||
197 | uint64_t rsi; | ||
198 | uint64_t rdi; | ||
199 | uint64_t r8; | ||
200 | uint64_t r9; | ||
201 | uint64_t r10; | ||
202 | uint64_t r11; | ||
203 | uint64_t r12; | ||
204 | uint64_t r13; | ||
205 | uint64_t r14; | ||
206 | uint64_t r15; | ||
207 | uint64_t rip; | ||
163 | }; | 208 | }; |
164 | #endif | 209 | #endif |
165 | 210 | ||
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 572460175ba5..7d603a71ab3a 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -95,14 +95,10 @@ static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level) | |||
95 | #define KVM_REFILL_PAGES 25 | 95 | #define KVM_REFILL_PAGES 25 |
96 | #define KVM_MAX_CPUID_ENTRIES 80 | 96 | #define KVM_MAX_CPUID_ENTRIES 80 |
97 | #define KVM_NR_FIXED_MTRR_REGION 88 | 97 | #define KVM_NR_FIXED_MTRR_REGION 88 |
98 | #define KVM_NR_VAR_MTRR 10 | 98 | #define KVM_NR_VAR_MTRR 8 |
99 | 99 | ||
100 | #define ASYNC_PF_PER_VCPU 64 | 100 | #define ASYNC_PF_PER_VCPU 64 |
101 | 101 | ||
102 | struct kvm_vcpu; | ||
103 | struct kvm; | ||
104 | struct kvm_async_pf; | ||
105 | |||
106 | enum kvm_reg { | 102 | enum kvm_reg { |
107 | VCPU_REGS_RAX = 0, | 103 | VCPU_REGS_RAX = 0, |
108 | VCPU_REGS_RCX = 1, | 104 | VCPU_REGS_RCX = 1, |
@@ -266,7 +262,8 @@ struct kvm_mmu { | |||
266 | struct x86_exception *fault); | 262 | struct x86_exception *fault); |
267 | gpa_t (*gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t gva, u32 access, | 263 | gpa_t (*gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t gva, u32 access, |
268 | struct x86_exception *exception); | 264 | struct x86_exception *exception); |
269 | gpa_t (*translate_gpa)(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access); | 265 | gpa_t (*translate_gpa)(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access, |
266 | struct x86_exception *exception); | ||
270 | int (*sync_page)(struct kvm_vcpu *vcpu, | 267 | int (*sync_page)(struct kvm_vcpu *vcpu, |
271 | struct kvm_mmu_page *sp); | 268 | struct kvm_mmu_page *sp); |
272 | void (*invlpg)(struct kvm_vcpu *vcpu, gva_t gva); | 269 | void (*invlpg)(struct kvm_vcpu *vcpu, gva_t gva); |
@@ -481,6 +478,7 @@ struct kvm_vcpu_arch { | |||
481 | u64 mmio_gva; | 478 | u64 mmio_gva; |
482 | unsigned access; | 479 | unsigned access; |
483 | gfn_t mmio_gfn; | 480 | gfn_t mmio_gfn; |
481 | u64 mmio_gen; | ||
484 | 482 | ||
485 | struct kvm_pmu pmu; | 483 | struct kvm_pmu pmu; |
486 | 484 | ||
@@ -576,11 +574,10 @@ struct kvm_arch { | |||
576 | struct kvm_apic_map *apic_map; | 574 | struct kvm_apic_map *apic_map; |
577 | 575 | ||
578 | unsigned int tss_addr; | 576 | unsigned int tss_addr; |
579 | struct page *apic_access_page; | 577 | bool apic_access_page_done; |
580 | 578 | ||
581 | gpa_t wall_clock; | 579 | gpa_t wall_clock; |
582 | 580 | ||
583 | struct page *ept_identity_pagetable; | ||
584 | bool ept_identity_pagetable_done; | 581 | bool ept_identity_pagetable_done; |
585 | gpa_t ept_identity_map_addr; | 582 | gpa_t ept_identity_map_addr; |
586 | 583 | ||
@@ -665,8 +662,8 @@ struct msr_data { | |||
665 | struct kvm_x86_ops { | 662 | struct kvm_x86_ops { |
666 | int (*cpu_has_kvm_support)(void); /* __init */ | 663 | int (*cpu_has_kvm_support)(void); /* __init */ |
667 | int (*disabled_by_bios)(void); /* __init */ | 664 | int (*disabled_by_bios)(void); /* __init */ |
668 | int (*hardware_enable)(void *dummy); | 665 | int (*hardware_enable)(void); |
669 | void (*hardware_disable)(void *dummy); | 666 | void (*hardware_disable)(void); |
670 | void (*check_processor_compatibility)(void *rtn); | 667 | void (*check_processor_compatibility)(void *rtn); |
671 | int (*hardware_setup)(void); /* __init */ | 668 | int (*hardware_setup)(void); /* __init */ |
672 | void (*hardware_unsetup)(void); /* __exit */ | 669 | void (*hardware_unsetup)(void); /* __exit */ |
@@ -710,7 +707,6 @@ struct kvm_x86_ops { | |||
710 | void (*cache_reg)(struct kvm_vcpu *vcpu, enum kvm_reg reg); | 707 | void (*cache_reg)(struct kvm_vcpu *vcpu, enum kvm_reg reg); |
711 | unsigned long (*get_rflags)(struct kvm_vcpu *vcpu); | 708 | unsigned long (*get_rflags)(struct kvm_vcpu *vcpu); |
712 | void (*set_rflags)(struct kvm_vcpu *vcpu, unsigned long rflags); | 709 | void (*set_rflags)(struct kvm_vcpu *vcpu, unsigned long rflags); |
713 | void (*fpu_activate)(struct kvm_vcpu *vcpu); | ||
714 | void (*fpu_deactivate)(struct kvm_vcpu *vcpu); | 710 | void (*fpu_deactivate)(struct kvm_vcpu *vcpu); |
715 | 711 | ||
716 | void (*tlb_flush)(struct kvm_vcpu *vcpu); | 712 | void (*tlb_flush)(struct kvm_vcpu *vcpu); |
@@ -740,6 +736,7 @@ struct kvm_x86_ops { | |||
740 | void (*hwapic_isr_update)(struct kvm *kvm, int isr); | 736 | void (*hwapic_isr_update)(struct kvm *kvm, int isr); |
741 | void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap); | 737 | void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap); |
742 | void (*set_virtual_x2apic_mode)(struct kvm_vcpu *vcpu, bool set); | 738 | void (*set_virtual_x2apic_mode)(struct kvm_vcpu *vcpu, bool set); |
739 | void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu, hpa_t hpa); | ||
743 | void (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector); | 740 | void (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector); |
744 | void (*sync_pir_to_irr)(struct kvm_vcpu *vcpu); | 741 | void (*sync_pir_to_irr)(struct kvm_vcpu *vcpu); |
745 | int (*set_tss_addr)(struct kvm *kvm, unsigned int addr); | 742 | int (*set_tss_addr)(struct kvm *kvm, unsigned int addr); |
@@ -772,6 +769,8 @@ struct kvm_x86_ops { | |||
772 | bool (*mpx_supported)(void); | 769 | bool (*mpx_supported)(void); |
773 | 770 | ||
774 | int (*check_nested_events)(struct kvm_vcpu *vcpu, bool external_intr); | 771 | int (*check_nested_events)(struct kvm_vcpu *vcpu, bool external_intr); |
772 | |||
773 | void (*sched_in)(struct kvm_vcpu *kvm, int cpu); | ||
775 | }; | 774 | }; |
776 | 775 | ||
777 | struct kvm_arch_async_pf { | 776 | struct kvm_arch_async_pf { |
@@ -895,7 +894,6 @@ void kvm_inject_page_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault); | |||
895 | int kvm_read_guest_page_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, | 894 | int kvm_read_guest_page_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, |
896 | gfn_t gfn, void *data, int offset, int len, | 895 | gfn_t gfn, void *data, int offset, int len, |
897 | u32 access); | 896 | u32 access); |
898 | void kvm_propagate_fault(struct kvm_vcpu *vcpu, struct x86_exception *fault); | ||
899 | bool kvm_require_cpl(struct kvm_vcpu *vcpu, int required_cpl); | 897 | bool kvm_require_cpl(struct kvm_vcpu *vcpu, int required_cpl); |
900 | 898 | ||
901 | static inline int __kvm_irq_line_state(unsigned long *irq_state, | 899 | static inline int __kvm_irq_line_state(unsigned long *irq_state, |
@@ -917,7 +915,6 @@ void kvm_inject_nmi(struct kvm_vcpu *vcpu); | |||
917 | 915 | ||
918 | int fx_init(struct kvm_vcpu *vcpu); | 916 | int fx_init(struct kvm_vcpu *vcpu); |
919 | 917 | ||
920 | void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu); | ||
921 | void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, | 918 | void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, |
922 | const u8 *new, int bytes); | 919 | const u8 *new, int bytes); |
923 | int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn); | 920 | int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn); |
@@ -926,7 +923,8 @@ void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); | |||
926 | int kvm_mmu_load(struct kvm_vcpu *vcpu); | 923 | int kvm_mmu_load(struct kvm_vcpu *vcpu); |
927 | void kvm_mmu_unload(struct kvm_vcpu *vcpu); | 924 | void kvm_mmu_unload(struct kvm_vcpu *vcpu); |
928 | void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu); | 925 | void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu); |
929 | gpa_t translate_nested_gpa(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access); | 926 | gpa_t translate_nested_gpa(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access, |
927 | struct x86_exception *exception); | ||
930 | gpa_t kvm_mmu_gva_to_gpa_read(struct kvm_vcpu *vcpu, gva_t gva, | 928 | gpa_t kvm_mmu_gva_to_gpa_read(struct kvm_vcpu *vcpu, gva_t gva, |
931 | struct x86_exception *exception); | 929 | struct x86_exception *exception); |
932 | gpa_t kvm_mmu_gva_to_gpa_fetch(struct kvm_vcpu *vcpu, gva_t gva, | 930 | gpa_t kvm_mmu_gva_to_gpa_fetch(struct kvm_vcpu *vcpu, gva_t gva, |
@@ -946,7 +944,8 @@ void kvm_mmu_new_cr3(struct kvm_vcpu *vcpu); | |||
946 | void kvm_enable_tdp(void); | 944 | void kvm_enable_tdp(void); |
947 | void kvm_disable_tdp(void); | 945 | void kvm_disable_tdp(void); |
948 | 946 | ||
949 | static inline gpa_t translate_gpa(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access) | 947 | static inline gpa_t translate_gpa(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access, |
948 | struct x86_exception *exception) | ||
950 | { | 949 | { |
951 | return gpa; | 950 | return gpa; |
952 | } | 951 | } |
@@ -1037,7 +1036,7 @@ asmlinkage void kvm_spurious_fault(void); | |||
1037 | #define KVM_ARCH_WANT_MMU_NOTIFIER | 1036 | #define KVM_ARCH_WANT_MMU_NOTIFIER |
1038 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); | 1037 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); |
1039 | int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end); | 1038 | int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end); |
1040 | int kvm_age_hva(struct kvm *kvm, unsigned long hva); | 1039 | int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end); |
1041 | int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); | 1040 | int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); |
1042 | void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); | 1041 | void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); |
1043 | int cpuid_maxphyaddr(struct kvm_vcpu *vcpu); | 1042 | int cpuid_maxphyaddr(struct kvm_vcpu *vcpu); |
@@ -1046,6 +1045,9 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); | |||
1046 | int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); | 1045 | int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); |
1047 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); | 1046 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); |
1048 | void kvm_vcpu_reset(struct kvm_vcpu *vcpu); | 1047 | void kvm_vcpu_reset(struct kvm_vcpu *vcpu); |
1048 | void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu); | ||
1049 | void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm, | ||
1050 | unsigned long address); | ||
1049 | 1051 | ||
1050 | void kvm_define_shared_msr(unsigned index, u32 msr); | 1052 | void kvm_define_shared_msr(unsigned index, u32 msr); |
1051 | void kvm_set_shared_msr(unsigned index, u64 val, u64 mask); | 1053 | void kvm_set_shared_msr(unsigned index, u64 val, u64 mask); |
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index c7678e43465b..e62cf897f781 100644 --- a/arch/x86/include/asm/kvm_para.h +++ b/arch/x86/include/asm/kvm_para.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ASM_X86_KVM_PARA_H | 2 | #define _ASM_X86_KVM_PARA_H |
3 | 3 | ||
4 | #include <asm/processor.h> | 4 | #include <asm/processor.h> |
5 | #include <asm/alternative.h> | ||
5 | #include <uapi/asm/kvm_para.h> | 6 | #include <uapi/asm/kvm_para.h> |
6 | 7 | ||
7 | extern void kvmclock_init(void); | 8 | extern void kvmclock_init(void); |
@@ -16,10 +17,15 @@ static inline bool kvm_check_and_clear_guest_paused(void) | |||
16 | } | 17 | } |
17 | #endif /* CONFIG_KVM_GUEST */ | 18 | #endif /* CONFIG_KVM_GUEST */ |
18 | 19 | ||
19 | /* This instruction is vmcall. On non-VT architectures, it will generate a | 20 | #ifdef CONFIG_DEBUG_RODATA |
20 | * trap that we will then rewrite to the appropriate instruction. | 21 | #define KVM_HYPERCALL \ |
22 | ALTERNATIVE(".byte 0x0f,0x01,0xc1", ".byte 0x0f,0x01,0xd9", X86_FEATURE_VMMCALL) | ||
23 | #else | ||
24 | /* On AMD processors, vmcall will generate a trap that we will | ||
25 | * then rewrite to the appropriate instruction. | ||
21 | */ | 26 | */ |
22 | #define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1" | 27 | #define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1" |
28 | #endif | ||
23 | 29 | ||
24 | /* For KVM hypercalls, a three-byte sequence of either the vmcall or the vmmcall | 30 | /* For KVM hypercalls, a three-byte sequence of either the vmcall or the vmmcall |
25 | * instruction. The hypervisor may replace it with something else but only the | 31 | * instruction. The hypervisor may replace it with something else but only the |
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index f5a617956735..b07233b64578 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -40,8 +40,6 @@ extern int mp_bus_id_to_type[MAX_MP_BUSSES]; | |||
40 | extern DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); | 40 | extern DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); |
41 | 41 | ||
42 | extern unsigned int boot_cpu_physical_apicid; | 42 | extern unsigned int boot_cpu_physical_apicid; |
43 | extern unsigned int max_physical_apicid; | ||
44 | extern int mpc_default_type; | ||
45 | extern unsigned long mp_lapic_addr; | 43 | extern unsigned long mp_lapic_addr; |
46 | 44 | ||
47 | #ifdef CONFIG_X86_LOCAL_APIC | 45 | #ifdef CONFIG_X86_LOCAL_APIC |
@@ -88,15 +86,6 @@ static inline void early_reserve_e820_mpc_new(void) { } | |||
88 | #endif | 86 | #endif |
89 | 87 | ||
90 | int generic_processor_info(int apicid, int version); | 88 | int generic_processor_info(int apicid, int version); |
91 | #ifdef CONFIG_ACPI | ||
92 | extern void mp_register_ioapic(int id, u32 address, u32 gsi_base); | ||
93 | extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, | ||
94 | u32 gsi); | ||
95 | extern void mp_config_acpi_legacy_irqs(void); | ||
96 | struct device; | ||
97 | extern int mp_register_gsi(struct device *dev, u32 gsi, int edge_level, | ||
98 | int active_high_low); | ||
99 | #endif /* CONFIG_ACPI */ | ||
100 | 89 | ||
101 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC) | 90 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_LOCAL_APIC) |
102 | 91 | ||
@@ -161,8 +150,4 @@ static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map) | |||
161 | 150 | ||
162 | extern physid_mask_t phys_cpu_present_map; | 151 | extern physid_mask_t phys_cpu_present_map; |
163 | 152 | ||
164 | extern int generic_mps_oem_check(struct mpc_table *, char *, char *); | ||
165 | |||
166 | extern int default_acpi_madt_oem_check(char *, char *); | ||
167 | |||
168 | #endif /* _ASM_X86_MPSPEC_H */ | 153 | #endif /* _ASM_X86_MPSPEC_H */ |
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h index 775873d3be55..802dde30c928 100644 --- a/arch/x86/include/asm/page.h +++ b/arch/x86/include/asm/page.h | |||
@@ -70,7 +70,6 @@ extern bool __virt_addr_valid(unsigned long kaddr); | |||
70 | #include <asm-generic/memory_model.h> | 70 | #include <asm-generic/memory_model.h> |
71 | #include <asm-generic/getorder.h> | 71 | #include <asm-generic/getorder.h> |
72 | 72 | ||
73 | #define __HAVE_ARCH_GATE_AREA 1 | ||
74 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | 73 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA |
75 | 74 | ||
76 | #endif /* __KERNEL__ */ | 75 | #endif /* __KERNEL__ */ |
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h index 0f1ddee6a0ce..f408caf73430 100644 --- a/arch/x86/include/asm/page_64.h +++ b/arch/x86/include/asm/page_64.h | |||
@@ -39,4 +39,6 @@ void copy_page(void *to, void *from); | |||
39 | 39 | ||
40 | #endif /* !__ASSEMBLY__ */ | 40 | #endif /* !__ASSEMBLY__ */ |
41 | 41 | ||
42 | #define __HAVE_ARCH_GATE_AREA 1 | ||
43 | |||
42 | #endif /* _ASM_X86_PAGE_64_H */ | 44 | #endif /* _ASM_X86_PAGE_64_H */ |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 0ec056012618..aa97a070f09f 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -131,8 +131,13 @@ static inline int pte_exec(pte_t pte) | |||
131 | 131 | ||
132 | static inline int pte_special(pte_t pte) | 132 | static inline int pte_special(pte_t pte) |
133 | { | 133 | { |
134 | return (pte_flags(pte) & (_PAGE_PRESENT|_PAGE_SPECIAL)) == | 134 | /* |
135 | (_PAGE_PRESENT|_PAGE_SPECIAL); | 135 | * See CONFIG_NUMA_BALANCING pte_numa in include/asm-generic/pgtable.h. |
136 | * On x86 we have _PAGE_BIT_NUMA == _PAGE_BIT_GLOBAL+1 == | ||
137 | * __PAGE_BIT_SOFTW1 == _PAGE_BIT_SPECIAL. | ||
138 | */ | ||
139 | return (pte_flags(pte) & _PAGE_SPECIAL) && | ||
140 | (pte_flags(pte) & (_PAGE_PRESENT|_PAGE_PROTNONE)); | ||
136 | } | 141 | } |
137 | 142 | ||
138 | static inline unsigned long pte_pfn(pte_t pte) | 143 | static inline unsigned long pte_pfn(pte_t pte) |
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 5be9063545d2..3874693c0e53 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h | |||
@@ -19,6 +19,7 @@ extern pud_t level3_ident_pgt[512]; | |||
19 | extern pmd_t level2_kernel_pgt[512]; | 19 | extern pmd_t level2_kernel_pgt[512]; |
20 | extern pmd_t level2_fixmap_pgt[512]; | 20 | extern pmd_t level2_fixmap_pgt[512]; |
21 | extern pmd_t level2_ident_pgt[512]; | 21 | extern pmd_t level2_ident_pgt[512]; |
22 | extern pte_t level1_fixmap_pgt[512]; | ||
22 | extern pgd_t init_level4_pgt[]; | 23 | extern pgd_t init_level4_pgt[]; |
23 | 24 | ||
24 | #define swapper_pg_dir init_level4_pgt | 25 | #define swapper_pg_dir init_level4_pgt |
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index f216963760e5..07789647bf33 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #define _PAGE_BIT_SPECIAL _PAGE_BIT_SOFTW1 | 23 | #define _PAGE_BIT_SPECIAL _PAGE_BIT_SOFTW1 |
24 | #define _PAGE_BIT_CPA_TEST _PAGE_BIT_SOFTW1 | 24 | #define _PAGE_BIT_CPA_TEST _PAGE_BIT_SOFTW1 |
25 | #define _PAGE_BIT_SPLITTING _PAGE_BIT_SOFTW2 /* only valid on a PSE pmd */ | 25 | #define _PAGE_BIT_SPLITTING _PAGE_BIT_SOFTW2 /* only valid on a PSE pmd */ |
26 | #define _PAGE_BIT_IOMAP _PAGE_BIT_SOFTW2 /* flag used to indicate IO mapping */ | ||
27 | #define _PAGE_BIT_HIDDEN _PAGE_BIT_SOFTW3 /* hidden by kmemcheck */ | 26 | #define _PAGE_BIT_HIDDEN _PAGE_BIT_SOFTW3 /* hidden by kmemcheck */ |
28 | #define _PAGE_BIT_SOFT_DIRTY _PAGE_BIT_SOFTW3 /* software dirty tracking */ | 27 | #define _PAGE_BIT_SOFT_DIRTY _PAGE_BIT_SOFTW3 /* software dirty tracking */ |
29 | #define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ | 28 | #define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */ |
@@ -52,7 +51,7 @@ | |||
52 | #define _PAGE_PSE (_AT(pteval_t, 1) << _PAGE_BIT_PSE) | 51 | #define _PAGE_PSE (_AT(pteval_t, 1) << _PAGE_BIT_PSE) |
53 | #define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL) | 52 | #define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL) |
54 | #define _PAGE_SOFTW1 (_AT(pteval_t, 1) << _PAGE_BIT_SOFTW1) | 53 | #define _PAGE_SOFTW1 (_AT(pteval_t, 1) << _PAGE_BIT_SOFTW1) |
55 | #define _PAGE_IOMAP (_AT(pteval_t, 1) << _PAGE_BIT_IOMAP) | 54 | #define _PAGE_SOFTW2 (_AT(pteval_t, 1) << _PAGE_BIT_SOFTW2) |
56 | #define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) | 55 | #define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) |
57 | #define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) | 56 | #define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) |
58 | #define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) | 57 | #define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) |
@@ -168,10 +167,10 @@ | |||
168 | #define __PAGE_KERNEL_LARGE_NOCACHE (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE) | 167 | #define __PAGE_KERNEL_LARGE_NOCACHE (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE) |
169 | #define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE) | 168 | #define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE) |
170 | 169 | ||
171 | #define __PAGE_KERNEL_IO (__PAGE_KERNEL | _PAGE_IOMAP) | 170 | #define __PAGE_KERNEL_IO (__PAGE_KERNEL) |
172 | #define __PAGE_KERNEL_IO_NOCACHE (__PAGE_KERNEL_NOCACHE | _PAGE_IOMAP) | 171 | #define __PAGE_KERNEL_IO_NOCACHE (__PAGE_KERNEL_NOCACHE) |
173 | #define __PAGE_KERNEL_IO_UC_MINUS (__PAGE_KERNEL_UC_MINUS | _PAGE_IOMAP) | 172 | #define __PAGE_KERNEL_IO_UC_MINUS (__PAGE_KERNEL_UC_MINUS) |
174 | #define __PAGE_KERNEL_IO_WC (__PAGE_KERNEL_WC | _PAGE_IOMAP) | 173 | #define __PAGE_KERNEL_IO_WC (__PAGE_KERNEL_WC) |
175 | 174 | ||
176 | #define PAGE_KERNEL __pgprot(__PAGE_KERNEL) | 175 | #define PAGE_KERNEL __pgprot(__PAGE_KERNEL) |
177 | #define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO) | 176 | #define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO) |
@@ -325,6 +324,20 @@ static inline pteval_t pte_flags(pte_t pte) | |||
325 | return native_pte_val(pte) & PTE_FLAGS_MASK; | 324 | return native_pte_val(pte) & PTE_FLAGS_MASK; |
326 | } | 325 | } |
327 | 326 | ||
327 | #ifdef CONFIG_NUMA_BALANCING | ||
328 | /* Set of bits that distinguishes present, prot_none and numa ptes */ | ||
329 | #define _PAGE_NUMA_MASK (_PAGE_NUMA|_PAGE_PROTNONE|_PAGE_PRESENT) | ||
330 | static inline pteval_t ptenuma_flags(pte_t pte) | ||
331 | { | ||
332 | return pte_flags(pte) & _PAGE_NUMA_MASK; | ||
333 | } | ||
334 | |||
335 | static inline pmdval_t pmdnuma_flags(pmd_t pmd) | ||
336 | { | ||
337 | return pmd_flags(pmd) & _PAGE_NUMA_MASK; | ||
338 | } | ||
339 | #endif /* CONFIG_NUMA_BALANCING */ | ||
340 | |||
328 | #define pgprot_val(x) ((x).pgprot) | 341 | #define pgprot_val(x) ((x).pgprot) |
329 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 342 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
330 | 343 | ||
diff --git a/arch/x86/include/asm/platform_sst_audio.h b/arch/x86/include/asm/platform_sst_audio.h new file mode 100644 index 000000000000..0a4e140315b6 --- /dev/null +++ b/arch/x86/include/asm/platform_sst_audio.h | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * platform_sst_audio.h: sst audio platform data header file | ||
3 | * | ||
4 | * Copyright (C) 2012-14 Intel Corporation | ||
5 | * Author: Jeeja KP <jeeja.kp@intel.com> | ||
6 | * Omair Mohammed Abdullah <omair.m.abdullah@intel.com> | ||
7 | * Vinod Koul ,vinod.koul@intel.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; version 2 | ||
12 | * of the License. | ||
13 | */ | ||
14 | #ifndef _PLATFORM_SST_AUDIO_H_ | ||
15 | #define _PLATFORM_SST_AUDIO_H_ | ||
16 | |||
17 | #include <linux/sfi.h> | ||
18 | |||
19 | enum sst_audio_task_id_mrfld { | ||
20 | SST_TASK_ID_NONE = 0, | ||
21 | SST_TASK_ID_SBA = 1, | ||
22 | SST_TASK_ID_MEDIA = 3, | ||
23 | SST_TASK_ID_MAX = SST_TASK_ID_MEDIA, | ||
24 | }; | ||
25 | |||
26 | /* Device IDs for Merrifield are Pipe IDs, | ||
27 | * ref: DSP spec v0.75 */ | ||
28 | enum sst_audio_device_id_mrfld { | ||
29 | /* Output pipeline IDs */ | ||
30 | PIPE_ID_OUT_START = 0x0, | ||
31 | PIPE_CODEC_OUT0 = 0x2, | ||
32 | PIPE_CODEC_OUT1 = 0x3, | ||
33 | PIPE_SPROT_LOOP_OUT = 0x4, | ||
34 | PIPE_MEDIA_LOOP1_OUT = 0x5, | ||
35 | PIPE_MEDIA_LOOP2_OUT = 0x6, | ||
36 | PIPE_VOIP_OUT = 0xC, | ||
37 | PIPE_PCM0_OUT = 0xD, | ||
38 | PIPE_PCM1_OUT = 0xE, | ||
39 | PIPE_PCM2_OUT = 0xF, | ||
40 | PIPE_MEDIA0_OUT = 0x12, | ||
41 | PIPE_MEDIA1_OUT = 0x13, | ||
42 | /* Input Pipeline IDs */ | ||
43 | PIPE_ID_IN_START = 0x80, | ||
44 | PIPE_CODEC_IN0 = 0x82, | ||
45 | PIPE_CODEC_IN1 = 0x83, | ||
46 | PIPE_SPROT_LOOP_IN = 0x84, | ||
47 | PIPE_MEDIA_LOOP1_IN = 0x85, | ||
48 | PIPE_MEDIA_LOOP2_IN = 0x86, | ||
49 | PIPE_VOIP_IN = 0x8C, | ||
50 | PIPE_PCM0_IN = 0x8D, | ||
51 | PIPE_PCM1_IN = 0x8E, | ||
52 | PIPE_MEDIA0_IN = 0x8F, | ||
53 | PIPE_MEDIA1_IN = 0x90, | ||
54 | PIPE_MEDIA2_IN = 0x91, | ||
55 | PIPE_RSVD = 0xFF, | ||
56 | }; | ||
57 | |||
58 | /* The stream map for each platform consists of an array of the below | ||
59 | * stream map structure. | ||
60 | */ | ||
61 | struct sst_dev_stream_map { | ||
62 | u8 dev_num; /* device id */ | ||
63 | u8 subdev_num; /* substream */ | ||
64 | u8 direction; | ||
65 | u8 device_id; /* fw id */ | ||
66 | u8 task_id; /* fw task */ | ||
67 | u8 status; | ||
68 | }; | ||
69 | |||
70 | struct sst_platform_data { | ||
71 | /* Intel software platform id*/ | ||
72 | struct sst_dev_stream_map *pdev_strm_map; | ||
73 | unsigned int strm_map_size; | ||
74 | }; | ||
75 | |||
76 | int add_sst_platform_device(void); | ||
77 | #endif | ||
78 | |||
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index ee30b9f0b91c..eb71ec794732 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -385,8 +385,8 @@ struct bndcsr_struct { | |||
385 | 385 | ||
386 | struct xsave_hdr_struct { | 386 | struct xsave_hdr_struct { |
387 | u64 xstate_bv; | 387 | u64 xstate_bv; |
388 | u64 reserved1[2]; | 388 | u64 xcomp_bv; |
389 | u64 reserved2[5]; | 389 | u64 reserved[6]; |
390 | } __attribute__((packed)); | 390 | } __attribute__((packed)); |
391 | 391 | ||
392 | struct xsave_struct { | 392 | struct xsave_struct { |
diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h index fbeb06ed0eaa..1d081ac1cd69 100644 --- a/arch/x86/include/asm/prom.h +++ b/arch/x86/include/asm/prom.h | |||
@@ -26,12 +26,10 @@ | |||
26 | extern int of_ioapic; | 26 | extern int of_ioapic; |
27 | extern u64 initial_dtb; | 27 | extern u64 initial_dtb; |
28 | extern void add_dtb(u64 data); | 28 | extern void add_dtb(u64 data); |
29 | extern void x86_add_irq_domains(void); | ||
30 | void x86_of_pci_init(void); | 29 | void x86_of_pci_init(void); |
31 | void x86_dtb_init(void); | 30 | void x86_dtb_init(void); |
32 | #else | 31 | #else |
33 | static inline void add_dtb(u64 data) { } | 32 | static inline void add_dtb(u64 data) { } |
34 | static inline void x86_add_irq_domains(void) { } | ||
35 | static inline void x86_of_pci_init(void) { } | 33 | static inline void x86_of_pci_init(void) { } |
36 | static inline void x86_dtb_init(void) { } | 34 | static inline void x86_dtb_init(void) { } |
37 | #define of_ioapic 0 | 35 | #define of_ioapic 0 |
diff --git a/arch/x86/include/asm/scatterlist.h b/arch/x86/include/asm/scatterlist.h deleted file mode 100644 index 4240878b9d76..000000000000 --- a/arch/x86/include/asm/scatterlist.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef _ASM_X86_SCATTERLIST_H | ||
2 | #define _ASM_X86_SCATTERLIST_H | ||
3 | |||
4 | #include <asm-generic/scatterlist.h> | ||
5 | |||
6 | #define ARCH_HAS_SG_CHAIN | ||
7 | |||
8 | #endif /* _ASM_X86_SCATTERLIST_H */ | ||
diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h index 49adfd7bb4a4..0da7409f0bec 100644 --- a/arch/x86/include/asm/smpboot_hooks.h +++ b/arch/x86/include/asm/smpboot_hooks.h | |||
@@ -17,11 +17,11 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) | |||
17 | spin_unlock_irqrestore(&rtc_lock, flags); | 17 | spin_unlock_irqrestore(&rtc_lock, flags); |
18 | local_flush_tlb(); | 18 | local_flush_tlb(); |
19 | pr_debug("1.\n"); | 19 | pr_debug("1.\n"); |
20 | *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) = | 20 | *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) = |
21 | start_eip >> 4; | 21 | start_eip >> 4; |
22 | pr_debug("2.\n"); | 22 | pr_debug("2.\n"); |
23 | *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) = | 23 | *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = |
24 | start_eip & 0xf; | 24 | start_eip & 0xf; |
25 | pr_debug("3.\n"); | 25 | pr_debug("3.\n"); |
26 | } | 26 | } |
27 | 27 | ||
@@ -42,7 +42,7 @@ static inline void smpboot_restore_warm_reset_vector(void) | |||
42 | CMOS_WRITE(0, 0xf); | 42 | CMOS_WRITE(0, 0xf); |
43 | spin_unlock_irqrestore(&rtc_lock, flags); | 43 | spin_unlock_irqrestore(&rtc_lock, flags); |
44 | 44 | ||
45 | *((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0; | 45 | *((volatile u32 *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0; |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline void __init smpboot_setup_io_apic(void) | 48 | static inline void __init smpboot_setup_io_apic(void) |
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h index d949ef28c48b..7e7a79ada658 100644 --- a/arch/x86/include/asm/xsave.h +++ b/arch/x86/include/asm/xsave.h | |||
@@ -52,24 +52,170 @@ extern void xsave_init(void); | |||
52 | extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask); | 52 | extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask); |
53 | extern int init_fpu(struct task_struct *child); | 53 | extern int init_fpu(struct task_struct *child); |
54 | 54 | ||
55 | static inline int fpu_xrstor_checking(struct xsave_struct *fx) | 55 | /* These macros all use (%edi)/(%rdi) as the single memory argument. */ |
56 | #define XSAVE ".byte " REX_PREFIX "0x0f,0xae,0x27" | ||
57 | #define XSAVEOPT ".byte " REX_PREFIX "0x0f,0xae,0x37" | ||
58 | #define XSAVES ".byte " REX_PREFIX "0x0f,0xc7,0x2f" | ||
59 | #define XRSTOR ".byte " REX_PREFIX "0x0f,0xae,0x2f" | ||
60 | #define XRSTORS ".byte " REX_PREFIX "0x0f,0xc7,0x1f" | ||
61 | |||
62 | #define xstate_fault ".section .fixup,\"ax\"\n" \ | ||
63 | "3: movl $-1,%[err]\n" \ | ||
64 | " jmp 2b\n" \ | ||
65 | ".previous\n" \ | ||
66 | _ASM_EXTABLE(1b, 3b) \ | ||
67 | : [err] "=r" (err) | ||
68 | |||
69 | /* | ||
70 | * This function is called only during boot time when x86 caps are not set | ||
71 | * up and alternative can not be used yet. | ||
72 | */ | ||
73 | static inline int xsave_state_booting(struct xsave_struct *fx, u64 mask) | ||
56 | { | 74 | { |
57 | int err; | 75 | u32 lmask = mask; |
76 | u32 hmask = mask >> 32; | ||
77 | int err = 0; | ||
78 | |||
79 | WARN_ON(system_state != SYSTEM_BOOTING); | ||
80 | |||
81 | if (boot_cpu_has(X86_FEATURE_XSAVES)) | ||
82 | asm volatile("1:"XSAVES"\n\t" | ||
83 | "2:\n\t" | ||
84 | : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask) | ||
85 | : "memory"); | ||
86 | else | ||
87 | asm volatile("1:"XSAVE"\n\t" | ||
88 | "2:\n\t" | ||
89 | : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask) | ||
90 | : "memory"); | ||
91 | |||
92 | asm volatile(xstate_fault | ||
93 | : "0" (0) | ||
94 | : "memory"); | ||
95 | |||
96 | return err; | ||
97 | } | ||
98 | |||
99 | /* | ||
100 | * This function is called only during boot time when x86 caps are not set | ||
101 | * up and alternative can not be used yet. | ||
102 | */ | ||
103 | static inline int xrstor_state_booting(struct xsave_struct *fx, u64 mask) | ||
104 | { | ||
105 | u32 lmask = mask; | ||
106 | u32 hmask = mask >> 32; | ||
107 | int err = 0; | ||
108 | |||
109 | WARN_ON(system_state != SYSTEM_BOOTING); | ||
58 | 110 | ||
59 | asm volatile("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t" | 111 | if (boot_cpu_has(X86_FEATURE_XSAVES)) |
60 | "2:\n" | 112 | asm volatile("1:"XRSTORS"\n\t" |
61 | ".section .fixup,\"ax\"\n" | 113 | "2:\n\t" |
62 | "3: movl $-1,%[err]\n" | 114 | : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask) |
63 | " jmp 2b\n" | 115 | : "memory"); |
64 | ".previous\n" | 116 | else |
65 | _ASM_EXTABLE(1b, 3b) | 117 | asm volatile("1:"XRSTOR"\n\t" |
66 | : [err] "=r" (err) | 118 | "2:\n\t" |
67 | : "D" (fx), "m" (*fx), "a" (-1), "d" (-1), "0" (0) | 119 | : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask) |
120 | : "memory"); | ||
121 | |||
122 | asm volatile(xstate_fault | ||
123 | : "0" (0) | ||
124 | : "memory"); | ||
125 | |||
126 | return err; | ||
127 | } | ||
128 | |||
129 | /* | ||
130 | * Save processor xstate to xsave area. | ||
131 | */ | ||
132 | static inline int xsave_state(struct xsave_struct *fx, u64 mask) | ||
133 | { | ||
134 | u32 lmask = mask; | ||
135 | u32 hmask = mask >> 32; | ||
136 | int err = 0; | ||
137 | |||
138 | /* | ||
139 | * If xsaves is enabled, xsaves replaces xsaveopt because | ||
140 | * it supports compact format and supervisor states in addition to | ||
141 | * modified optimization in xsaveopt. | ||
142 | * | ||
143 | * Otherwise, if xsaveopt is enabled, xsaveopt replaces xsave | ||
144 | * because xsaveopt supports modified optimization which is not | ||
145 | * supported by xsave. | ||
146 | * | ||
147 | * If none of xsaves and xsaveopt is enabled, use xsave. | ||
148 | */ | ||
149 | alternative_input_2( | ||
150 | "1:"XSAVE, | ||
151 | "1:"XSAVEOPT, | ||
152 | X86_FEATURE_XSAVEOPT, | ||
153 | "1:"XSAVES, | ||
154 | X86_FEATURE_XSAVES, | ||
155 | [fx] "D" (fx), "a" (lmask), "d" (hmask) : | ||
156 | "memory"); | ||
157 | asm volatile("2:\n\t" | ||
158 | xstate_fault | ||
159 | : "0" (0) | ||
68 | : "memory"); | 160 | : "memory"); |
69 | 161 | ||
70 | return err; | 162 | return err; |
71 | } | 163 | } |
72 | 164 | ||
165 | /* | ||
166 | * Restore processor xstate from xsave area. | ||
167 | */ | ||
168 | static inline int xrstor_state(struct xsave_struct *fx, u64 mask) | ||
169 | { | ||
170 | int err = 0; | ||
171 | u32 lmask = mask; | ||
172 | u32 hmask = mask >> 32; | ||
173 | |||
174 | /* | ||
175 | * Use xrstors to restore context if it is enabled. xrstors supports | ||
176 | * compacted format of xsave area which is not supported by xrstor. | ||
177 | */ | ||
178 | alternative_input( | ||
179 | "1: " XRSTOR, | ||
180 | "1: " XRSTORS, | ||
181 | X86_FEATURE_XSAVES, | ||
182 | "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask) | ||
183 | : "memory"); | ||
184 | |||
185 | asm volatile("2:\n" | ||
186 | xstate_fault | ||
187 | : "0" (0) | ||
188 | : "memory"); | ||
189 | |||
190 | return err; | ||
191 | } | ||
192 | |||
193 | /* | ||
194 | * Save xstate context for old process during context switch. | ||
195 | */ | ||
196 | static inline void fpu_xsave(struct fpu *fpu) | ||
197 | { | ||
198 | xsave_state(&fpu->state->xsave, -1); | ||
199 | } | ||
200 | |||
201 | /* | ||
202 | * Restore xstate context for new process during context switch. | ||
203 | */ | ||
204 | static inline int fpu_xrstor_checking(struct xsave_struct *fx) | ||
205 | { | ||
206 | return xrstor_state(fx, -1); | ||
207 | } | ||
208 | |||
209 | /* | ||
210 | * Save xstate to user space xsave area. | ||
211 | * | ||
212 | * We don't use modified optimization because xrstor/xrstors might track | ||
213 | * a different application. | ||
214 | * | ||
215 | * We don't use compacted format xsave area for | ||
216 | * backward compatibility for old applications which don't understand | ||
217 | * compacted format of xsave area. | ||
218 | */ | ||
73 | static inline int xsave_user(struct xsave_struct __user *buf) | 219 | static inline int xsave_user(struct xsave_struct __user *buf) |
74 | { | 220 | { |
75 | int err; | 221 | int err; |
@@ -83,69 +229,34 @@ static inline int xsave_user(struct xsave_struct __user *buf) | |||
83 | return -EFAULT; | 229 | return -EFAULT; |
84 | 230 | ||
85 | __asm__ __volatile__(ASM_STAC "\n" | 231 | __asm__ __volatile__(ASM_STAC "\n" |
86 | "1: .byte " REX_PREFIX "0x0f,0xae,0x27\n" | 232 | "1:"XSAVE"\n" |
87 | "2: " ASM_CLAC "\n" | 233 | "2: " ASM_CLAC "\n" |
88 | ".section .fixup,\"ax\"\n" | 234 | xstate_fault |
89 | "3: movl $-1,%[err]\n" | ||
90 | " jmp 2b\n" | ||
91 | ".previous\n" | ||
92 | _ASM_EXTABLE(1b,3b) | ||
93 | : [err] "=r" (err) | ||
94 | : "D" (buf), "a" (-1), "d" (-1), "0" (0) | 235 | : "D" (buf), "a" (-1), "d" (-1), "0" (0) |
95 | : "memory"); | 236 | : "memory"); |
96 | return err; | 237 | return err; |
97 | } | 238 | } |
98 | 239 | ||
240 | /* | ||
241 | * Restore xstate from user space xsave area. | ||
242 | */ | ||
99 | static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask) | 243 | static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask) |
100 | { | 244 | { |
101 | int err; | 245 | int err = 0; |
102 | struct xsave_struct *xstate = ((__force struct xsave_struct *)buf); | 246 | struct xsave_struct *xstate = ((__force struct xsave_struct *)buf); |
103 | u32 lmask = mask; | 247 | u32 lmask = mask; |
104 | u32 hmask = mask >> 32; | 248 | u32 hmask = mask >> 32; |
105 | 249 | ||
106 | __asm__ __volatile__(ASM_STAC "\n" | 250 | __asm__ __volatile__(ASM_STAC "\n" |
107 | "1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n" | 251 | "1:"XRSTOR"\n" |
108 | "2: " ASM_CLAC "\n" | 252 | "2: " ASM_CLAC "\n" |
109 | ".section .fixup,\"ax\"\n" | 253 | xstate_fault |
110 | "3: movl $-1,%[err]\n" | ||
111 | " jmp 2b\n" | ||
112 | ".previous\n" | ||
113 | _ASM_EXTABLE(1b,3b) | ||
114 | : [err] "=r" (err) | ||
115 | : "D" (xstate), "a" (lmask), "d" (hmask), "0" (0) | 254 | : "D" (xstate), "a" (lmask), "d" (hmask), "0" (0) |
116 | : "memory"); /* memory required? */ | 255 | : "memory"); /* memory required? */ |
117 | return err; | 256 | return err; |
118 | } | 257 | } |
119 | 258 | ||
120 | static inline void xrstor_state(struct xsave_struct *fx, u64 mask) | 259 | void *get_xsave_addr(struct xsave_struct *xsave, int xstate); |
121 | { | 260 | void setup_xstate_comp(void); |
122 | u32 lmask = mask; | ||
123 | u32 hmask = mask >> 32; | ||
124 | |||
125 | asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t" | ||
126 | : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask) | ||
127 | : "memory"); | ||
128 | } | ||
129 | |||
130 | static inline void xsave_state(struct xsave_struct *fx, u64 mask) | ||
131 | { | ||
132 | u32 lmask = mask; | ||
133 | u32 hmask = mask >> 32; | ||
134 | 261 | ||
135 | asm volatile(".byte " REX_PREFIX "0x0f,0xae,0x27\n\t" | ||
136 | : : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask) | ||
137 | : "memory"); | ||
138 | } | ||
139 | |||
140 | static inline void fpu_xsave(struct fpu *fpu) | ||
141 | { | ||
142 | /* This, however, we can work around by forcing the compiler to select | ||
143 | an addressing mode that doesn't require extended registers. */ | ||
144 | alternative_input( | ||
145 | ".byte " REX_PREFIX "0x0f,0xae,0x27", | ||
146 | ".byte " REX_PREFIX "0x0f,0xae,0x37", | ||
147 | X86_FEATURE_XSAVEOPT, | ||
148 | [fx] "D" (&fpu->state->xsave), "a" (-1), "d" (-1) : | ||
149 | "memory"); | ||
150 | } | ||
151 | #endif | 262 | #endif |
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h index eac9e92fe181..e21331ce368f 100644 --- a/arch/x86/include/uapi/asm/msr-index.h +++ b/arch/x86/include/uapi/asm/msr-index.h | |||
@@ -149,6 +149,9 @@ | |||
149 | 149 | ||
150 | #define MSR_CORE_C1_RES 0x00000660 | 150 | #define MSR_CORE_C1_RES 0x00000660 |
151 | 151 | ||
152 | #define MSR_CC6_DEMOTION_POLICY_CONFIG 0x00000668 | ||
153 | #define MSR_MC6_DEMOTION_POLICY_CONFIG 0x00000669 | ||
154 | |||
152 | #define MSR_AMD64_MC0_MASK 0xc0010044 | 155 | #define MSR_AMD64_MC0_MASK 0xc0010044 |
153 | 156 | ||
154 | #define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) | 157 | #define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x)) |