diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/efi.h | 2 | ||||
-rw-r--r-- | include/asm-x86/hw_irq.h | 12 | ||||
-rw-r--r-- | include/asm-x86/i387.h | 32 | ||||
-rw-r--r-- | include/asm-x86/iommu.h | 2 | ||||
-rw-r--r-- | include/asm-x86/irq_vectors.h | 10 | ||||
-rw-r--r-- | include/asm-x86/kvm_host.h | 6 |
6 files changed, 60 insertions, 4 deletions
diff --git a/include/asm-x86/efi.h b/include/asm-x86/efi.h index 69c7b7ab43ec..ed2de22e8705 100644 --- a/include/asm-x86/efi.h +++ b/include/asm-x86/efi.h | |||
@@ -86,7 +86,7 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3, | |||
86 | efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ | 86 | efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ |
87 | (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) | 87 | (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) |
88 | 88 | ||
89 | extern void *efi_ioremap(unsigned long addr, unsigned long size); | 89 | extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size); |
90 | 90 | ||
91 | #endif /* CONFIG_X86_32 */ | 91 | #endif /* CONFIG_X86_32 */ |
92 | 92 | ||
diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h index 12f12b8eebfe..2905e93ff959 100644 --- a/include/asm-x86/hw_irq.h +++ b/include/asm-x86/hw_irq.h | |||
@@ -100,9 +100,17 @@ extern void (*const interrupt[NR_IRQS])(void); | |||
100 | #else | 100 | #else |
101 | typedef int vector_irq_t[NR_VECTORS]; | 101 | typedef int vector_irq_t[NR_VECTORS]; |
102 | DECLARE_PER_CPU(vector_irq_t, vector_irq); | 102 | DECLARE_PER_CPU(vector_irq_t, vector_irq); |
103 | extern spinlock_t vector_lock; | ||
104 | #endif | 103 | #endif |
105 | extern void setup_vector_irq(int cpu); | 104 | |
105 | #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_X86_64) | ||
106 | extern void lock_vector_lock(void); | ||
107 | extern void unlock_vector_lock(void); | ||
108 | extern void __setup_vector_irq(int cpu); | ||
109 | #else | ||
110 | static inline void lock_vector_lock(void) {} | ||
111 | static inline void unlock_vector_lock(void) {} | ||
112 | static inline void __setup_vector_irq(int cpu) {} | ||
113 | #endif | ||
106 | 114 | ||
107 | #endif /* !ASSEMBLY_ */ | 115 | #endif /* !ASSEMBLY_ */ |
108 | 116 | ||
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h index 3958de6aad0e..72c3bd27e8e1 100644 --- a/include/asm-x86/i387.h +++ b/include/asm-x86/i387.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/kernel_stat.h> | 14 | #include <linux/kernel_stat.h> |
15 | #include <linux/regset.h> | 15 | #include <linux/regset.h> |
16 | #include <linux/hardirq.h> | ||
16 | #include <asm/asm.h> | 17 | #include <asm/asm.h> |
17 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
18 | #include <asm/sigcontext.h> | 19 | #include <asm/sigcontext.h> |
@@ -234,6 +235,37 @@ static inline void kernel_fpu_end(void) | |||
234 | preempt_enable(); | 235 | preempt_enable(); |
235 | } | 236 | } |
236 | 237 | ||
238 | /* | ||
239 | * Some instructions like VIA's padlock instructions generate a spurious | ||
240 | * DNA fault but don't modify SSE registers. And these instructions | ||
241 | * get used from interrupt context aswell. To prevent these kernel instructions | ||
242 | * in interrupt context interact wrongly with other user/kernel fpu usage, we | ||
243 | * should use them only in the context of irq_ts_save/restore() | ||
244 | */ | ||
245 | static inline int irq_ts_save(void) | ||
246 | { | ||
247 | /* | ||
248 | * If we are in process context, we are ok to take a spurious DNA fault. | ||
249 | * Otherwise, doing clts() in process context require pre-emption to | ||
250 | * be disabled or some heavy lifting like kernel_fpu_begin() | ||
251 | */ | ||
252 | if (!in_interrupt()) | ||
253 | return 0; | ||
254 | |||
255 | if (read_cr0() & X86_CR0_TS) { | ||
256 | clts(); | ||
257 | return 1; | ||
258 | } | ||
259 | |||
260 | return 0; | ||
261 | } | ||
262 | |||
263 | static inline void irq_ts_restore(int TS_state) | ||
264 | { | ||
265 | if (TS_state) | ||
266 | stts(); | ||
267 | } | ||
268 | |||
237 | #ifdef CONFIG_X86_64 | 269 | #ifdef CONFIG_X86_64 |
238 | 270 | ||
239 | static inline void save_init_fpu(struct task_struct *tsk) | 271 | static inline void save_init_fpu(struct task_struct *tsk) |
diff --git a/include/asm-x86/iommu.h b/include/asm-x86/iommu.h index bdb823e6edb4..e86f44148c66 100644 --- a/include/asm-x86/iommu.h +++ b/include/asm-x86/iommu.h | |||
@@ -7,6 +7,8 @@ extern struct dma_mapping_ops nommu_dma_ops; | |||
7 | extern int force_iommu, no_iommu; | 7 | extern int force_iommu, no_iommu; |
8 | extern int iommu_detected; | 8 | extern int iommu_detected; |
9 | 9 | ||
10 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len); | ||
11 | |||
10 | #ifdef CONFIG_GART_IOMMU | 12 | #ifdef CONFIG_GART_IOMMU |
11 | extern int gart_iommu_aperture; | 13 | extern int gart_iommu_aperture; |
12 | extern int gart_iommu_aperture_allowed; | 14 | extern int gart_iommu_aperture_allowed; |
diff --git a/include/asm-x86/irq_vectors.h b/include/asm-x86/irq_vectors.h index 646d59f5ebf1..3f4b1b6be88c 100644 --- a/include/asm-x86/irq_vectors.h +++ b/include/asm-x86/irq_vectors.h | |||
@@ -109,7 +109,15 @@ | |||
109 | #define LAST_VM86_IRQ 15 | 109 | #define LAST_VM86_IRQ 15 |
110 | #define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15) | 110 | #define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15) |
111 | 111 | ||
112 | #if !defined(CONFIG_X86_VOYAGER) | 112 | #ifdef CONFIG_X86_64 |
113 | # if NR_CPUS < MAX_IO_APICS | ||
114 | # define NR_IRQS (NR_VECTORS + (32 * NR_CPUS)) | ||
115 | # else | ||
116 | # define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS)) | ||
117 | # endif | ||
118 | # define NR_IRQ_VECTORS NR_IRQS | ||
119 | |||
120 | #elif !defined(CONFIG_X86_VOYAGER) | ||
113 | 121 | ||
114 | # if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT) || defined(CONFIG_X86_VISWS) | 122 | # if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT) || defined(CONFIG_X86_VISWS) |
115 | 123 | ||
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index 95eb742765b3..72e9a525f91a 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/mmu_notifier.h> | ||
16 | 17 | ||
17 | #include <linux/kvm.h> | 18 | #include <linux/kvm.h> |
18 | #include <linux/kvm_para.h> | 19 | #include <linux/kvm_para.h> |
@@ -251,6 +252,7 @@ struct kvm_vcpu_arch { | |||
251 | gfn_t gfn; /* presumed gfn during guest pte update */ | 252 | gfn_t gfn; /* presumed gfn during guest pte update */ |
252 | pfn_t pfn; /* pfn corresponding to that gfn */ | 253 | pfn_t pfn; /* pfn corresponding to that gfn */ |
253 | int largepage; | 254 | int largepage; |
255 | unsigned long mmu_seq; | ||
254 | } update_pte; | 256 | } update_pte; |
255 | 257 | ||
256 | struct i387_fxsave_struct host_fx_image; | 258 | struct i387_fxsave_struct host_fx_image; |
@@ -729,4 +731,8 @@ asmlinkage void kvm_handle_fault_on_reboot(void); | |||
729 | KVM_EX_ENTRY " 666b, 667b \n\t" \ | 731 | KVM_EX_ENTRY " 666b, 667b \n\t" \ |
730 | ".popsection" | 732 | ".popsection" |
731 | 733 | ||
734 | #define KVM_ARCH_WANT_MMU_NOTIFIER | ||
735 | int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); | ||
736 | int kvm_age_hva(struct kvm *kvm, unsigned long hva); | ||
737 | |||
732 | #endif /* ASM_X86__KVM_HOST_H */ | 738 | #endif /* ASM_X86__KVM_HOST_H */ |