Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/li…
Browse files Browse the repository at this point in the history
…nux-2.6

* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6:
  [PATCH] Use early clobber in semaphores
  [PATCH] Define vsyscall cache as blob to make clearer that user space shouldn't use it
  [PATCH] Re-positioning the bss segment
  [PATCH] Use ARRAY_SIZE in setup.c
  [PATCH] i386: replace intermediate array-size definitions with ARRAY_SIZE()
  [PATCH] x86: Clean up x86 NMI sysctls
  [PATCH] Refactor some duplicated code in mpparse.c
  [PATCH] Document iommu=panic
  [PATCH] Fix broken indentation in iommu_setup
  [PATCH] Allow disabling DAC using command line options
  [PATCH] Add proper sparse __user casts to __copy_to_user_inatomic
  [PATCH] i386: Update defconfig
  [PATCH] Update defconfig
  • Loading branch information
Linus Torvalds committed Sep 30, 2006
2 parents bf60362 + c84ef53 commit 369aa83
Show file tree
Hide file tree
Showing 20 changed files with 152 additions and 106 deletions.
5 changes: 5 additions & 0 deletions Documentation/x86_64/boot-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ IOMMU
allowed overwrite iommu off workarounds for specific chipsets.
soft Use software bounce buffering (default for Intel machines)
noaperture Don't touch the aperture for AGP.
allowdac Allow DMA >4GB
When off all DMA over >4GB is forced through an IOMMU or bounce
buffering.
nodac Forbid DMA >4GB
panic Always panic when IOMMU overflows

swiotlb=pages[,force]

Expand Down
7 changes: 5 additions & 2 deletions arch/i386/defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.18-git5
# Tue Sep 26 09:30:47 2006
# Linux kernel version: 2.6.18-git7
# Wed Sep 27 21:53:10 2006
#
CONFIG_X86_32=y
CONFIG_GENERIC_TIME=y
Expand Down Expand Up @@ -210,6 +210,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_PM=y
CONFIG_PM_LEGACY=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SYSFS_DEPRECATED=y

#
# ACPI (Advanced Configuration and Power Interface) Support
Expand Down Expand Up @@ -292,6 +293,7 @@ CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
# CONFIG_PCIEPORTBUS is not set
CONFIG_PCI_MSI=y
# CONFIG_PCI_MULTITHREAD_PROBE is not set
# CONFIG_PCI_DEBUG is not set
CONFIG_ISA_DMA_API=y
# CONFIG_ISA is not set
Expand Down Expand Up @@ -1427,6 +1429,7 @@ CONFIG_KPROBES=y
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_PRINTK_TIME is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_KERNEL=y
Expand Down
3 changes: 3 additions & 0 deletions arch/i386/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

#include "mach_traps.h"

int unknown_nmi_panic;
int nmi_watchdog_enabled;

