summaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-04-05 04:55:58 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-04-05 04:55:58 +0000
commit74a9f2e1b4d3ab45a9f72cb5b556c9f521524ab3 (patch)
tree7c4cdb103ab1b388c9852a88bd6fb1e73eba0b5c /arch/i386
parentee6374c8b0d333c08061c6a97bc77090d7461225 (diff)
Merge with Linux 2.4.3.
Note that mingetty does no longer work with serial console, you have to switch to another getty like getty_ps. This commit also includes a fix for a setitimer bug which did prevent getty_ps from working on older kernels.
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/boot/Makefile8
-rw-r--r--arch/i386/defconfig7
-rw-r--r--arch/i386/kernel/head.S17
-rw-r--r--arch/i386/kernel/i386_ksyms.c4
-rw-r--r--arch/i386/kernel/i387.c2
-rw-r--r--arch/i386/kernel/ldt.c4
-rw-r--r--arch/i386/kernel/pci-pc.c90
-rw-r--r--arch/i386/kernel/ptrace.c6
-rw-r--r--arch/i386/kernel/setup.c55
-rw-r--r--arch/i386/kernel/sys_i386.c4
-rw-r--r--arch/i386/kernel/traps.c2
-rw-r--r--arch/i386/lib/mmx.c11
-rw-r--r--arch/i386/mm/extable.c2
-rw-r--r--arch/i386/mm/fault.c10
-rw-r--r--arch/i386/mm/init.c139
-rw-r--r--arch/i386/mm/ioremap.c15
16 files changed, 170 insertions, 206 deletions
diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile
index e75eb2fdf..f238d05c5 100644
--- a/arch/i386/boot/Makefile
+++ b/arch/i386/boot/Makefile
@@ -43,7 +43,7 @@ tools/build: tools/build.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $< -I$(TOPDIR)/include
bootsect: bootsect.o
- $(LD) -Ttext 0x0 -s -oformat binary -o $@ $<
+ $(LD) -Ttext 0x0 -s --oformat binary -o $@ $<
bootsect.o: bootsect.s
$(AS) -o $@ $<
@@ -52,7 +52,7 @@ bootsect.s: bootsect.S Makefile $(BOOT_INCL)
$(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
bbootsect: bbootsect.o
- $(LD) -Ttext 0x0 -s -oformat binary $< -o $@
+ $(LD) -Ttext 0x0 -s --oformat binary $< -o $@
bbootsect.o: bbootsect.s
$(AS) -o $@ $<
@@ -61,7 +61,7 @@ bbootsect.s: bootsect.S Makefile $(BOOT_INCL)
$(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
setup: setup.o
- $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $<
+ $(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
setup.o: setup.s
$(AS) -o $@ $<
@@ -70,7 +70,7 @@ setup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h
$(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
bsetup: bsetup.o
- $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $<
+ $(LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
bsetup.o: bsetup.s
$(AS) -o $@ $<
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 875a84bf9..5b62d741c 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -280,6 +280,7 @@ CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
@@ -382,7 +383,6 @@ CONFIG_EEPRO100=y
# CONFIG_NE3210 is not set
# CONFIG_ES3210 is not set
# CONFIG_8139TOO is not set
-# CONFIG_RTL8129 is not set
# CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set
@@ -434,6 +434,7 @@ CONFIG_PCMCIA_PCNET=y
# CONFIG_PCMCIA_XIRTULIP is not set
CONFIG_NET_PCMCIA_RADIO=y
CONFIG_PCMCIA_RAYCS=y
+# CONFIG_PCMCIA_HERMES is not set
# CONFIG_PCMCIA_NETWAVE is not set
# CONFIG_PCMCIA_WAVELAN is not set
# CONFIG_AIRONET4500_CS is not set
@@ -529,13 +530,11 @@ CONFIG_DRM_TDFX=y
CONFIG_DRM_RADEON=y
# CONFIG_DRM_I810 is not set
# CONFIG_DRM_MGA is not set
-CONFIG_PCMCIA_SERIAL=y
#
-# PCMCIA character device support
+# PCMCIA character devices
#
# CONFIG_PCMCIA_SERIAL_CS is not set
-# CONFIG_PCMCIA_SERIAL_CB is not set
#
# Multimedia devices
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 400216f37..01b4cf8a2 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -415,23 +415,6 @@ ENTRY(pg1)
ENTRY(empty_zero_page)
.org 0x5000
-ENTRY(empty_bad_page)
-
-.org 0x6000
-ENTRY(empty_bad_pte_table)
-
-#if CONFIG_X86_PAE
-
- .org 0x7000
- ENTRY(empty_bad_pmd_table)
-
- .org 0x8000
-
-#else
-
- .org 0x7000
-
-#endif
/*
* This starts the data section. Note that the above is all
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 20bc14fc6..52eb1c79a 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -27,6 +27,7 @@
#include <asm/mmx.h>
#include <asm/desc.h>
#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
extern void dump_thread(struct pt_regs *, struct user *);
extern spinlock_t rtc_lock;
@@ -134,6 +135,9 @@ EXPORT_SYMBOL(__global_sti);
EXPORT_SYMBOL(__global_save_flags);
EXPORT_SYMBOL(__global_restore_flags);
EXPORT_SYMBOL(smp_call_function);
+
+/* TLB flushing */
+EXPORT_SYMBOL(flush_tlb_page);
#endif
#ifdef CONFIG_MCA
diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c
index ba97ca4bc..0a2973cfa 100644
--- a/arch/i386/kernel/i387.c
+++ b/arch/i386/kernel/i387.c
@@ -179,7 +179,7 @@ unsigned short get_fpu_twd( struct task_struct *tsk )
unsigned short get_fpu_mxcsr( struct task_struct *tsk )
{
- if ( cpu_has_fxsr ) {
+ if ( cpu_has_xmm ) {
return tsk->thread.i387.fxsave.mxcsr;
} else {
return 0x1f80;
diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
index e94cbfbdc..b50d366af 100644
--- a/arch/i386/kernel/ldt.c
+++ b/arch/i386/kernel/ldt.c
@@ -86,7 +86,7 @@ static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
* the GDT index of the LDT is allocated dynamically, and is
* limited by MAX_LDT_DESCRIPTORS.
*/
- down(&mm->mmap_sem);
+ down_write(&mm->mmap_sem);
if (!mm->context.segments) {
error = -ENOMEM;
mm->context.segments = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
@@ -141,7 +141,7 @@ install:
error = 0;
out_unlock:
- up(&mm->mmap_sem);
+ up_write(&mm->mmap_sem);
out:
return error;
}
diff --git a/arch/i386/kernel/pci-pc.c b/arch/i386/kernel/pci-pc.c
index d2a8afbbb..18696dedc 100644
--- a/arch/i386/kernel/pci-pc.c
+++ b/arch/i386/kernel/pci-pc.c
@@ -861,6 +861,8 @@ static void __init pci_fixup_serverworks(struct pci_dev *d)
}
}
+#if 0
+/* Our bus code shouldnt need this fixup any more. Delete once verified */
/*
* Compaq host bridges -- Find and scan all secondary buses.
* This time registers 0xc8 and 0xc9.
@@ -878,6 +880,7 @@ static void __init pci_fixup_compaq(struct pci_dev *d)
printk("PCI: Compaq host bridge: last bus %02x\n", busno2);
}
}
+#endif
static void __init pci_fixup_umc_ide(struct pci_dev *d)
{
@@ -934,35 +937,106 @@ static void __init pci_fixup_latency(struct pci_dev *d)
pcibios_max_latency = 32;
}
+static void __init pci_fixup_via_acpi(struct pci_dev *d)
+{
+ /*
+ * VIA ACPI device: IRQ line in PCI config byte 0x42
+ */
+ u8 irq;
+ pci_read_config_byte(d, 0x42, &irq);
+ irq &= 0x0f;
+ if (irq && (irq != 2))
+ d->irq = irq;
+}
+
+static void __init pci_fixup_piix4_acpi(struct pci_dev *d)
+{
+ /*
+ * PIIX4 ACPI device: hardwired IRQ9
+ */
+ d->irq = 9;
+}
+
static void __init pci_fixup_vt8363(struct pci_dev *d)
{
/*
- * VIA VT8363 host bridge has broken feature 'PCI Master Read
- * Caching'. It caches more than is good for it, sometimes
- * serving the bus master with stale data. Some BIOSes enable
- * it by default, so we disable it.
+ * The VIA bridge will corrupt disks without these settings.
+ */
+ u8 tmp;
+ pci_read_config_byte(d, 0x54, &tmp);
+ if(tmp & (1<<2)) {
+ printk("PCI: Bus master Pipeline request disabled\n");
+ pci_write_config_byte(d, 0x54, tmp & ~(1<<2));
+ }
+ pci_read_config_byte(d, 0x70, &tmp);
+ if(tmp & (1<<3)) {
+ printk("PCI: Disabled enhanced CPU to PCI writes\n");
+ pci_write_config_byte(d, 0x70, tmp & ~(1<<3));
+ }
+ pci_read_config_byte(d, 0x71, &tmp);
+ if((tmp & (1<<3)) == 0) {
+ printk("PCI: Bursting cornercase bug worked around\n");
+ pci_write_config_byte(d, 0x71, tmp | (1<<3));
+ }
+ pci_read_config_byte(d, 0x76, &tmp);
+ if(tmp & (1<<7)) {
+ printk("PCI: Post Write Fail set to Retry\n");
+ pci_write_config_byte(d, 0x76, tmp & ~(1<<7));
+ }
+}
+
+static void __init pci_fixup_via691(struct pci_dev *d)
+{
+ /*
+ * The VIA bridge corrupts with Posting enabled
*/
u8 tmp;
+
pci_read_config_byte(d, 0x70, &tmp);
- if(tmp & 4) {
- printk("PCI: Bus master read caching disabled\n");
- pci_write_config_byte(d, 0x70, tmp & ~4);
+ if(tmp & (1<<7)) {
+ printk("PCI: Disabled enhanced CPU to PCI posting\n");
+ pci_write_config_byte(d, 0x70, tmp & ~(1<<7));
}
}
+static void __init pci_fixup_via691_2(struct pci_dev *d)
+{
+ /*
+ * The VIA bridge corrupts with Posting enabled
+ */
+ u8 tmp;
+
+ pci_read_config_byte(d, 0x40, &tmp);
+ if(tmp & (1<<7)) {
+ printk("PCI: Disabled enhanced CPU to PCI posting #2\n");
+ pci_write_config_byte(d, 0x40, tmp & ~(1<<7));
+ }
+}
+
struct pci_fixup pcibios_fixups[] = {
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx },
+#if 0
+/* Until we get proper handling pray the BIOS gets it right */
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HE, pci_fixup_serverworks },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE, pci_fixup_serverworks },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CMIC_HE, pci_fixup_serverworks },
+#endif
+#if 0
+/* Our bus code shouldnt need this fixup any more. Delete once verified */
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_6010, pci_fixup_compaq },
+#endif
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, pci_fixup_ide_trash },
{ PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, pci_fixup_vt8363 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, pci_fixup_via_acpi },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, pci_fixup_via_acpi },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, pci_fixup_vt8363 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C691, pci_fixup_via691 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C598_1, pci_fixup_via691_2 },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, pci_fixup_piix4_acpi },
{ 0 }
};
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index b374f8e99..2065727ae 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -167,8 +167,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
if (request == PTRACE_ATTACH) {
if (child == current)
goto out_tsk;
- if ((!child->dumpable ||
- (current->uid != child->euid) ||
+ if(((current->uid != child->euid) ||
(current->uid != child->suid) ||
(current->uid != child->uid) ||
(current->gid != child->egid) ||
@@ -176,6 +175,9 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
(!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out_tsk;
+ rmb();
+ if (!child->dumpable && !capable(CAP_SYS_PTRACE))
+ goto out_tsk;
/* the same process cannot be attached many times */
if (child->ptrace & PT_PTRACED)
goto out_tsk;
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 03eeabc2f..9c0033110 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -294,7 +294,7 @@ visws_get_board_type_and_rev(void)
visws_board_rev = raw;
}
- printk("Silicon Graphics %s (rev %d)\n",
+ printk(KERN_INFO "Silicon Graphics %s (rev %d)\n",
visws_board_type == VISWS_320 ? "320" :
(visws_board_type == VISWS_540 ? "540" :
"unknown"),
@@ -401,7 +401,7 @@ void __init add_memory_region(unsigned long long start,
int x = e820.nr_map;
if (x == E820MAX) {
- printk("Ooops! Too many entries in the memory map!\n");
+ printk(KERN_ERR "Ooops! Too many entries in the memory map!\n");
return;
}
@@ -418,8 +418,9 @@ static void __init print_memory_map(char *who)
int i;
for (i = 0; i < e820.nr_map; i++) {
- printk(" %s: %016Lx @ %016Lx ", who,
- e820.map[i].size, e820.map[i].addr);
+ printk(" %s: %016Lx - %016Lx ", who,
+ e820.map[i].addr,
+ e820.map[i].addr + e820.map[i].size);
switch (e820.map[i].type) {
case E820_RAM: printk("(usable)\n");
break;
@@ -521,7 +522,7 @@ void __init setup_memory_region(void)
add_memory_region(0, LOWMEMSIZE(), E820_RAM);
add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
}
- printk("BIOS-provided physical RAM map:\n");
+ printk(KERN_INFO "BIOS-provided physical RAM map:\n");
print_memory_map(who);
} /* setup_memory_region */
@@ -591,7 +592,7 @@ static inline void parse_mem_cmdline (char ** cmdline_p)
*to = '\0';
*cmdline_p = command_line;
if (usermem) {
- printk("user-defined physical RAM map:\n");
+ printk(KERN_INFO "user-defined physical RAM map:\n");
print_memory_map("user");
}
}
@@ -798,7 +799,7 @@ void __init setup_arch(char **cmdline_p)
initrd_end = initrd_start+INITRD_SIZE;
}
else {
- printk("initrd extends beyond end of memory "
+ printk(KERN_ERR "initrd extends beyond end of memory "
"(0x%08lx > 0x%08lx)\ndisabling initrd\n",
INITRD_START + INITRD_SIZE,
max_low_pfn << PAGE_SHIFT);
@@ -902,7 +903,7 @@ static void __init display_cacheinfo(struct cpuinfo_x86 *c)
if (n >= 0x80000005) {
cpuid(0x80000005, &dummy, &dummy, &ecx, &edx);
- printk("CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
+ printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
edx>>24, edx&0xFF, ecx>>24, ecx&0xFF);
c->x86_cache_size=(ecx>>24)+(edx>>24);
}
@@ -926,7 +927,7 @@ static void __init display_cacheinfo(struct cpuinfo_x86 *c)
c->x86_cache_size = l2size;
- printk("CPU: L2 Cache: %dK (%d bytes/line)\n",
+ printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n",
l2size, ecx & 0xFF);
}
@@ -1339,7 +1340,7 @@ static void __init init_centaur(struct cpuinfo_x86 *c)
name="C6";
fcr_set=ECX8|DSMC|EDCTLB|EMMX|ERETSTK;
fcr_clr=DPDC;
- printk("Disabling bugged TSC.\n");
+ printk(KERN_NOTICE "Disabling bugged TSC.\n");
clear_bit(X86_FEATURE_TSC, &c->x86_capability);
break;
case 8:
@@ -1376,10 +1377,10 @@ static void __init init_centaur(struct cpuinfo_x86 *c)
newlo=(lo|fcr_set) & (~fcr_clr);
if (newlo!=lo) {
- printk("Centaur FCR was 0x%X now 0x%X\n", lo, newlo );
+ printk(KERN_INFO "Centaur FCR was 0x%X now 0x%X\n", lo, newlo );
wrmsr(0x107, newlo, hi );
} else {
- printk("Centaur FCR is 0x%X\n",lo);
+ printk(KERN_INFO "Centaur FCR is 0x%X\n",lo);
}
/* Emulate MTRRs using Centaur's MCR. */
set_bit(X86_FEATURE_CENTAUR_MCR, &c->x86_capability);
@@ -1432,7 +1433,7 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
max = cpuid_eax(0x80860000);
if ( max >= 0x80860001 ) {
cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
- printk("CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
+ printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
(cpu_rev >> 24) & 0xff,
(cpu_rev >> 16) & 0xff,
(cpu_rev >> 8) & 0xff,
@@ -1441,7 +1442,7 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
}
if ( max >= 0x80860002 ) {
cpuid(0x80860002, &dummy, &cms_rev1, &cms_rev2, &dummy);
- printk("CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
+ printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
(cms_rev1 >> 24) & 0xff,
(cms_rev1 >> 16) & 0xff,
(cms_rev1 >> 8) & 0xff,
@@ -1470,7 +1471,7 @@ static void __init init_transmeta(struct cpuinfo_x86 *c)
(void *)&cpu_info[56],
(void *)&cpu_info[60]);
cpu_info[64] = '\0';
- printk("CPU: %s\n", cpu_info);
+ printk(KERN_INFO "CPU: %s\n", cpu_info);
}
/* Unhide possibly hidden capability flags */
@@ -1502,7 +1503,7 @@ static void __init init_intel(struct cpuinfo_x86 *c)
c->f00f_bug = 1;
if ( !f00f_workaround_enabled ) {
trap_init_f00f_bug();
- printk(KERN_INFO "Intel Pentium with F0 0F bug - workaround enabled.\n");
+ printk(KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n");
f00f_workaround_enabled = 1;
}
}
@@ -1610,12 +1611,12 @@ static void __init init_intel(struct cpuinfo_x86 *c)
}
}
if ( l1i || l1d )
- printk("CPU: L1 I cache: %dK, L1 D cache: %dK\n",
+ printk(KERN_INFO "CPU: L1 I cache: %dK, L1 D cache: %dK\n",
l1i, l1d);
if ( l2 )
- printk("CPU: L2 cache: %dK\n", l2);
+ printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
if ( l3 )
- printk("CPU: L3 cache: %dK\n", l3);
+ printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
/*
* This assumes the L3 cache is shared; it typically lives in
@@ -1785,7 +1786,7 @@ static void __init squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
rdmsr(0x119,lo,hi);
lo |= 0x200000;
wrmsr(0x119,lo,hi);
- printk(KERN_INFO "CPU serial number disabled.\n");
+ printk(KERN_NOTICE "CPU serial number disabled.\n");
clear_bit(X86_FEATURE_PN, &c->x86_capability);
}
}
@@ -1976,7 +1977,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
}
}
- printk("CPU: Before vendor init, caps: %08x %08x %08x, vendor = %d\n",
+ printk(KERN_DEBUG "CPU: Before vendor init, caps: %08x %08x %08x, vendor = %d\n",
c->x86_capability[0],
c->x86_capability[1],
c->x86_capability[2],
@@ -2023,7 +2024,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
break;
}
- printk("CPU: After vendor init, caps: %08x %08x %08x %08x\n",
+ printk(KERN_DEBUG "CPU: After vendor init, caps: %08x %08x %08x %08x\n",
c->x86_capability[0],
c->x86_capability[1],
c->x86_capability[2],
@@ -2063,7 +2064,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
/* Now the feature flags better reflect actual CPU features! */
- printk("CPU: After generic, caps: %08x %08x %08x %08x\n",
+ printk(KERN_DEBUG "CPU: After generic, caps: %08x %08x %08x %08x\n",
c->x86_capability[0],
c->x86_capability[1],
c->x86_capability[2],
@@ -2081,7 +2082,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
}
- printk("CPU: Common caps: %08x %08x %08x %08x\n",
+ printk(KERN_DEBUG "CPU: Common caps: %08x %08x %08x %08x\n",
boot_cpu_data.x86_capability[0],
boot_cpu_data.x86_capability[1],
boot_cpu_data.x86_capability[2],
@@ -2249,16 +2250,16 @@ void __init cpu_init (void)
struct tss_struct * t = &init_tss[nr];
if (test_and_set_bit(nr, &cpu_initialized)) {
- printk("CPU#%d already initialized!\n", nr);
+ printk(KERN_WARNING "CPU#%d already initialized!\n", nr);
for (;;) __sti();
}
- printk("Initializing CPU#%d\n", nr);
+ printk(KERN_INFO "Initializing CPU#%d\n", nr);
if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
#ifndef CONFIG_X86_TSC
if (tsc_disable && cpu_has_tsc) {
- printk("Disabling TSC...\n");
+ printk(KERN_NOTICE "Disabling TSC...\n");
/**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/
clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability);
set_in_cr4(X86_CR4_TSD);
diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c
index 21a941be6..5fd6910b9 100644
--- a/arch/i386/kernel/sys_i386.c
+++ b/arch/i386/kernel/sys_i386.c
@@ -55,9 +55,9 @@ static inline long do_mmap2(
goto out;
}
- down(&current->mm->mmap_sem);
+ down_write(&current->mm->mmap_sem);
error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
- up(&current->mm->mmap_sem);
+ up_write(&current->mm->mmap_sem);
if (file)
fput(file);
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 6fa43476a..b8cc4fad4 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -388,7 +388,7 @@ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
#if CONFIG_X86_IO_APIC
-int nmi_watchdog = 1;
+int nmi_watchdog = 0;
static int __init setup_nmi_watchdog(char *str)
{
diff --git a/arch/i386/lib/mmx.c b/arch/i386/lib/mmx.c
index dfbf7ba8e..d9301040b 100644
--- a/arch/i386/lib/mmx.c
+++ b/arch/i386/lib/mmx.c
@@ -3,6 +3,7 @@
#include <linux/sched.h>
#include <asm/i387.h>
+#include <asm/hardirq.h>
/*
* MMX 3DNow! library helper functions
@@ -25,8 +26,14 @@
void *_mmx_memcpy(void *to, const void *from, size_t len)
{
- void *p=to;
- int i= len >> 6; /* len/64 */
+ void *p;
+ int i;
+
+ if (in_interrupt())
+ return __memcpy(to, from, len);
+
+ p = to;
+ i = len >> 6; /* len/64 */
kernel_fpu_begin();
diff --git a/arch/i386/mm/extable.c b/arch/i386/mm/extable.c
index 2eb7ca6aa..223d05af4 100644
--- a/arch/i386/mm/extable.c
+++ b/arch/i386/mm/extable.c
@@ -49,7 +49,7 @@ search_exception_table(unsigned long addr)
spin_lock_irqsave(&modlist_lock, flags);
for (mp = module_list; mp != NULL; mp = mp->next) {
- if (mp->ex_table_start == NULL)
+ if (mp->ex_table_start == NULL || !(mp->flags&(MOD_RUNNING|MOD_INITIALIZING)))
continue;
ret = search_one_table(mp->ex_table_start,
mp->ex_table_end - 1, addr);
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index ccbc5dce1..18ae8b950 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -141,7 +141,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (in_interrupt() || !mm)
goto no_context;
- down(&mm->mmap_sem);
+ down_read(&mm->mmap_sem);
vma = find_vma(mm, address);
if (!vma)
@@ -214,7 +214,7 @@ good_area:
if (bit < 32)
tsk->thread.screen_bitmap |= 1 << bit;
}
- up(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
return;
/*
@@ -222,7 +222,7 @@ good_area:
* Fix it, but check if it's kernel or user first..
*/
bad_area:
- up(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
@@ -290,14 +290,14 @@ no_context:
* us unable to handle the page fault gracefully.
*/
out_of_memory:
- up(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
printk("VM: killing process %s\n", tsk->comm);
if (error_code & 4)
do_exit(SIGKILL);
goto no_context;
do_sigbus:
- up(&mm->mmap_sem);
+ up_read(&mm->mmap_sem);
/*
* Send a sigbus, regardless of whether we were in kernel
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 6414b508c..202a42b69 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -40,132 +40,23 @@ unsigned long highstart_pfn, highend_pfn;
static unsigned long totalram_pages;
static unsigned long totalhigh_pages;
-/*
- * BAD_PAGE is the page that is used for page faults when linux
- * is out-of-memory. Older versions of linux just did a
- * do_exit(), but using this instead means there is less risk
- * for a process dying in kernel mode, possibly leaving an inode
- * unused etc..
- *
- * BAD_PAGETABLE is the accompanying page-table: it is initialized
- * to point to BAD_PAGE entries.
- *
- * ZERO_PAGE is a special page that is used for zero-initialized
- * data and COW.
- */
-
-/*
- * These are allocated in head.S so that we get proper page alignment.
- * If you change the size of these then change head.S as well.
- */
-extern char empty_bad_page[PAGE_SIZE];
-#if CONFIG_X86_PAE
-extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD];
-#endif
-extern pte_t empty_bad_pte_table[PTRS_PER_PTE];
-
-/*
- * We init them before every return and make them writable-shared.
- * This guarantees we get out of the kernel in some more or less sane
- * way.
- */
-#if CONFIG_X86_PAE
-static pmd_t * get_bad_pmd_table(void)
-{
- pmd_t v;
- int i;
-
- set_pmd(&v, __pmd(_PAGE_TABLE + __pa(empty_bad_pte_table)));
-
- for (i = 0; i < PAGE_SIZE/sizeof(pmd_t); i++)
- empty_bad_pmd_table[i] = v;
-
- return empty_bad_pmd_table;
-}
-#endif
-
-static pte_t * get_bad_pte_table(void)
-{
- pte_t v;
- int i;
-
- v = pte_mkdirty(mk_pte_phys(__pa(empty_bad_page), PAGE_SHARED));
-
- for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++)
- empty_bad_pte_table[i] = v;
-
- return empty_bad_pte_table;
-}
-
-
-
-void __handle_bad_pmd(pmd_t *pmd)
-{
- pmd_ERROR(*pmd);
- set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(get_bad_pte_table())));
-}
-
-void __handle_bad_pmd_kernel(pmd_t *pmd)
-{
- pmd_ERROR(*pmd);
- set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(get_bad_pte_table())));
-}
-
-pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long offset)
-{
- pte_t *pte;
-
- pte = (pte_t *) __get_free_page(GFP_KERNEL);
- if (pmd_none(*pmd)) {
- if (pte) {
- clear_page(pte);
- set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte)));
- return pte + offset;
- }
- set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(get_bad_pte_table())));
- return NULL;
- }
- free_page((unsigned long)pte);
- if (pmd_bad(*pmd)) {
- __handle_bad_pmd_kernel(pmd);
- return NULL;
- }
- return (pte_t *) pmd_page(*pmd) + offset;
-}
-
-pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset)
-{
- unsigned long pte;
-
- pte = (unsigned long) __get_free_page(GFP_KERNEL);
- if (pmd_none(*pmd)) {
- if (pte) {
- clear_page((void *)pte);
- set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)));
- return (pte_t *)pte + offset;
- }
- set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(get_bad_pte_table())));
- return NULL;
- }
- free_page(pte);
- if (pmd_bad(*pmd)) {
- __handle_bad_pmd(pmd);
- return NULL;
- }
- return (pte_t *) pmd_page(*pmd) + offset;
-}
-
int do_check_pgt_cache(int low, int high)
{
int freed = 0;
if(pgtable_cache_size > high) {
do {
- if(pgd_quicklist)
- free_pgd_slow(get_pgd_fast()), freed++;
- if(pmd_quicklist)
- free_pmd_slow(get_pmd_fast()), freed++;
- if(pte_quicklist)
- free_pte_slow(get_pte_fast()), freed++;
+ if (pgd_quicklist) {
+ free_pgd_slow(get_pgd_fast());
+ freed++;
+ }
+ if (pmd_quicklist) {
+ pmd_free_slow(pmd_alloc_one_fast(NULL, 0));
+ freed++;
+ }
+ if (pte_quicklist) {
+ pte_free_slow(pte_alloc_one_fast(NULL, 0));
+ freed++;
+ }
} while(pgtable_cache_size > low);
}
return freed;
@@ -327,10 +218,8 @@ static void __init pagetable_init (void)
pgd_base = swapper_pg_dir;
#if CONFIG_X86_PAE
- for (i = 0; i < PTRS_PER_PGD; i++) {
- pgd = pgd_base + i;
- __pgd_clear(pgd);
- }
+ for (i = 0; i < PTRS_PER_PGD; i++)
+ set_pgd(pgd_base + i, __pgd(1 + __pa(empty_zero_page)));
#endif
i = __pgd_offset(PAGE_OFFSET);
pgd = pgd_base + i;
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c
index bb72da8c8..55b8b3fcf 100644
--- a/arch/i386/mm/ioremap.c
+++ b/arch/i386/mm/ioremap.c
@@ -49,7 +49,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
if (address >= end)
BUG();
do {
- pte_t * pte = pte_alloc_kernel(pmd, address);
+ pte_t * pte = pte_alloc(&init_mm, pmd, address);
if (!pte)
return -ENOMEM;
remap_area_pte(pte, address, end - address, address + phys_addr, flags);
@@ -62,6 +62,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned lo
static int remap_area_pages(unsigned long address, unsigned long phys_addr,
unsigned long size, unsigned long flags)
{
+ int error;
pgd_t * dir;
unsigned long end = address + size;
@@ -70,19 +71,23 @@ static int remap_area_pages(unsigned long address, unsigned long phys_addr,
flush_cache_all();
if (address >= end)
BUG();
+ spin_lock(&init_mm.page_table_lock);
do {
pmd_t *pmd;
- pmd = pmd_alloc_kernel(dir, address);
+ pmd = pmd_alloc(&init_mm, dir, address);
+ error = -ENOMEM;
if (!pmd)
- return -ENOMEM;
+ break;
if (remap_area_pmd(pmd, address, end - address,
phys_addr + address, flags))
- return -ENOMEM;
+ break;
+ error = 0;
address = (address + PGDIR_SIZE) & PGDIR_MASK;
dir++;
} while (address && (address < end));
+ spin_unlock(&init_mm.page_table_lock);
flush_tlb_all();
- return 0;
+ return error;
}
/*