aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/x86_64/boot-options.txt5
-rw-r--r--arch/i386/defconfig7
-rw-r--r--arch/i386/kernel/nmi.c3
-rw-r--r--arch/i386/kernel/setup.c10
-rw-r--r--arch/i386/kernel/traps.c2
-rw-r--r--arch/x86_64/defconfig8
-rw-r--r--arch/x86_64/kernel/mpparse.c37
-rw-r--r--arch/x86_64/kernel/nmi.c4
-rw-r--r--arch/x86_64/kernel/pci-dma.c93
-rw-r--r--arch/x86_64/kernel/setup.c11
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S14
-rw-r--r--arch/x86_64/kernel/vsyscall.c8
-rw-r--r--include/asm-i386/nmi.h6
-rw-r--r--include/asm-x86_64/nmi.h7
-rw-r--r--include/asm-x86_64/semaphore.h4
-rw-r--r--include/asm-x86_64/uaccess.h7
-rw-r--r--include/linux/getcpu.h12
-rw-r--r--kernel/panic.c1
-rw-r--r--kernel/sys.c8
-rw-r--r--kernel/sysctl.c11
20 files changed, 152 insertions, 106 deletions
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
index 4303e0c12476..74b77f9e91bc 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -199,6 +199,11 @@ IOMMU
199 allowed overwrite iommu off workarounds for specific chipsets. 199 allowed overwrite iommu off workarounds for specific chipsets.
200 soft Use software bounce buffering (default for Intel machines) 200 soft Use software bounce buffering (default for Intel machines)
201 noaperture Don't touch the aperture for AGP. 201 noaperture Don't touch the aperture for AGP.
202 allowdac Allow DMA >4GB
203 When off all DMA over >4GB is forced through an IOMMU or bounce
204 buffering.
205 nodac Forbid DMA >4GB
206 panic Always panic when IOMMU overflows
202 207
203 swiotlb=pages[,force] 208 swiotlb=pages[,force]
204 209
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 1a29bfa26d0c..ee2d79bd8af7 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.18-git5 3# Linux kernel version: 2.6.18-git7
4# Tue Sep 26 09:30:47 2006 4# Wed Sep 27 21:53:10 2006
5# 5#
6CONFIG_X86_32=y 6CONFIG_X86_32=y
7CONFIG_GENERIC_TIME=y 7CONFIG_GENERIC_TIME=y
@@ -210,6 +210,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
210CONFIG_PM=y 210CONFIG_PM=y
211CONFIG_PM_LEGACY=y 211CONFIG_PM_LEGACY=y
212# CONFIG_PM_DEBUG is not set 212# CONFIG_PM_DEBUG is not set
213CONFIG_PM_SYSFS_DEPRECATED=y
213 214
214# 215#
215# ACPI (Advanced Configuration and Power Interface) Support 216# ACPI (Advanced Configuration and Power Interface) Support
@@ -292,6 +293,7 @@ CONFIG_PCI_DIRECT=y
292CONFIG_PCI_MMCONFIG=y 293CONFIG_PCI_MMCONFIG=y
293# CONFIG_PCIEPORTBUS is not set 294# CONFIG_PCIEPORTBUS is not set
294CONFIG_PCI_MSI=y 295CONFIG_PCI_MSI=y
296# CONFIG_PCI_MULTITHREAD_PROBE is not set
295# CONFIG_PCI_DEBUG is not set 297# CONFIG_PCI_DEBUG is not set
296CONFIG_ISA_DMA_API=y 298CONFIG_ISA_DMA_API=y
297# CONFIG_ISA is not set 299# CONFIG_ISA is not set
@@ -1427,6 +1429,7 @@ CONFIG_KPROBES=y
1427# 1429#
1428CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1430CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1429# CONFIG_PRINTK_TIME is not set 1431# CONFIG_PRINTK_TIME is not set
1432# CONFIG_ENABLE_MUST_CHECK is not set
1430CONFIG_MAGIC_SYSRQ=y 1433CONFIG_MAGIC_SYSRQ=y
1431CONFIG_UNUSED_SYMBOLS=y 1434CONFIG_UNUSED_SYMBOLS=y
1432CONFIG_DEBUG_KERNEL=y 1435CONFIG_DEBUG_KERNEL=y
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index dbda706fdd14..0fc4997fb143 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -31,6 +31,9 @@
31 31
32#include "mach_traps.h" 32#include "mach_traps.h"
33 33
34int unknown_nmi_panic;
35int nmi_watchdog_enabled;
36
34/* perfctr_nmi_owner tracks the ownership of the perfctr registers: 37/* perfctr_nmi_owner tracks the ownership of the perfctr registers:
35 * evtsel_nmi_owner tracks the ownership of the event selection 38 * evtsel_nmi_owner tracks the ownership of the event selection
36 * - different performance counters/ event selection may be reserved for 39 * - different performance counters/ event selection may be reserved for
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 814cdebf7377..000cf03751fe 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -209,9 +209,6 @@ static struct resource adapter_rom_resources[] = { {
209 .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM 209 .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
210} }; 210} };
211 211
212#define ADAPTER_ROM_RESOURCES \
213 (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
214
215static struct resource video_rom_resource = { 212static struct resource video_rom_resource = {
216 .name = "Video ROM", 213 .name = "Video ROM",
217 .start = 0xc0000, 214 .start = 0xc0000,
@@ -273,9 +270,6 @@ static struct resource standard_io_resources[] = { {
273 .flags = IORESOURCE_BUSY | IORESOURCE_IO 270 .flags = IORESOURCE_BUSY | IORESOURCE_IO
274} }; 271} };
275 272
276#define STANDARD_IO_RESOURCES \
277 (sizeof standard_io_resources / sizeof standard_io_resources[0])
278
279#define romsignature(x) (*(unsigned short *)(x) == 0xaa55) 273#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
280 274
281static int __init romchecksum(unsigned char *rom, unsigned long length) 275static int __init romchecksum(unsigned char *rom, unsigned long length)
@@ -332,7 +326,7 @@ static void __init probe_roms(void)
332 } 326 }
333 327
334 /* check for adapter roms on 2k boundaries */ 328 /* check for adapter roms on 2k boundaries */
335 for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) { 329 for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += 2048) {
336 rom = isa_bus_to_virt(start); 330 rom = isa_bus_to_virt(start);
337 if (!romsignature(rom)) 331 if (!romsignature(rom))
338 continue; 332 continue;
@@ -1272,7 +1266,7 @@ static int __init request_standard_resources(void)
1272 request_resource(&iomem_resource, &video_ram_resource); 1266 request_resource(&iomem_resource, &video_ram_resource);
1273 1267
1274 /* request I/O space for devices used on all i[345]86 PCs */ 1268 /* request I/O space for devices used on all i[345]86 PCs */
1275 for (i = 0; i < STANDARD_IO_RESOURCES; i++) 1269 for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
1276 request_resource(&ioport_resource, &standard_io_resources[i]); 1270 request_resource(&ioport_resource, &standard_io_resources[i]);
1277 return 0; 1271 return 0;
1278} 1272}
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index a13037fe0ee3..6820b8d643c7 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -57,6 +57,8 @@
57 57
58#include "mach_traps.h" 58#include "mach_traps.h"
59 59
60int panic_on_unrecovered_nmi;
61
60asmlinkage int system_call(void); 62asmlinkage int system_call(void);
61 63
62struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, 64struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 647610ecb580..4844b543bed0 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,11 +1,12 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.18-git5 3# Linux kernel version: 2.6.18-git7
4# Tue Sep 26 09:30:47 2006 4# Wed Sep 27 21:53:10 2006
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
8CONFIG_X86=y 8CONFIG_X86=y
9CONFIG_ZONE_DMA32=y
9CONFIG_LOCKDEP_SUPPORT=y 10CONFIG_LOCKDEP_SUPPORT=y
10CONFIG_STACKTRACE_SUPPORT=y 11CONFIG_STACKTRACE_SUPPORT=y
11CONFIG_SEMAPHORE_SLEEPERS=y 12CONFIG_SEMAPHORE_SLEEPERS=y
@@ -179,6 +180,7 @@ CONFIG_GENERIC_PENDING_IRQ=y
179CONFIG_PM=y 180CONFIG_PM=y
180# CONFIG_PM_LEGACY is not set 181# CONFIG_PM_LEGACY is not set
181# CONFIG_PM_DEBUG is not set 182# CONFIG_PM_DEBUG is not set
183# CONFIG_PM_SYSFS_DEPRECATED is not set
182CONFIG_SOFTWARE_SUSPEND=y 184CONFIG_SOFTWARE_SUSPEND=y
183CONFIG_PM_STD_PARTITION="" 185CONFIG_PM_STD_PARTITION=""
184CONFIG_SUSPEND_SMP=y 186CONFIG_SUSPEND_SMP=y
@@ -251,6 +253,7 @@ CONFIG_PCI_DIRECT=y
251CONFIG_PCI_MMCONFIG=y 253CONFIG_PCI_MMCONFIG=y
252CONFIG_PCIEPORTBUS=y 254CONFIG_PCIEPORTBUS=y
253CONFIG_PCI_MSI=y 255CONFIG_PCI_MSI=y
256# CONFIG_PCI_MULTITHREAD_PROBE is not set
254# CONFIG_PCI_DEBUG is not set 257# CONFIG_PCI_DEBUG is not set
255 258
256# 259#
@@ -1458,6 +1461,7 @@ CONFIG_KPROBES=y
1458# 1461#
1459CONFIG_TRACE_IRQFLAGS_SUPPORT=y 1462CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1460# CONFIG_PRINTK_TIME is not set 1463# CONFIG_PRINTK_TIME is not set
1464# CONFIG_ENABLE_MUST_CHECK is not set
1461CONFIG_MAGIC_SYSRQ=y 1465CONFIG_MAGIC_SYSRQ=y
1462CONFIG_UNUSED_SYMBOLS=y 1466CONFIG_UNUSED_SYMBOLS=y
1463CONFIG_DEBUG_KERNEL=y 1467CONFIG_DEBUG_KERNEL=y
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 20e88f4b564b..b8d53dfa9931 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -152,6 +152,21 @@ static void __init MP_bus_info (struct mpc_config_bus *m)
152 } 152 }
153} 153}
154 154
155static int bad_ioapic(unsigned long address)
156{
157 if (nr_ioapics >= MAX_IO_APICS) {
158 printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
159 "(found %d)\n", MAX_IO_APICS, nr_ioapics);
160 panic("Recompile kernel with bigger MAX_IO_APICS!\n");
161 }
162 if (!address) {
163 printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
164 " found in table, skipping!\n");
165 return 1;
166 }
167 return 0;
168}
169
155static void __init MP_ioapic_info (struct mpc_config_ioapic *m) 170static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
156{ 171{
157 if (!(m->mpc_flags & MPC_APIC_USABLE)) 172 if (!(m->mpc_flags & MPC_APIC_USABLE))
@@ -159,16 +174,10 @@ static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
159 174
160 printk("I/O APIC #%d at 0x%X.\n", 175 printk("I/O APIC #%d at 0x%X.\n",
161 m->mpc_apicid, m->mpc_apicaddr); 176 m->mpc_apicid, m->mpc_apicaddr);
162 if (nr_ioapics >= MAX_IO_APICS) { 177
163 printk(KERN_ERR "Max # of I/O APICs (%d) exceeded (found %d).\n", 178 if (bad_ioapic(m->mpc_apicaddr))
164 MAX_IO_APICS, nr_ioapics);
165 panic("Recompile kernel with bigger MAX_IO_APICS!.\n");
166 }
167 if (!m->mpc_apicaddr) {
168 printk(KERN_ERR "WARNING: bogus zero I/O APIC address"
169 " found in MP table, skipping!\n");
170 return; 179 return;
171 } 180
172 mp_ioapics[nr_ioapics] = *m; 181 mp_ioapics[nr_ioapics] = *m;
173 nr_ioapics++; 182 nr_ioapics++;
174} 183}
@@ -647,16 +656,8 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
647{ 656{
648 int idx = 0; 657 int idx = 0;
649 658
650 if (nr_ioapics >= MAX_IO_APICS) { 659 if (bad_ioapic(address))
651 printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
652 "(found %d)\n", MAX_IO_APICS, nr_ioapics);
653 panic("Recompile kernel with bigger MAX_IO_APICS!\n");
654 }
655 if (!address) {
656 printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
657 " found in MADT table, skipping!\n");
658 return; 660 return;
659 }
660 661
661 idx = nr_ioapics++; 662 idx = nr_ioapics++;
662 663
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 4d6fb047952e..7af9cb3e2d99 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -28,6 +28,10 @@
28#include <asm/mce.h> 28#include <asm/mce.h>
29#include <asm/intel_arch_perfmon.h> 29#include <asm/intel_arch_perfmon.h>
30 30
31int unknown_nmi_panic;
32int nmi_watchdog_enabled;
33int panic_on_unrecovered_nmi;
34
31/* perfctr_nmi_owner tracks the ownership of the perfctr registers: 35/* perfctr_nmi_owner tracks the ownership of the perfctr registers:
32 * evtsel_nmi_owner tracks the ownership of the event selection 36 * evtsel_nmi_owner tracks the ownership of the event selection
33 * - different performance counters/ event selection may be reserved for 37 * - different performance counters/ event selection may be reserved for
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
index 4dcb671bd19f..f8d857453f8a 100644
--- a/arch/x86_64/kernel/pci-dma.c
+++ b/arch/x86_64/kernel/pci-dma.c
@@ -170,8 +170,20 @@ void dma_free_coherent(struct device *dev, size_t size,
170} 170}
171EXPORT_SYMBOL(dma_free_coherent); 171EXPORT_SYMBOL(dma_free_coherent);
172 172
173static int forbid_dac __read_mostly;
174
173int dma_supported(struct device *dev, u64 mask) 175int dma_supported(struct device *dev, u64 mask)
174{ 176{
177#ifdef CONFIG_PCI
178 if (mask > 0xffffffff && forbid_dac > 0) {
179
180
181
182 printk(KERN_INFO "PCI: Disallowing DAC for device %s\n", dev->bus_id);
183 return 0;
184 }
185#endif
186
175 if (dma_ops->dma_supported) 187 if (dma_ops->dma_supported)
176 return dma_ops->dma_supported(dev, mask); 188 return dma_ops->dma_supported(dev, mask);
177 189
@@ -231,57 +243,64 @@ EXPORT_SYMBOL(dma_set_mask);
231 allowed overwrite iommu off workarounds for specific chipsets. 243 allowed overwrite iommu off workarounds for specific chipsets.
232 soft Use software bounce buffering (default for Intel machines) 244 soft Use software bounce buffering (default for Intel machines)
233 noaperture Don't touch the aperture for AGP. 245 noaperture Don't touch the aperture for AGP.
246 allowdac Allow DMA >4GB
247 nodac Forbid DMA >4GB
248 panic Force panic when IOMMU overflows
234*/ 249*/
235__init int iommu_setup(char *p) 250__init int iommu_setup(char *p)
236{ 251{
237 iommu_merge = 1; 252 iommu_merge = 1;
238 253
239 if (!p) 254 if (!p)
240 return -EINVAL; 255 return -EINVAL;
241 256
242 while (*p) { 257 while (*p) {
243 if (!strncmp(p,"off",3)) 258 if (!strncmp(p,"off",3))
244 no_iommu = 1; 259 no_iommu = 1;
245 /* gart_parse_options has more force support */ 260 /* gart_parse_options has more force support */
246 if (!strncmp(p,"force",5)) 261 if (!strncmp(p,"force",5))
247 force_iommu = 1; 262 force_iommu = 1;
248 if (!strncmp(p,"noforce",7)) { 263 if (!strncmp(p,"noforce",7)) {
249 iommu_merge = 0; 264 iommu_merge = 0;
250 force_iommu = 0; 265 force_iommu = 0;
251 } 266 }
252 267
253 if (!strncmp(p, "biomerge",8)) { 268 if (!strncmp(p, "biomerge",8)) {
254 iommu_bio_merge = 4096; 269 iommu_bio_merge = 4096;
255 iommu_merge = 1; 270 iommu_merge = 1;
256 force_iommu = 1; 271 force_iommu = 1;
257 } 272 }
258 if (!strncmp(p, "panic",5)) 273 if (!strncmp(p, "panic",5))
259 panic_on_overflow = 1; 274 panic_on_overflow = 1;
260 if (!strncmp(p, "nopanic",7)) 275 if (!strncmp(p, "nopanic",7))
261 panic_on_overflow = 0; 276 panic_on_overflow = 0;
262 if (!strncmp(p, "merge",5)) { 277 if (!strncmp(p, "merge",5)) {
263 iommu_merge = 1; 278 iommu_merge = 1;
264 force_iommu = 1; 279 force_iommu = 1;
265 } 280 }
266 if (!strncmp(p, "nomerge",7)) 281 if (!strncmp(p, "nomerge",7))
267 iommu_merge = 0; 282 iommu_merge = 0;
268 if (!strncmp(p, "forcesac",8)) 283 if (!strncmp(p, "forcesac",8))
269 iommu_sac_force = 1; 284 iommu_sac_force = 1;
285 if (!strncmp(p, "allowdac", 8))
286 forbid_dac = 0;
287 if (!strncmp(p, "nodac", 5))
288 forbid_dac = -1;
270 289
271#ifdef CONFIG_SWIOTLB 290#ifdef CONFIG_SWIOTLB
272 if (!strncmp(p, "soft",4)) 291 if (!strncmp(p, "soft",4))
273 swiotlb = 1; 292 swiotlb = 1;
274#endif 293#endif
275 294
276#ifdef CONFIG_IOMMU 295#ifdef CONFIG_IOMMU
277 gart_parse_options(p); 296 gart_parse_options(p);
278#endif 297#endif
279 298
280 p += strcspn(p, ","); 299 p += strcspn(p, ",");
281 if (*p == ',') 300 if (*p == ',')
282 ++p; 301 ++p;
283 } 302 }
284 return 0; 303 return 0;
285} 304}
286early_param("iommu", iommu_setup); 305early_param("iommu", iommu_setup);
287 306
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 0b00bb2ea576..fc944b5e8f4a 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -123,9 +123,6 @@ struct resource standard_io_resources[] = {
123 .flags = IORESOURCE_BUSY | IORESOURCE_IO } 123 .flags = IORESOURCE_BUSY | IORESOURCE_IO }
124}; 124};
125 125
126#define STANDARD_IO_RESOURCES \
127 (sizeof standard_io_resources / sizeof standard_io_resources[0])
128
129#define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM) 126#define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM)
130 127
131struct resource data_resource = { 128struct resource data_resource = {
@@ -172,9 +169,6 @@ static struct resource adapter_rom_resources[] = {
172 .flags = IORESOURCE_ROM } 169 .flags = IORESOURCE_ROM }
173}; 170};
174 171
175#define ADAPTER_ROM_RESOURCES \
176 (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
177
178static struct resource video_rom_resource = { 172static struct resource video_rom_resource = {
179 .name = "Video ROM", 173 .name = "Video ROM",
180 .start = 0xc0000, 174 .start = 0xc0000,
@@ -245,7 +239,8 @@ static void __init probe_roms(void)
245 } 239 }
246 240
247 /* check for adapter roms on 2k boundaries */ 241 /* check for adapter roms on 2k boundaries */
248 for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) { 242 for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper;
243 start += 2048) {
249 rom = isa_bus_to_virt(start); 244 rom = isa_bus_to_virt(start);
250 if (!romsignature(rom)) 245 if (!romsignature(rom))
251 continue; 246 continue;
@@ -537,7 +532,7 @@ void __init setup_arch(char **cmdline_p)
537 { 532 {
538 unsigned i; 533 unsigned i;
539 /* request I/O space for devices used on all i[345]86 PCs */ 534 /* request I/O space for devices used on all i[345]86 PCs */
540 for (i = 0; i < STANDARD_IO_RESOURCES; i++) 535 for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
541 request_resource(&ioport_resource, &standard_io_resources[i]); 536 request_resource(&ioport_resource, &standard_io_resources[i]);
542 } 537 }
543 538
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index d0564f1bcb0b..f8aeccf105fa 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -67,13 +67,6 @@ SECTIONS
67 67
68 _edata = .; /* End of data section */ 68 _edata = .; /* End of data section */
69 69
70 __bss_start = .; /* BSS */
71 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
72 *(.bss.page_aligned)
73 *(.bss)
74 }
75 __bss_stop = .;
76
77 . = ALIGN(PAGE_SIZE); 70 . = ALIGN(PAGE_SIZE);
78 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); 71 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
79 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { 72 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
@@ -229,6 +222,13 @@ SECTIONS
229 . = ALIGN(4096); 222 . = ALIGN(4096);
230 __nosave_end = .; 223 __nosave_end = .;
231 224
225 __bss_start = .; /* BSS */
226 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
227 *(.bss.page_aligned)
228 *(.bss)
229 }
230 __bss_stop = .;
231
232 _end = . ; 232 _end = . ;
233 233
234 /* Sections to be discarded */ 234 /* Sections to be discarded */
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
index ac48c3857ddb..07c086382059 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86_64/kernel/vsyscall.c
@@ -155,8 +155,8 @@ vgetcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
155 We do this here because otherwise user space would do it on 155 We do this here because otherwise user space would do it on
156 its own in a likely inferior way (no access to jiffies). 156 its own in a likely inferior way (no access to jiffies).
157 If you don't like it pass NULL. */ 157 If you don't like it pass NULL. */
158 if (tcache && tcache->t0 == (j = __jiffies)) { 158 if (tcache && tcache->blob[0] == (j = __jiffies)) {
159 p = tcache->t1; 159 p = tcache->blob[1];
160 } else if (__vgetcpu_mode == VGETCPU_RDTSCP) { 160 } else if (__vgetcpu_mode == VGETCPU_RDTSCP) {
161 /* Load per CPU data from RDTSCP */ 161 /* Load per CPU data from RDTSCP */
162 rdtscp(dummy, dummy, p); 162 rdtscp(dummy, dummy, p);
@@ -165,8 +165,8 @@ vgetcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
165 asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG)); 165 asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
166 } 166 }
167 if (tcache) { 167 if (tcache) {
168 tcache->t0 = j; 168 tcache->blob[0] = j;
169 tcache->t1 = p; 169 tcache->blob[1] = p;
170 } 170 }
171 if (cpu) 171 if (cpu)
172 *cpu = p & 0xfff; 172 *cpu = p & 0xfff;
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h
index 303bcd4592bb..269d315719ca 100644
--- a/include/asm-i386/nmi.h
+++ b/include/asm-i386/nmi.h
@@ -36,4 +36,10 @@ extern unsigned int nmi_watchdog;
36#define NMI_LOCAL_APIC 2 36#define NMI_LOCAL_APIC 2
37#define NMI_INVALID 3 37#define NMI_INVALID 3
38 38
39struct ctl_table;
40struct file;
41extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
42 void __user *, size_t *, loff_t *);
43extern int unknown_nmi_panic;
44
39#endif /* ASM_NMI_H */ 45#endif /* ASM_NMI_H */
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h
index cbf2669bca71..f367d4014b42 100644
--- a/include/asm-x86_64/nmi.h
+++ b/include/asm-x86_64/nmi.h
@@ -70,4 +70,11 @@ extern unsigned int nmi_watchdog;
70#define NMI_LOCAL_APIC 2 70#define NMI_LOCAL_APIC 2
71#define NMI_INVALID 3 71#define NMI_INVALID 3
72 72
73struct ctl_table;
74struct file;
75extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
76 void __user *, size_t *, loff_t *);
77
78extern int unknown_nmi_panic;
79
73#endif /* ASM_NMI_H */ 80#endif /* ASM_NMI_H */
diff --git a/include/asm-x86_64/semaphore.h b/include/asm-x86_64/semaphore.h
index 107bd90429e8..1194888536b9 100644
--- a/include/asm-x86_64/semaphore.h
+++ b/include/asm-x86_64/semaphore.h
@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem)
132 "jns 2f\n\t" 132 "jns 2f\n\t"
133 "call __down_failed_interruptible\n" 133 "call __down_failed_interruptible\n"
134 "2:\n" 134 "2:\n"
135 :"=a" (result), "=m" (sem->count) 135 :"=&a" (result), "=m" (sem->count)
136 :"D" (sem) 136 :"D" (sem)
137 :"memory"); 137 :"memory");
138 return result; 138 return result;
@@ -153,7 +153,7 @@ static inline int down_trylock(struct semaphore * sem)
153 "jns 2f\n\t" 153 "jns 2f\n\t"
154 "call __down_failed_trylock\n\t" 154 "call __down_failed_trylock\n\t"
155 "2:\n" 155 "2:\n"
156 :"=a" (result), "=m" (sem->count) 156 :"=&a" (result), "=m" (sem->count)
157 :"D" (sem) 157 :"D" (sem)
158 :"memory","cc"); 158 :"memory","cc");
159 return result; 159 return result;
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index e856570c0689..19f99178fe83 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -361,6 +361,11 @@ __must_check unsigned long clear_user(void __user *mem, unsigned long len);
361__must_check unsigned long __clear_user(void __user *mem, unsigned long len); 361__must_check unsigned long __clear_user(void __user *mem, unsigned long len);
362 362
363__must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size); 363__must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size);
364#define __copy_to_user_inatomic copy_user_generic 364
365static __must_check __always_inline int
366__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
367{
368 return copy_user_generic((__force void *)dst, src, size);
369}
365 370
366#endif /* __X86_64_UACCESS_H */ 371#endif /* __X86_64_UACCESS_H */
diff --git a/include/linux/getcpu.h b/include/linux/getcpu.h
index 031ed3780e45..c7372d7a97be 100644
--- a/include/linux/getcpu.h
+++ b/include/linux/getcpu.h
@@ -1,16 +1,18 @@
1#ifndef _LINUX_GETCPU_H 1#ifndef _LINUX_GETCPU_H
2#define _LINUX_GETCPU_H 1 2#define _LINUX_GETCPU_H 1
3 3
4/* Cache for getcpu() to speed it up. Results might be upto a jiffie 4/* Cache for getcpu() to speed it up. Results might be a short time
5 out of date, but will be faster. 5 out of date, but will be faster.
6
6 User programs should not refer to the contents of this structure. 7 User programs should not refer to the contents of this structure.
7 It is only a cache for vgetcpu(). It might change in future kernels. 8 I repeat they should not refer to it. If they do they will break
9 in future kernels.
10
11 It is only a private cache for vgetcpu(). It will change in future kernels.
8 The user program must store this information per thread (__thread) 12 The user program must store this information per thread (__thread)
9 If you want 100% accurate information pass NULL instead. */ 13 If you want 100% accurate information pass NULL instead. */
10struct getcpu_cache { 14struct getcpu_cache {
11 unsigned long t0; 15 unsigned long blob[128 / sizeof(long)];
12 unsigned long t1;
13 unsigned long res[4];
14}; 16};
15 17
16#endif 18#endif
diff --git a/kernel/panic.c b/kernel/panic.c
index 6ceb664fb52a..525e365f7239 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -21,7 +21,6 @@
21#include <linux/debug_locks.h> 21#include <linux/debug_locks.h>
22 22
23int panic_on_oops; 23int panic_on_oops;
24int panic_on_unrecovered_nmi;
25int tainted; 24int tainted;
26static int pause_on_oops; 25static int pause_on_oops;
27static int pause_on_oops_flag; 26static int pause_on_oops_flag;
diff --git a/kernel/sys.c b/kernel/sys.c
index 8647061c084a..b88806c66244 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2083,12 +2083,12 @@ asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep,
2083 * padding 2083 * padding
2084 */ 2084 */
2085 unsigned long t0, t1; 2085 unsigned long t0, t1;
2086 get_user(t0, &cache->t0); 2086 get_user(t0, &cache->blob[0]);
2087 get_user(t1, &cache->t1); 2087 get_user(t1, &cache->blob[1]);
2088 t0++; 2088 t0++;
2089 t1++; 2089 t1++;
2090 put_user(t0, &cache->t0); 2090 put_user(t0, &cache->blob[0]);
2091 put_user(t1, &cache->t1); 2091 put_user(t1, &cache->blob[1]);
2092 } 2092 }
2093 return err ? -EFAULT : 0; 2093 return err ? -EFAULT : 0;
2094} 2094}
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 9535a3839930..c57c4532e296 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -52,6 +52,10 @@
52extern int proc_nr_files(ctl_table *table, int write, struct file *filp, 52extern int proc_nr_files(ctl_table *table, int write, struct file *filp,
53 void __user *buffer, size_t *lenp, loff_t *ppos); 53 void __user *buffer, size_t *lenp, loff_t *ppos);
54 54
55#ifdef CONFIG_X86
56#include <asm/nmi.h>
57#endif
58
55#if defined(CONFIG_SYSCTL) 59#if defined(CONFIG_SYSCTL)
56 60
57/* External variables not in a header file. */ 61/* External variables not in a header file. */
@@ -74,13 +78,6 @@ extern int sysctl_drop_caches;
74extern int percpu_pagelist_fraction; 78extern int percpu_pagelist_fraction;
75extern int compat_log; 79extern int compat_log;
76 80
77#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
78int unknown_nmi_panic;
79int nmi_watchdog_enabled;
80extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
81 void __user *, size_t *, loff_t *);
82#endif
83
84/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ 81/* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
85static int maxolduid = 65535; 82static int maxolduid = 65535;
86static int minolduid; 83static int minolduid;