/* perfctr_nmi_owner tracks the ownership of the perfctr registers:
* evtsel_nmi_owner tracks the ownership of the event selection
* - different performance counters/ event selection may be reserved for
Expand Down
10 changes: 2 additions & 8 deletions arch/i386/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ static struct resource adapter_rom_resources[] = { {
.flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
} };

#define ADAPTER_ROM_RESOURCES \
(sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])

static struct resource video_rom_resource = {
.name = "Video ROM",
.start = 0xc0000,
Expand Down Expand Up @@ -273,9 +270,6 @@ static struct resource standard_io_resources[] = { {
.flags = IORESOURCE_BUSY | IORESOURCE_IO
} };

#define STANDARD_IO_RESOURCES \
(sizeof standard_io_resources / sizeof standard_io_resources[0])

#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)

static int __init romchecksum(unsigned char *rom, unsigned long length)
Expand Down Expand Up @@ -332,7 +326,7 @@ static void __init probe_roms(void)
}

/* check for adapter roms on 2k boundaries */
for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) {
for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += 2048) {
rom = isa_bus_to_virt(start);
if (!romsignature(rom))
continue;
Expand Down Expand Up @@ -1272,7 +1266,7 @@ static int __init request_standard_resources(void)
request_resource(&iomem_resource, &video_ram_resource);

/* request I/O space for devices used on all i[345]86 PCs */
for (i = 0; i < STANDARD_IO_RESOURCES; i++)
for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
request_resource(&ioport_resource, &standard_io_resources[i]);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions arch/i386/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@

#include "mach_traps.h"

int panic_on_unrecovered_nmi;

asmlinkage int system_call(void);

struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
Expand Down
8 changes: 6 additions & 2 deletions arch/x86_64/defconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.18-git5
# Tue Sep 26 09:30:47 2006
# Linux kernel version: 2.6.18-git7
# Wed Sep 27 21:53:10 2006
#
CONFIG_X86_64=y
CONFIG_64BIT=y
CONFIG_X86=y
CONFIG_ZONE_DMA32=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
Expand Down Expand Up @@ -179,6 +180,7 @@ CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
# CONFIG_PM_DEBUG is not set
# CONFIG_PM_SYSFS_DEPRECATED is not set
CONFIG_SOFTWARE_SUSPEND=y
CONFIG_PM_STD_PARTITION=""
CONFIG_SUSPEND_SMP=y
Expand Down Expand Up @@ -251,6 +253,7 @@ CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_MSI=y
# CONFIG_PCI_MULTITHREAD_PROBE is not set
# CONFIG_PCI_DEBUG is not set

#
Expand Down Expand Up @@ -1458,6 +1461,7 @@ CONFIG_KPROBES=y
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_PRINTK_TIME is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_KERNEL=y
Expand Down
37 changes: 19 additions & 18 deletions arch/x86_64/kernel/mpparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,32 @@ static void __init MP_bus_info (struct mpc_config_bus *m)
}
}

static int bad_ioapic(unsigned long address)
{
if (nr_ioapics >= MAX_IO_APICS) {
printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
"(found %d)\n", MAX_IO_APICS, nr_ioapics);
panic("Recompile kernel with bigger MAX_IO_APICS!\n");
}
if (!address) {
printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
" found in table, skipping!\n");
return 1;
}
return 0;
}

static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
{
if (!(m->mpc_flags & MPC_APIC_USABLE))
return;

printk("I/O APIC #%d at 0x%X.\n",
m->mpc_apicid, m->mpc_apicaddr);
if (nr_ioapics >= MAX_IO_APICS) {
printk(KERN_ERR "Max # of I/O APICs (%d) exceeded (found %d).\n",
MAX_IO_APICS, nr_ioapics);
panic("Recompile kernel with bigger MAX_IO_APICS!.\n");
}
if (!m->mpc_apicaddr) {
printk(KERN_ERR "WARNING: bogus zero I/O APIC address"
" found in MP table, skipping!\n");

if (bad_ioapic(m->mpc_apicaddr))
return;
}

mp_ioapics[nr_ioapics] = *m;
nr_ioapics++;
}
Expand Down Expand Up @@ -647,16 +656,8 @@ void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
{
int idx = 0;

if (nr_ioapics >= MAX_IO_APICS) {
printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
"(found %d)\n", MAX_IO_APICS, nr_ioapics);
panic("Recompile kernel with bigger MAX_IO_APICS!\n");
}
if (!address) {
printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
" found in MADT table, skipping!\n");
if (bad_ioapic(address))
return;
}

idx = nr_ioapics++;

Expand Down
4 changes: 4 additions & 0 deletions arch/x86_64/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include <asm/mce.h>
#include <asm/intel_arch_perfmon.h>

int unknown_nmi_panic;
int nmi_watchdog_enabled;
int panic_on_unrecovered_nmi;

