Commit 9ce04f9238cafcfd09a502f2bc8c13b5f44ec590
Exists in
master
and in
39 other branches
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/…
…git/tip/linux-2.6-tip * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: ptrace, x86: fix the usage of ptrace_fork() i8327: fix outb() parameter order x86: fix math_emu register frame access x86: math_emu info cleanup x86: include correct %gs in a.out core dump x86, vmi: put a missing paravirt_release_pmd in pgd_dtor x86: find nr_irqs_gsi with mp_ioapic_routing x86: add clflush before monitor for Intel 7400 series x86: disable intel_iommu support by default x86: don't apply __supported_pte_mask to non-present ptes x86: fix grammar in user-visible BIOS warning x86/Kconfig.cpu: make Kconfig help readable in the console x86, 64-bit: print DMI info in the oops trace
Showing 26 changed files Side-by-side Diff
- Documentation/kernel-parameters.txt
- arch/x86/Kconfig
- arch/x86/Kconfig.cpu
- arch/x86/include/asm/a.out-core.h
- arch/x86/include/asm/cpufeature.h
- arch/x86/include/asm/math_emu.h
- arch/x86/include/asm/mpspec.h
- arch/x86/include/asm/pgtable.h
- arch/x86/include/asm/processor.h
- arch/x86/include/asm/traps.h
- arch/x86/include/asm/xen/page.h
- arch/x86/kernel/acpi/boot.c
- arch/x86/kernel/cpu/intel.c
- arch/x86/kernel/i8237.c
- arch/x86/kernel/io_apic.c
- arch/x86/kernel/process.c
- arch/x86/kernel/process_64.c
- arch/x86/kernel/setup.c
- arch/x86/kernel/traps.c
- arch/x86/kernel/vmi_32.c
- arch/x86/math-emu/fpu_entry.c
- arch/x86/math-emu/fpu_proto.h
- arch/x86/math-emu/fpu_system.h
- arch/x86/math-emu/get_address.c
- drivers/pci/intel-iommu.c
- kernel/fork.c
Documentation/kernel-parameters.txt
arch/x86/Kconfig
... | ... | @@ -1802,6 +1802,17 @@ |
1802 | 1802 | and include PCI device scope covered by these DMA |
1803 | 1803 | remapping devices. |
1804 | 1804 | |
1805 | +config DMAR_DEFAULT_ON | |
1806 | + def_bool n | |
1807 | + prompt "Enable DMA Remapping Devices by default" | |
1808 | + depends on DMAR | |
1809 | + help | |
1810 | + Selecting this option will enable a DMAR device at boot time if | |
1811 | + one is found. If this option is not selected, DMAR support can | |
1812 | + be enabled by passing intel_iommu=on to the kernel. It is | |
1813 | + recommended you say N here while the DMAR code remains | |
1814 | + experimental. | |
1815 | + | |
1805 | 1816 | config DMAR_GFX_WA |
1806 | 1817 | def_bool y |
1807 | 1818 | prompt "Support for Graphics workaround" |
arch/x86/Kconfig.cpu
... | ... | @@ -167,9 +167,9 @@ |
167 | 167 | config MK8 |
168 | 168 | bool "Opteron/Athlon64/Hammer/K8" |
169 | 169 | help |
170 | - Select this for an AMD Opteron or Athlon64 Hammer-family processor. Enables | |
171 | - use of some extended instructions, and passes appropriate optimization | |
172 | - flags to GCC. | |
170 | + Select this for an AMD Opteron or Athlon64 Hammer-family processor. | |
171 | + Enables use of some extended instructions, and passes appropriate | |
172 | + optimization flags to GCC. | |
173 | 173 | |
174 | 174 | config MCRUSOE |
175 | 175 | bool "Crusoe" |
176 | 176 | |
... | ... | @@ -256,10 +256,12 @@ |
256 | 256 | config MCORE2 |
257 | 257 | bool "Core 2/newer Xeon" |
258 | 258 | help |
259 | - Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx) | |
260 | - CPUs. You can distinguish newer from older Xeons by the CPU family | |
261 | - in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo) | |
262 | 259 | |
260 | + Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and | |
261 | + 53xx) CPUs. You can distinguish newer from older Xeons by the CPU | |
262 | + family in /proc/cpuinfo. Newer ones have 6 and older ones 15 | |
263 | + (not a typo) | |
264 | + | |
263 | 265 | config GENERIC_CPU |
264 | 266 | bool "Generic-x86-64" |
265 | 267 | depends on X86_64 |
266 | 268 | |
... | ... | @@ -320,14 +322,14 @@ |
320 | 322 | bool "PentiumPro memory ordering errata workaround" |
321 | 323 | depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1 |
322 | 324 | help |
323 | - Old PentiumPro multiprocessor systems had errata that could cause memory | |
324 | - operations to violate the x86 ordering standard in rare cases. Enabling this | |
325 | - option will attempt to work around some (but not all) occurances of | |
326 | - this problem, at the cost of much heavier spinlock and memory barrier | |
327 | - operations. | |
325 | + Old PentiumPro multiprocessor systems had errata that could cause | |
326 | + memory operations to violate the x86 ordering standard in rare cases. | |
327 | + Enabling this option will attempt to work around some (but not all) | |
328 | + occurances of this problem, at the cost of much heavier spinlock and | |
329 | + memory barrier operations. | |
328 | 330 | |
329 | - If unsure, say n here. Even distro kernels should think twice before enabling | |
330 | - this: there are few systems, and an unlikely bug. | |
331 | + If unsure, say n here. Even distro kernels should think twice before | |
332 | + enabling this: there are few systems, and an unlikely bug. | |
331 | 333 | |
332 | 334 | config X86_F00F_BUG |
333 | 335 | def_bool y |
arch/x86/include/asm/a.out-core.h
... | ... | @@ -23,8 +23,6 @@ |
23 | 23 | */ |
24 | 24 | static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) |
25 | 25 | { |
26 | - u16 gs; | |
27 | - | |
28 | 26 | /* changed the size calculations - should hopefully work better. lbt */ |
29 | 27 | dump->magic = CMAGIC; |
30 | 28 | dump->start_code = 0; |
... | ... | @@ -57,7 +55,7 @@ |
57 | 55 | dump->regs.ds = (u16)regs->ds; |
58 | 56 | dump->regs.es = (u16)regs->es; |
59 | 57 | dump->regs.fs = (u16)regs->fs; |
60 | - savesegment(gs, gs); | |
58 | + savesegment(gs, dump->regs.gs); | |
61 | 59 | dump->regs.orig_ax = regs->orig_ax; |
62 | 60 | dump->regs.ip = regs->ip; |
63 | 61 | dump->regs.cs = (u16)regs->cs; |
arch/x86/include/asm/cpufeature.h
... | ... | @@ -93,6 +93,7 @@ |
93 | 93 | #define X86_FEATURE_XTOPOLOGY (3*32+22) /* cpu topology enum extensions */ |
94 | 94 | #define X86_FEATURE_TSC_RELIABLE (3*32+23) /* TSC is known to be reliable */ |
95 | 95 | #define X86_FEATURE_NONSTOP_TSC (3*32+24) /* TSC does not stop in C states */ |
96 | +#define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */ | |
96 | 97 | |
97 | 98 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
98 | 99 | #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ |
arch/x86/include/asm/math_emu.h
1 | 1 | #ifndef _ASM_X86_MATH_EMU_H |
2 | 2 | #define _ASM_X86_MATH_EMU_H |
3 | 3 | |
4 | +#include <asm/ptrace.h> | |
5 | +#include <asm/vm86.h> | |
6 | + | |
4 | 7 | /* This structure matches the layout of the data saved to the stack |
5 | 8 | following a device-not-present interrupt, part of it saved |
6 | 9 | automatically by the 80386/80486. |
7 | 10 | */ |
8 | -struct info { | |
11 | +struct math_emu_info { | |
9 | 12 | long ___orig_eip; |
10 | - long ___ebx; | |
11 | - long ___ecx; | |
12 | - long ___edx; | |
13 | - long ___esi; | |
14 | - long ___edi; | |
15 | - long ___ebp; | |
16 | - long ___eax; | |
17 | - long ___ds; | |
18 | - long ___es; | |
19 | - long ___fs; | |
20 | - long ___orig_eax; | |
21 | - long ___eip; | |
22 | - long ___cs; | |
23 | - long ___eflags; | |
24 | - long ___esp; | |
25 | - long ___ss; | |
26 | - long ___vm86_es; /* This and the following only in vm86 mode */ | |
27 | - long ___vm86_ds; | |
28 | - long ___vm86_fs; | |
29 | - long ___vm86_gs; | |
13 | + union { | |
14 | + struct pt_regs *regs; | |
15 | + struct kernel_vm86_regs *vm86; | |
16 | + }; | |
30 | 17 | }; |
31 | 18 | #endif /* _ASM_X86_MATH_EMU_H */ |
arch/x86/include/asm/mpspec.h
... | ... | @@ -60,6 +60,7 @@ |
60 | 60 | u32 gsi); |
61 | 61 | extern void mp_config_acpi_legacy_irqs(void); |
62 | 62 | extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low); |
63 | +extern int acpi_probe_gsi(void); | |
63 | 64 | #ifdef CONFIG_X86_IO_APIC |
64 | 65 | extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, |
65 | 66 | u32 gsi, int triggering, int polarity); |
... | ... | @@ -71,6 +72,11 @@ |
71 | 72 | return 0; |
72 | 73 | } |
73 | 74 | #endif |
75 | +#else /* !CONFIG_ACPI: */ | |
76 | +static inline int acpi_probe_gsi(void) | |
77 | +{ | |
78 | + return 0; | |
79 | +} | |
74 | 80 | #endif /* CONFIG_ACPI */ |
75 | 81 | |
76 | 82 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) |
arch/x86/include/asm/pgtable.h
... | ... | @@ -302,16 +302,30 @@ |
302 | 302 | |
303 | 303 | extern pteval_t __supported_pte_mask; |
304 | 304 | |
305 | +/* | |
306 | + * Mask out unsupported bits in a present pgprot. Non-present pgprots | |
307 | + * can use those bits for other purposes, so leave them be. | |
308 | + */ | |
309 | +static inline pgprotval_t massage_pgprot(pgprot_t pgprot) | |
310 | +{ | |
311 | + pgprotval_t protval = pgprot_val(pgprot); | |
312 | + | |
313 | + if (protval & _PAGE_PRESENT) | |
314 | + protval &= __supported_pte_mask; | |
315 | + | |
316 | + return protval; | |
317 | +} | |
318 | + | |
305 | 319 | static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) |
306 | 320 | { |
307 | - return __pte((((phys_addr_t)page_nr << PAGE_SHIFT) | | |
308 | - pgprot_val(pgprot)) & __supported_pte_mask); | |
321 | + return __pte(((phys_addr_t)page_nr << PAGE_SHIFT) | | |
322 | + massage_pgprot(pgprot)); | |
309 | 323 | } |
310 | 324 | |
311 | 325 | static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) |
312 | 326 | { |
313 | - return __pmd((((phys_addr_t)page_nr << PAGE_SHIFT) | | |
314 | - pgprot_val(pgprot)) & __supported_pte_mask); | |
327 | + return __pmd(((phys_addr_t)page_nr << PAGE_SHIFT) | | |
328 | + massage_pgprot(pgprot)); | |
315 | 329 | } |
316 | 330 | |
317 | 331 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
... | ... | @@ -323,7 +337,7 @@ |
323 | 337 | * the newprot (if present): |
324 | 338 | */ |
325 | 339 | val &= _PAGE_CHG_MASK; |
326 | - val |= pgprot_val(newprot) & (~_PAGE_CHG_MASK) & __supported_pte_mask; | |
340 | + val |= massage_pgprot(newprot) & ~_PAGE_CHG_MASK; | |
327 | 341 | |
328 | 342 | return __pte(val); |
329 | 343 | } |
... | ... | @@ -339,7 +353,7 @@ |
339 | 353 | |
340 | 354 | #define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK) |
341 | 355 | |
342 | -#define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | |
356 | +#define canon_pgprot(p) __pgprot(massage_pgprot(p)) | |
343 | 357 | |
344 | 358 | static inline int is_new_memtype_allowed(unsigned long flags, |
345 | 359 | unsigned long new_flags) |
arch/x86/include/asm/processor.h
arch/x86/include/asm/traps.h
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | dotraplinkage void do_overflow(struct pt_regs *, long); |
42 | 42 | dotraplinkage void do_bounds(struct pt_regs *, long); |
43 | 43 | dotraplinkage void do_invalid_op(struct pt_regs *, long); |
44 | -dotraplinkage void do_device_not_available(struct pt_regs *, long); | |
44 | +dotraplinkage void do_device_not_available(struct pt_regs); | |
45 | 45 | dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long); |
46 | 46 | dotraplinkage void do_invalid_TSS(struct pt_regs *, long); |
47 | 47 | dotraplinkage void do_segment_not_present(struct pt_regs *, long); |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | extern int kstack_depth_to_print; |
78 | 78 | |
79 | 79 | void math_error(void __user *); |
80 | -asmlinkage void math_emulate(long); | |
80 | +void math_emulate(struct math_emu_info *); | |
81 | 81 | #ifdef CONFIG_X86_32 |
82 | 82 | unsigned long patch_espfix_desc(unsigned long, unsigned long); |
83 | 83 | #else |
arch/x86/include/asm/xen/page.h
arch/x86/kernel/acpi/boot.c
... | ... | @@ -973,6 +973,29 @@ |
973 | 973 | nr_ioapics++; |
974 | 974 | } |
975 | 975 | |
976 | +int __init acpi_probe_gsi(void) | |
977 | +{ | |
978 | + int idx; | |
979 | + int gsi; | |
980 | + int max_gsi = 0; | |
981 | + | |
982 | + if (acpi_disabled) | |
983 | + return 0; | |
984 | + | |
985 | + if (!acpi_ioapic) | |
986 | + return 0; | |
987 | + | |
988 | + max_gsi = 0; | |
989 | + for (idx = 0; idx < nr_ioapics; idx++) { | |
990 | + gsi = mp_ioapic_routing[idx].gsi_end; | |
991 | + | |
992 | + if (gsi > max_gsi) | |
993 | + max_gsi = gsi; | |
994 | + } | |
995 | + | |
996 | + return max_gsi + 1; | |
997 | +} | |
998 | + | |
976 | 999 | static void assign_to_mp_irq(struct mp_config_intsrc *m, |
977 | 1000 | struct mp_config_intsrc *mp_irq) |
978 | 1001 | { |
arch/x86/kernel/cpu/intel.c
... | ... | @@ -291,6 +291,9 @@ |
291 | 291 | ds_init_intel(c); |
292 | 292 | } |
293 | 293 | |
294 | + if (c->x86 == 6 && c->x86_model == 29 && cpu_has_clflush) | |
295 | + set_cpu_cap(c, X86_FEATURE_CLFLUSH_MONITOR); | |
296 | + | |
294 | 297 | #ifdef CONFIG_X86_64 |
295 | 298 | if (c->x86 == 15) |
296 | 299 | c->x86_cache_alignment = c->x86_clflush_size * 2; |
arch/x86/kernel/i8237.c
... | ... | @@ -28,10 +28,10 @@ |
28 | 28 | |
29 | 29 | flags = claim_dma_lock(); |
30 | 30 | |
31 | - dma_outb(DMA1_RESET_REG, 0); | |
32 | - dma_outb(DMA2_RESET_REG, 0); | |
31 | + dma_outb(0, DMA1_RESET_REG); | |
32 | + dma_outb(0, DMA2_RESET_REG); | |
33 | 33 | |
34 | - for (i = 0;i < 8;i++) { | |
34 | + for (i = 0; i < 8; i++) { | |
35 | 35 | set_dma_addr(i, 0x000000); |
36 | 36 | /* DMA count is a bit weird so this is not 0 */ |
37 | 37 | set_dma_count(i, 1); |
38 | 38 | |
... | ... | @@ -51,14 +51,14 @@ |
51 | 51 | } |
52 | 52 | |
53 | 53 | static struct sysdev_class i8237_sysdev_class = { |
54 | - .name = "i8237", | |
55 | - .suspend = i8237A_suspend, | |
56 | - .resume = i8237A_resume, | |
54 | + .name = "i8237", | |
55 | + .suspend = i8237A_suspend, | |
56 | + .resume = i8237A_resume, | |
57 | 57 | }; |
58 | 58 | |
59 | 59 | static struct sys_device device_i8237A = { |
60 | - .id = 0, | |
61 | - .cls = &i8237_sysdev_class, | |
60 | + .id = 0, | |
61 | + .cls = &i8237_sysdev_class, | |
62 | 62 | }; |
63 | 63 | |
64 | 64 | static int __init i8237A_init_sysfs(void) |
... | ... | @@ -68,6 +68,5 @@ |
68 | 68 | error = sysdev_register(&device_i8237A); |
69 | 69 | return error; |
70 | 70 | } |
71 | - | |
72 | 71 | device_initcall(i8237A_init_sysfs); |
arch/x86/kernel/io_apic.c
... | ... | @@ -3841,14 +3841,24 @@ |
3841 | 3841 | |
3842 | 3842 | void __init probe_nr_irqs_gsi(void) |
3843 | 3843 | { |
3844 | - int idx; | |
3845 | 3844 | int nr = 0; |
3846 | 3845 | |
3847 | - for (idx = 0; idx < nr_ioapics; idx++) | |
3848 | - nr += io_apic_get_redir_entries(idx) + 1; | |
3849 | - | |
3850 | - if (nr > nr_irqs_gsi) | |
3846 | + nr = acpi_probe_gsi(); | |
3847 | + if (nr > nr_irqs_gsi) { | |
3851 | 3848 | nr_irqs_gsi = nr; |
3849 | + } else { | |
3850 | + /* for acpi=off or acpi is not compiled in */ | |
3851 | + int idx; | |
3852 | + | |
3853 | + nr = 0; | |
3854 | + for (idx = 0; idx < nr_ioapics; idx++) | |
3855 | + nr += io_apic_get_redir_entries(idx) + 1; | |
3856 | + | |
3857 | + if (nr > nr_irqs_gsi) | |
3858 | + nr_irqs_gsi = nr; | |
3859 | + } | |
3860 | + | |
3861 | + printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi); | |
3852 | 3862 | } |
3853 | 3863 | |
3854 | 3864 | /* -------------------------------------------------------------------------- |
arch/x86/kernel/process.c
... | ... | @@ -180,6 +180,9 @@ |
180 | 180 | |
181 | 181 | trace_power_start(&it, POWER_CSTATE, (ax>>4)+1); |
182 | 182 | if (!need_resched()) { |
183 | + if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) | |
184 | + clflush((void *)¤t_thread_info()->flags); | |
185 | + | |
183 | 186 | __monitor((void *)¤t_thread_info()->flags, 0, 0); |
184 | 187 | smp_mb(); |
185 | 188 | if (!need_resched()) |
... | ... | @@ -194,6 +197,9 @@ |
194 | 197 | struct power_trace it; |
195 | 198 | if (!need_resched()) { |
196 | 199 | trace_power_start(&it, POWER_CSTATE, 1); |
200 | + if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) | |
201 | + clflush((void *)¤t_thread_info()->flags); | |
202 | + | |
197 | 203 | __monitor((void *)¤t_thread_info()->flags, 0, 0); |
198 | 204 | smp_mb(); |
199 | 205 | if (!need_resched()) |
arch/x86/kernel/process_64.c
... | ... | @@ -40,6 +40,7 @@ |
40 | 40 | #include <linux/uaccess.h> |
41 | 41 | #include <linux/io.h> |
42 | 42 | #include <linux/ftrace.h> |
43 | +#include <linux/dmi.h> | |
43 | 44 | |
44 | 45 | #include <asm/pgtable.h> |
45 | 46 | #include <asm/system.h> |
46 | 47 | |
47 | 48 | |
... | ... | @@ -151,14 +152,18 @@ |
151 | 152 | unsigned long d0, d1, d2, d3, d6, d7; |
152 | 153 | unsigned int fsindex, gsindex; |
153 | 154 | unsigned int ds, cs, es; |
155 | + const char *board; | |
154 | 156 | |
155 | 157 | printk("\n"); |
156 | 158 | print_modules(); |
157 | - printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s\n", | |
159 | + board = dmi_get_system_info(DMI_PRODUCT_NAME); | |
160 | + if (!board) | |
161 | + board = ""; | |
162 | + printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s %s\n", | |
158 | 163 | current->pid, current->comm, print_tainted(), |
159 | 164 | init_utsname()->release, |
160 | 165 | (int)strcspn(init_utsname()->version, " "), |
161 | - init_utsname()->version); | |
166 | + init_utsname()->version, board); | |
162 | 167 | printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip); |
163 | 168 | printk_address(regs->ip, 1); |
164 | 169 | printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, |
arch/x86/kernel/setup.c
... | ... | @@ -607,7 +607,7 @@ |
607 | 607 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) |
608 | 608 | { |
609 | 609 | printk(KERN_NOTICE |
610 | - "%s detected: BIOS may corrupt low RAM, working it around.\n", | |
610 | + "%s detected: BIOS may corrupt low RAM, working around it.\n", | |
611 | 611 | d->ident); |
612 | 612 | |
613 | 613 | e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED); |
arch/x86/kernel/traps.c
... | ... | @@ -896,7 +896,7 @@ |
896 | 896 | EXPORT_SYMBOL_GPL(math_state_restore); |
897 | 897 | |
898 | 898 | #ifndef CONFIG_MATH_EMULATION |
899 | -asmlinkage void math_emulate(long arg) | |
899 | +void math_emulate(struct math_emu_info *info) | |
900 | 900 | { |
901 | 901 | printk(KERN_EMERG |
902 | 902 | "math-emulation not enabled and no coprocessor found.\n"); |
903 | 903 | |
904 | 904 | |
... | ... | @@ -906,16 +906,19 @@ |
906 | 906 | } |
907 | 907 | #endif /* CONFIG_MATH_EMULATION */ |
908 | 908 | |
909 | -dotraplinkage void __kprobes | |
910 | -do_device_not_available(struct pt_regs *regs, long error) | |
909 | +dotraplinkage void __kprobes do_device_not_available(struct pt_regs regs) | |
911 | 910 | { |
912 | 911 | #ifdef CONFIG_X86_32 |
913 | 912 | if (read_cr0() & X86_CR0_EM) { |
914 | - conditional_sti(regs); | |
915 | - math_emulate(0); | |
913 | + struct math_emu_info info = { }; | |
914 | + | |
915 | + conditional_sti(®s); | |
916 | + | |
917 | + info.regs = ®s; | |
918 | + math_emulate(&info); | |
916 | 919 | } else { |
917 | 920 | math_state_restore(); /* interrupts still off */ |
918 | - conditional_sti(regs); | |
921 | + conditional_sti(®s); | |
919 | 922 | } |
920 | 923 | #else |
921 | 924 | math_state_restore(); |
arch/x86/kernel/vmi_32.c
... | ... | @@ -321,6 +321,16 @@ |
321 | 321 | } |
322 | 322 | |
323 | 323 | /* |
324 | + * We use the pgd_free hook for releasing the pgd page: | |
325 | + */ | |
326 | +static void vmi_pgd_free(struct mm_struct *mm, pgd_t *pgd) | |
327 | +{ | |
328 | + unsigned long pfn = __pa(pgd) >> PAGE_SHIFT; | |
329 | + | |
330 | + vmi_ops.release_page(pfn, VMI_PAGE_L2); | |
331 | +} | |
332 | + | |
333 | +/* | |
324 | 334 | * Helper macros for MMU update flags. We can defer updates until a flush |
325 | 335 | * or page invalidation only if the update is to the current address space |
326 | 336 | * (otherwise, there is no flush). We must check against init_mm, since |
... | ... | @@ -762,6 +772,7 @@ |
762 | 772 | if (vmi_ops.release_page) { |
763 | 773 | pv_mmu_ops.release_pte = vmi_release_pte; |
764 | 774 | pv_mmu_ops.release_pmd = vmi_release_pmd; |
775 | + pv_mmu_ops.pgd_free = vmi_pgd_free; | |
765 | 776 | } |
766 | 777 | |
767 | 778 | /* Set linear is needed in all cases */ |
arch/x86/math-emu/fpu_entry.c
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 | static int valid_prefix(u_char *Byte, u_char __user ** fpu_eip, |
132 | 132 | overrides * override); |
133 | 133 | |
134 | -asmlinkage void math_emulate(long arg) | |
134 | +void math_emulate(struct math_emu_info *info) | |
135 | 135 | { |
136 | 136 | u_char FPU_modrm, byte1; |
137 | 137 | unsigned short code; |
... | ... | @@ -161,7 +161,7 @@ |
161 | 161 | RE_ENTRANT_CHECK_ON; |
162 | 162 | #endif /* RE_ENTRANT_CHECKING */ |
163 | 163 | |
164 | - SETUP_DATA_AREA(arg); | |
164 | + FPU_info = info; | |
165 | 165 | |
166 | 166 | FPU_ORIG_EIP = FPU_EIP; |
167 | 167 | |
... | ... | @@ -659,7 +659,7 @@ |
659 | 659 | } |
660 | 660 | } |
661 | 661 | |
662 | -void math_abort(struct info *info, unsigned int signal) | |
662 | +void math_abort(struct math_emu_info *info, unsigned int signal) | |
663 | 663 | { |
664 | 664 | FPU_EIP = FPU_ORIG_EIP; |
665 | 665 | current->thread.trap_no = 16; |
arch/x86/math-emu/fpu_proto.h
... | ... | @@ -51,8 +51,8 @@ |
51 | 51 | extern void fst_i_(void); |
52 | 52 | extern void fstp_i(void); |
53 | 53 | /* fpu_entry.c */ |
54 | -asmlinkage extern void math_emulate(long arg); | |
55 | -extern void math_abort(struct info *info, unsigned int signal); | |
54 | +extern void math_emulate(struct math_emu_info *info); | |
55 | +extern void math_abort(struct math_emu_info *info, unsigned int signal); | |
56 | 56 | /* fpu_etc.c */ |
57 | 57 | extern void FPU_etc(void); |
58 | 58 | /* fpu_tags.c */ |
arch/x86/math-emu/fpu_system.h
... | ... | @@ -16,10 +16,6 @@ |
16 | 16 | #include <linux/kernel.h> |
17 | 17 | #include <linux/mm.h> |
18 | 18 | |
19 | -/* This sets the pointer FPU_info to point to the argument part | |
20 | - of the stack frame of math_emulate() */ | |
21 | -#define SETUP_DATA_AREA(arg) FPU_info = (struct info *) &arg | |
22 | - | |
23 | 19 | /* s is always from a cpu register, and the cpu does bounds checking |
24 | 20 | * during register load --> no further bounds checks needed */ |
25 | 21 | #define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3]) |
... | ... | @@ -38,12 +34,12 @@ |
38 | 34 | #define I387 (current->thread.xstate) |
39 | 35 | #define FPU_info (I387->soft.info) |
40 | 36 | |
41 | -#define FPU_CS (*(unsigned short *) &(FPU_info->___cs)) | |
42 | -#define FPU_SS (*(unsigned short *) &(FPU_info->___ss)) | |
43 | -#define FPU_DS (*(unsigned short *) &(FPU_info->___ds)) | |
44 | -#define FPU_EAX (FPU_info->___eax) | |
45 | -#define FPU_EFLAGS (FPU_info->___eflags) | |
46 | -#define FPU_EIP (FPU_info->___eip) | |
37 | +#define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs)) | |
38 | +#define FPU_SS (*(unsigned short *) &(FPU_info->regs->ss)) | |
39 | +#define FPU_DS (*(unsigned short *) &(FPU_info->regs->ds)) | |
40 | +#define FPU_EAX (FPU_info->regs->ax) | |
41 | +#define FPU_EFLAGS (FPU_info->regs->flags) | |
42 | +#define FPU_EIP (FPU_info->regs->ip) | |
47 | 43 | #define FPU_ORIG_EIP (FPU_info->___orig_eip) |
48 | 44 | |
49 | 45 | #define FPU_lookahead (I387->soft.lookahead) |
arch/x86/math-emu/get_address.c
... | ... | @@ -29,46 +29,43 @@ |
29 | 29 | #define FPU_WRITE_BIT 0x10 |
30 | 30 | |
31 | 31 | static int reg_offset[] = { |
32 | - offsetof(struct info, ___eax), | |
33 | - offsetof(struct info, ___ecx), | |
34 | - offsetof(struct info, ___edx), | |
35 | - offsetof(struct info, ___ebx), | |
36 | - offsetof(struct info, ___esp), | |
37 | - offsetof(struct info, ___ebp), | |
38 | - offsetof(struct info, ___esi), | |
39 | - offsetof(struct info, ___edi) | |
32 | + offsetof(struct pt_regs, ax), | |
33 | + offsetof(struct pt_regs, cx), | |
34 | + offsetof(struct pt_regs, dx), | |
35 | + offsetof(struct pt_regs, bx), | |
36 | + offsetof(struct pt_regs, sp), | |
37 | + offsetof(struct pt_regs, bp), | |
38 | + offsetof(struct pt_regs, si), | |
39 | + offsetof(struct pt_regs, di) | |
40 | 40 | }; |
41 | 41 | |
42 | -#define REG_(x) (*(long *)(reg_offset[(x)]+(u_char *) FPU_info)) | |
42 | +#define REG_(x) (*(long *)(reg_offset[(x)] + (u_char *)FPU_info->regs)) | |
43 | 43 | |
44 | 44 | static int reg_offset_vm86[] = { |
45 | - offsetof(struct info, ___cs), | |
46 | - offsetof(struct info, ___vm86_ds), | |
47 | - offsetof(struct info, ___vm86_es), | |
48 | - offsetof(struct info, ___vm86_fs), | |
49 | - offsetof(struct info, ___vm86_gs), | |
50 | - offsetof(struct info, ___ss), | |
51 | - offsetof(struct info, ___vm86_ds) | |
45 | + offsetof(struct pt_regs, cs), | |
46 | + offsetof(struct kernel_vm86_regs, ds), | |
47 | + offsetof(struct kernel_vm86_regs, es), | |
48 | + offsetof(struct kernel_vm86_regs, fs), | |
49 | + offsetof(struct kernel_vm86_regs, gs), | |
50 | + offsetof(struct pt_regs, ss), | |
51 | + offsetof(struct kernel_vm86_regs, ds) | |
52 | 52 | }; |
53 | 53 | |
54 | 54 | #define VM86_REG_(x) (*(unsigned short *) \ |
55 | - (reg_offset_vm86[((unsigned)x)]+(u_char *) FPU_info)) | |
55 | + (reg_offset_vm86[((unsigned)x)] + (u_char *)FPU_info->regs)) | |
56 | 56 | |
57 | -/* This dummy, gs is not saved on the stack. */ | |
58 | -#define ___GS ___ds | |
59 | - | |
60 | 57 | static int reg_offset_pm[] = { |
61 | - offsetof(struct info, ___cs), | |
62 | - offsetof(struct info, ___ds), | |
63 | - offsetof(struct info, ___es), | |
64 | - offsetof(struct info, ___fs), | |
65 | - offsetof(struct info, ___GS), | |
66 | - offsetof(struct info, ___ss), | |
67 | - offsetof(struct info, ___ds) | |
58 | + offsetof(struct pt_regs, cs), | |
59 | + offsetof(struct pt_regs, ds), | |
60 | + offsetof(struct pt_regs, es), | |
61 | + offsetof(struct pt_regs, fs), | |
62 | + offsetof(struct pt_regs, ds), /* dummy, not saved on stack */ | |
63 | + offsetof(struct pt_regs, ss), | |
64 | + offsetof(struct pt_regs, ds) | |
68 | 65 | }; |
69 | 66 | |
70 | 67 | #define PM_REG_(x) (*(unsigned short *) \ |
71 | - (reg_offset_pm[((unsigned)x)]+(u_char *) FPU_info)) | |
68 | + (reg_offset_pm[((unsigned)x)] + (u_char *)FPU_info->regs)) | |
72 | 69 | |
73 | 70 | /* Decode the SIB byte. This function assumes mod != 0 */ |
74 | 71 | static int sib(int mod, unsigned long *fpu_eip) |
75 | 72 | |
76 | 73 | |
77 | 74 | |
78 | 75 | |
79 | 76 | |
80 | 77 | |
81 | 78 | |
... | ... | @@ -349,34 +346,34 @@ |
349 | 346 | } |
350 | 347 | switch (rm) { |
351 | 348 | case 0: |
352 | - address += FPU_info->___ebx + FPU_info->___esi; | |
349 | + address += FPU_info->regs->bx + FPU_info->regs->si; | |
353 | 350 | break; |
354 | 351 | case 1: |
355 | - address += FPU_info->___ebx + FPU_info->___edi; | |
352 | + address += FPU_info->regs->bx + FPU_info->regs->di; | |
356 | 353 | break; |
357 | 354 | case 2: |
358 | - address += FPU_info->___ebp + FPU_info->___esi; | |
355 | + address += FPU_info->regs->bp + FPU_info->regs->si; | |
359 | 356 | if (addr_modes.override.segment == PREFIX_DEFAULT) |
360 | 357 | addr_modes.override.segment = PREFIX_SS_; |
361 | 358 | break; |
362 | 359 | case 3: |
363 | - address += FPU_info->___ebp + FPU_info->___edi; | |
360 | + address += FPU_info->regs->bp + FPU_info->regs->di; | |
364 | 361 | if (addr_modes.override.segment == PREFIX_DEFAULT) |
365 | 362 | addr_modes.override.segment = PREFIX_SS_; |
366 | 363 | break; |
367 | 364 | case 4: |
368 | - address += FPU_info->___esi; | |
365 | + address += FPU_info->regs->si; | |
369 | 366 | break; |
370 | 367 | case 5: |
371 | - address += FPU_info->___edi; | |
368 | + address += FPU_info->regs->di; | |
372 | 369 | break; |
373 | 370 | case 6: |
374 | - address += FPU_info->___ebp; | |
371 | + address += FPU_info->regs->bp; | |
375 | 372 | if (addr_modes.override.segment == PREFIX_DEFAULT) |
376 | 373 | addr_modes.override.segment = PREFIX_SS_; |
377 | 374 | break; |
378 | 375 | case 7: |
379 | - address += FPU_info->___ebx; | |
376 | + address += FPU_info->regs->bx; | |
380 | 377 | break; |
381 | 378 | } |
382 | 379 |
drivers/pci/intel-iommu.c
... | ... | @@ -268,7 +268,12 @@ |
268 | 268 | |
269 | 269 | static void domain_remove_dev_info(struct dmar_domain *domain); |
270 | 270 | |
271 | -int dmar_disabled; | |
271 | +#ifdef CONFIG_DMAR_DEFAULT_ON | |
272 | +int dmar_disabled = 0; | |
273 | +#else | |
274 | +int dmar_disabled = 1; | |
275 | +#endif /*CONFIG_DMAR_DEFAULT_ON*/ | |
276 | + | |
272 | 277 | static int __initdata dmar_map_gfx = 1; |
273 | 278 | static int dmar_forcedac; |
274 | 279 | static int intel_iommu_strict; |
275 | 280 | |
... | ... | @@ -284,9 +289,12 @@ |
284 | 289 | if (!str) |
285 | 290 | return -EINVAL; |
286 | 291 | while (*str) { |
287 | - if (!strncmp(str, "off", 3)) { | |
292 | + if (!strncmp(str, "on", 2)) { | |
293 | + dmar_disabled = 0; | |
294 | + printk(KERN_INFO "Intel-IOMMU: enabled\n"); | |
295 | + } else if (!strncmp(str, "off", 3)) { | |
288 | 296 | dmar_disabled = 1; |
289 | - printk(KERN_INFO"Intel-IOMMU: disabled\n"); | |
297 | + printk(KERN_INFO "Intel-IOMMU: disabled\n"); | |
290 | 298 | } else if (!strncmp(str, "igfx_off", 8)) { |
291 | 299 | dmar_map_gfx = 0; |
292 | 300 | printk(KERN_INFO |
kernel/fork.c
... | ... | @@ -1094,7 +1094,7 @@ |
1094 | 1094 | #ifdef CONFIG_DEBUG_MUTEXES |
1095 | 1095 | p->blocked_on = NULL; /* not blocked yet */ |
1096 | 1096 | #endif |
1097 | - if (unlikely(ptrace_reparented(current))) | |
1097 | + if (unlikely(current->ptrace)) | |
1098 | 1098 | ptrace_fork(p, clone_flags); |
1099 | 1099 | |
1100 | 1100 | /* Perform scheduler related setup. Assign this task to a CPU. */ |