/* perfctr_nmi_owner tracks the ownership of the perfctr registers:
* evtsel_nmi_owner tracks the ownership of the event selection
* - different performance counters/ event selection may be reserved for
Expand Down
93 changes: 56 additions & 37 deletions arch/x86_64/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,20 @@ void dma_free_coherent(struct device *dev, size_t size,
}
EXPORT_SYMBOL(dma_free_coherent);

static int forbid_dac __read_mostly;

int dma_supported(struct device *dev, u64 mask)
{
#ifdef CONFIG_PCI
if (mask > 0xffffffff && forbid_dac > 0) {



printk(KERN_INFO "PCI: Disallowing DAC for device %s\n", dev->bus_id);
return 0;
}
#endif

if (dma_ops->dma_supported)
return dma_ops->dma_supported(dev, mask);

Expand Down Expand Up @@ -231,57 +243,64 @@ EXPORT_SYMBOL(dma_set_mask);
allowed overwrite iommu off workarounds for specific chipsets.
soft Use software bounce buffering (default for Intel machines)
noaperture Don't touch the aperture for AGP.
allowdac Allow DMA >4GB
nodac Forbid DMA >4GB
panic Force panic when IOMMU overflows
*/
__init int iommu_setup(char *p)
{
iommu_merge = 1;
iommu_merge = 1;

if (!p)
return -EINVAL;

while (*p) {
if (!strncmp(p,"off",3))
no_iommu = 1;
/* gart_parse_options has more force support */
if (!strncmp(p,"force",5))
force_iommu = 1;
if (!strncmp(p,"noforce",7)) {
iommu_merge = 0;
force_iommu = 0;
}

if (!strncmp(p, "biomerge",8)) {
iommu_bio_merge = 4096;
iommu_merge = 1;
force_iommu = 1;
}
if (!strncmp(p, "panic",5))
panic_on_overflow = 1;
if (!strncmp(p, "nopanic",7))
panic_on_overflow = 0;
if (!strncmp(p, "merge",5)) {
iommu_merge = 1;
force_iommu = 1;
}
if (!strncmp(p, "nomerge",7))
iommu_merge = 0;
if (!strncmp(p, "forcesac",8))
iommu_sac_force = 1;
while (*p) {
if (!strncmp(p,"off",3))
no_iommu = 1;
/* gart_parse_options has more force support */
if (!strncmp(p,"force",5))
force_iommu = 1;
if (!strncmp(p,"noforce",7)) {
iommu_merge = 0;
force_iommu = 0;
}

if (!strncmp(p, "biomerge",8)) {
iommu_bio_merge = 4096;
iommu_merge = 1;
force_iommu = 1;
}
if (!strncmp(p, "panic",5))
panic_on_overflow = 1;
if (!strncmp(p, "nopanic",7))
panic_on_overflow = 0;
if (!strncmp(p, "merge",5)) {
iommu_merge = 1;
force_iommu = 1;
}
if (!strncmp(p, "nomerge",7))
iommu_merge = 0;
if (!strncmp(p, "forcesac",8))
iommu_sac_force = 1;
if (!strncmp(p, "allowdac", 8))
forbid_dac = 0;
if (!strncmp(p, "nodac", 5))
forbid_dac = -1;

#ifdef CONFIG_SWIOTLB
if (!strncmp(p, "soft",4))
swiotlb = 1;
if (!strncmp(p, "soft",4))
swiotlb = 1;
#endif

#ifdef CONFIG_IOMMU
gart_parse_options(p);
gart_parse_options(p);
#endif

p += strcspn(p, ",");
if (*p == ',')
++p;
}
return 0;
p += strcspn(p, ",");
if (*p == ',')
++p;
}
return 0;
}
early_param("iommu", iommu_setup);

Expand Down
11 changes: 3 additions & 8 deletions arch/x86_64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ struct resource standard_io_resources[] = {
.flags = IORESOURCE_BUSY | IORESOURCE_IO }
};

#define STANDARD_IO_RESOURCES \
(sizeof standard_io_resources / sizeof standard_io_resources[0])

#define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM)

struct resource data_resource = {
Expand Down Expand Up @@ -172,9 +169,6 @@ static struct resource adapter_rom_resources[] = {
.flags = IORESOURCE_ROM }
};

#define ADAPTER_ROM_RESOURCES \
(sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])

static struct resource video_rom_resource = {
.name = "Video ROM",
.start = 0xc0000,
Expand Down Expand Up @@ -245,7 +239,8 @@ static void __init probe_roms(void)
}

/* check for adapter roms on 2k boundaries */
for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) {
for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper;
start += 2048) {
rom = isa_bus_to_virt(start);
if (!romsignature(rom))
continue;
Expand Down Expand Up @@ -537,7 +532,7 @@ void __init setup_arch(char **cmdline_p)
{
unsigned i;
/* request I/O space for devices used on all i[345]86 PCs */
for (i = 0; i < STANDARD_IO_RESOURCES; i++)
for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
request_resource(&ioport_resource, &standard_io_resources[i]);
}

Expand Down
Loading

0 comments on commit 369aa83

Please sign in to comment.