## Automatically generated incremental diff
## From:   linux-2.4.26-pre5
## To:     linux-2.4.26-pre6
## Robot:  $Id: make-incremental-diff,v 1.12 2004/01/06 07:19:36 hpa Exp $

diff -urN linux-2.4.26-pre5/Documentation/Configure.help linux-2.4.26-pre6/Documentation/Configure.help
--- linux-2.4.26-pre5/Documentation/Configure.help	2004-03-24 19:07:19.000000000 -0800
+++ linux-2.4.26-pre6/Documentation/Configure.help	2004-03-24 19:07:28.000000000 -0800
@@ -23602,7 +23602,7 @@
   If you have the BSC Oktagon SCSI disk controller for the Amiga, say
   Y to this question.  If you're in doubt about whether you have one,
   see the picture at
-  <http://amiga.multigraph.com/photos/oktagon.html>.
+  <http://amiga.resource.cx/exp/search.pl?product=oktagon>.
 
 Atari native SCSI support
 CONFIG_ATARI_SCSI
diff -urN linux-2.4.26-pre5/Documentation/kernel-parameters.txt linux-2.4.26-pre6/Documentation/kernel-parameters.txt
--- linux-2.4.26-pre5/Documentation/kernel-parameters.txt	2004-03-24 19:07:19.000000000 -0800
+++ linux-2.4.26-pre6/Documentation/kernel-parameters.txt	2004-03-24 19:07:28.000000000 -0800
@@ -76,9 +76,8 @@
 		strict	Be less tolerant of platforms that are not
 			strictly ACPI specification compliant.
 
-	acpi_pic_sci=	[HW,ACPI] ACPI System Conrol Interrupt trigger mode
-		level	Force PIC-mode SCI to Level Trigger (default)
-		edge	Force PIC-mode SCI to Edge Trigger
+	acpi_sci=	[HW,ACPI] ACPI System Control Interrupt trigger mode
+			Format: { level | edge |  high | low }
  
 	acpi_irq_balance	ACPI will balance active IRQs
 	acpi_irq_nobalance	ACPI will not move active IRQs
diff -urN linux-2.4.26-pre5/MAINTAINERS linux-2.4.26-pre6/MAINTAINERS
--- linux-2.4.26-pre5/MAINTAINERS	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/MAINTAINERS	2004-03-24 19:07:28.000000000 -0800
@@ -2110,7 +2110,6 @@
 
 VIA 82Cxxx AUDIO DRIVER
 P:	Jeff Garzik
-L:	linux-via@gtf.org
 S:	Odd fixes
 
 VIA RHINE NETWORK DRIVER
diff -urN linux-2.4.26-pre5/Makefile linux-2.4.26-pre6/Makefile
--- linux-2.4.26-pre5/Makefile	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/Makefile	2004-03-24 19:07:28.000000000 -0800
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 26
-EXTRAVERSION = -pre5
+EXTRAVERSION = -pre6
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.26-pre5/arch/i386/kernel/acpi.c linux-2.4.26-pre6/arch/i386/kernel/acpi.c
--- linux-2.4.26-pre5/arch/i386/kernel/acpi.c	2004-03-24 19:07:16.000000000 -0800
+++ linux-2.4.26-pre6/arch/i386/kernel/acpi.c	2004-03-24 19:07:28.000000000 -0800
@@ -53,6 +53,8 @@
 int acpi_ioapic;
 int acpi_strict;
 
+acpi_interrupt_flags acpi_sci_flags __initdata;
+int acpi_sci_override_gsi __initdata;
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
@@ -214,6 +216,54 @@
 	return 0;
 }
 
+/*
+ * Parse Interrupt Source Override for the ACPI SCI
+ */
+static void
+acpi_parse_sci_int_src_ovr(u8 bus_irq, u16 polarity, u16 trigger, u32 global_irq)
+{
+	if (trigger == 0)	/* compatible SCI trigger is level */
+		trigger = 3;
+
+	if (polarity == 0)	/* compatible SCI polarity is low */
+		polarity = 3;
+
+	/* Command-line over-ride via acpi_sci= */
+	if (acpi_sci_flags.trigger)
+		trigger = acpi_sci_flags.trigger;
+
+	if (acpi_sci_flags.polarity)
+		polarity = acpi_sci_flags.polarity;
+
+	mp_override_legacy_irq(bus_irq, polarity, trigger, global_irq);
+
+	/*
+	 * stash over-ride to indicate we've been here
+	 * and for later update of acpi_fadt
+	 */
+	acpi_sci_override_gsi = global_irq;
+	return;
+}
+
+static int __init
+acpi_parse_fadt(unsigned long phys, unsigned long size)
+{
+        struct fadt_descriptor_rev2 *fadt =0;
+
+        fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
+        if (!fadt) {
+                printk(KERN_WARNING PREFIX "Unable to map FADT\n");
+                return 0;
+        }
+
+#ifdef  CONFIG_ACPI_INTERPRETER
+        /* initialize sci_int early for INT_SRC_OVR MADT parsing */
+        acpi_fadt.sci_int = fadt->sci_int;
+#endif
+
+        return 0;
+}
+
 
 static int __init
 acpi_parse_int_src_ovr (
@@ -227,6 +277,13 @@
 
 	acpi_table_print_madt_entry(header);
 
+	if (intsrc->bus_irq == acpi_fadt.sci_int) {
+		acpi_parse_sci_int_src_ovr(intsrc->bus_irq,
+			intsrc->flags.polarity, intsrc->flags.trigger,
+			intsrc->global_irq);
+		return 0;
+	}
+
 	mp_override_legacy_irq (
 		intsrc->bus_irq,
 		intsrc->flags.polarity,
@@ -307,7 +364,7 @@
  * 	acpi_lapic = 1 if LAPIC found
  *	acpi_ioapic = 1 if IOAPIC found
  *	if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
- *	if acpi_blacklisted() acpi_disabled = 1;
+ *	if acpi_blacklisted() disable_acpi()
  *	acpi_irq_model=...
  *	...
  *
@@ -334,14 +391,14 @@
 	 */
 	result = acpi_table_init();
 	if (result) {
-		acpi_disabled = 1;
+		disable_acpi();
 		return result;
 	}
 
 	result = acpi_blacklisted();
 	if (result) {
 		printk(KERN_NOTICE PREFIX "BIOS listed in blacklist, disabling ACPI support\n");
-		acpi_disabled = 1;
+		disable_acpi();
 		return result;
 	}
 
@@ -444,6 +501,9 @@
 	/* Build a default routing table for legacy (ISA) interrupts. */
 	mp_config_acpi_legacy_irqs();
 
+	/* Record sci_int for use when looking for MADT sci_int override */
+	acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
+
 	result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
@@ -451,6 +511,13 @@
 		return result;
 	}
 
+	/*
+	 * If BIOS did not supply an INT_SRC_OVR for the SCI
+	 * pretend we got one so we can set the SCI flags.
+	 */
+	if (!acpi_sci_override_gsi)
+		acpi_parse_sci_int_src_ovr(acpi_fadt.sci_int, 0, 0, acpi_fadt.sci_int);
+
 	result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
@@ -475,13 +542,12 @@
 
 #ifdef	CONFIG_ACPI_BUS
 /*
- * "acpi_pic_sci=level" (current default)
- * programs the PIC-mode SCI to Level Trigger.
- * (NO-OP if the BIOS set Level Trigger already)
+ * acpi_pic_sci_set_trigger()
+ *
+ * use ELCR to set PIC-mode trigger type for SCI
  *
  * If a PIC-mode SCI is not recognized or gives spurious IRQ7's
- * it may require Edge Trigger -- use "acpi_pic_sci=edge"
- * (NO-OP if the BIOS set Edge Trigger already)
+ * it may require Edge Trigger -- use "acpi_sci=edge"
  *
  * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
@@ -489,52 +555,33 @@
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
  */
 
-static __initdata int	acpi_pic_sci_trigger;	/* 0: level, 1: edge */
-
 void __init
-acpi_pic_sci_set_trigger(unsigned int irq)
+acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 {
 	unsigned char mask = 1 << (irq & 7);
 	unsigned int port = 0x4d0 + (irq >> 3);
 	unsigned char val = inb(port);
 
-	
+
 	printk(PREFIX "IRQ%d SCI:", irq);
 	if (!(val & mask)) {
 		printk(" Edge");
 
-		if (!acpi_pic_sci_trigger) {
+		if (trigger == 3) {
 			printk(" set to Level");
 			outb(val | mask, port);
 		}
 	} else {
 		printk(" Level");
 
-		if (acpi_pic_sci_trigger) {
+		if (trigger == 1) {
 			printk(" set to Edge");
-			outb(val | mask, port);
+			outb(val & ~mask, port);
 		}
 	}
 	printk(" Trigger.\n");
 }
 
-int __init
-acpi_pic_sci_setup(char *str)
-{
-	while (str && *str) {
-		if (strncmp(str, "level", 5) == 0)
-			acpi_pic_sci_trigger = 0;	/* force level trigger */
-		if (strncmp(str, "edge", 4) == 0)
-			acpi_pic_sci_trigger = 1;	/* force edge trigger */
-		str = strchr(str, ',');
-		if (str)
-			str += strspn(str, ", \t");
-	}
-	return 1;
-}
-
-__setup("acpi_pic_sci=", acpi_pic_sci_setup);
-
 #endif /* CONFIG_ACPI_BUS */
 
 
diff -urN linux-2.4.26-pre5/arch/i386/kernel/dmi_scan.c linux-2.4.26-pre6/arch/i386/kernel/dmi_scan.c
--- linux-2.4.26-pre5/arch/i386/kernel/dmi_scan.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/i386/kernel/dmi_scan.c	2004-03-24 19:07:28.000000000 -0800
@@ -482,13 +482,13 @@
 
 
 #ifdef	CONFIG_ACPI_BOOT
-extern int acpi_disabled, acpi_force, acpi_ht;
+extern int acpi_force;
 
-static __init __attribute__((unused)) int acpi_disable(struct dmi_blacklist *d) 
+static __init __attribute__((unused)) int dmi_disable_acpi(struct dmi_blacklist *d) 
 { 
 	if (!acpi_force) { 
 		printk(KERN_NOTICE "%s detected: acpi off\n",d->ident); 
-		acpi_disabled = 1;
+		disable_acpi();
 	} else { 
 		printk(KERN_NOTICE 
 		       "Warning: DMI blacklist says broken, but acpi forced\n"); 
@@ -504,7 +504,7 @@
 { 
 	if (!acpi_force) { 
 		printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident); 
-		acpi_disabled = 1; 
+		disable_acpi();
 		acpi_ht = 1; 
 	} else { 
 		printk(KERN_NOTICE 
@@ -839,7 +839,7 @@
 	 *	Boxes that need ACPI disabled
 	 */
 
-	{ acpi_disable, "IBM Thinkpad", {
+	{ dmi_disable_acpi, "IBM Thinkpad", {
 			MATCH(DMI_BOARD_VENDOR, "IBM"),
 			MATCH(DMI_BOARD_NAME, "2629H1G"),
 			NO_MATCH, NO_MATCH }},
@@ -968,8 +968,7 @@
 			if (disable && !acpi_force) { 
 				printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s);
 				printk(KERN_NOTICE "You can enable it with acpi=force\n");
-				acpi_disabled = 1; 
-				acpi_ht = 0;
+				disable_acpi();
 			} 
 		}
 	}
diff -urN linux-2.4.26-pre5/arch/i386/kernel/mpparse.c linux-2.4.26-pre6/arch/i386/kernel/mpparse.c
--- linux-2.4.26-pre5/arch/i386/kernel/mpparse.c	2004-03-24 19:07:16.000000000 -0800
+++ linux-2.4.26-pre6/arch/i386/kernel/mpparse.c	2004-03-24 19:07:28.000000000 -0800
@@ -34,6 +34,9 @@
 
 /* Have we found an MP table */
 int smp_found_config;
+#ifdef	CONFIG_SMP
+extern unsigned int max_cpus;
+#endif
 
 /*
  * Various Linux-internal data structures created from the
@@ -229,11 +232,19 @@
 		boot_cpu_logical_apicid = logical_apicid;
 	}
 
-	if (num_processors >= NR_CPUS){
-		printk(KERN_WARNING "NR_CPUS limit of %i reached. Cannot "
-			"boot CPU(apicid 0x%x).\n", NR_CPUS, m->mpc_apicid);
+#ifdef	CONFIG_SMP
+	if (num_processors >= NR_CPUS) {
+		printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
+			" Processor ignored.\n", NR_CPUS);
+		return;
+	}
+	if (num_processors >= max_cpus) {
+		printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
+			" Processor ignored.\n", max_cpus);
 		return;
 	}
+#endif
+
 	num_processors++;
 
 	if (m->mpc_apicid > MAX_APICS) {
@@ -1228,70 +1239,6 @@
 
 extern FADT_DESCRIPTOR acpi_fadt;
 
-void __init mp_config_ioapic_for_sci(int irq)
-{
-	int ioapic;
-	int ioapic_pin;
-	struct acpi_table_madt* madt;
-	struct acpi_table_int_src_ovr *entry = NULL;
-	acpi_interrupt_flags flags;
-	void *madt_end;
-	acpi_status status;
-
-	/*
-	 * Ensure that if there is an interrupt source override entry
-	 * for the ACPI SCI, we leave it as is. Unfortunately this involves
-	 * walking the MADT again.
-	 */
-	status = acpi_get_firmware_table("APIC", 1, ACPI_LOGICAL_ADDRESSING,
-		(struct acpi_table_header **) &madt);
-	if (ACPI_SUCCESS(status)) {
-		madt_end = (void *) (unsigned long)madt + madt->header.length;
-
-		entry = (struct acpi_table_int_src_ovr *)
-                ((unsigned long) madt + sizeof(struct acpi_table_madt));
-
-		while ((void *) entry < madt_end) {
-                	if (entry->header.type == ACPI_MADT_INT_SRC_OVR &&
-			    acpi_fadt.sci_int == entry->bus_irq)
-				goto found;
-			
-                	entry = (struct acpi_table_int_src_ovr *)
-                	        ((unsigned long) entry + entry->header.length);
-        	}
-	}
-	/*
-	 * Although the ACPI spec says that the SCI should be level/low
-	 * don't reprogram it unless there is an explicit MADT OVR entry
-	 * instructing us to do so -- otherwise we break Tyan boards which
-	 * have the SCI wired edge/high but no MADT OVR.
-	 */
-	return;
-
-found:
-	/*
-	 * See the note at the end of ACPI 2.0b section
-	 * 5.2.10.8 for what this is about.
-	 */
-	flags = entry->flags;
-	acpi_fadt.sci_int = entry->global_irq;
-	irq = entry->global_irq;
-	
-	ioapic = mp_find_ioapic(irq);
-
-	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
-
-	/*
-	 * MPS INTI flags:
-	 *  trigger: 0=default, 1=edge, 3=level
-	 *  polarity: 0=default, 1=high, 3=low
-	 * Per ACPI spec, default for SCI means level/low.
-	 */
-	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
-		(flags.trigger == 1 ? 0 : 1), (flags.polarity == 1 ? 0 : 1));
-}
-
-
 #ifdef CONFIG_ACPI_PCI
 
 void __init mp_parse_prt (void)
diff -urN linux-2.4.26-pre5/arch/i386/kernel/setup.c linux-2.4.26-pre6/arch/i386/kernel/setup.c
--- linux-2.4.26-pre5/arch/i386/kernel/setup.c	2004-03-24 19:07:16.000000000 -0800
+++ linux-2.4.26-pre6/arch/i386/kernel/setup.c	2004-03-24 19:07:28.000000000 -0800
@@ -187,6 +187,7 @@
 #ifdef	CONFIG_ACPI_BOOT
 extern	int __initdata acpi_ht;
 int acpi_force __initdata = 0;
+extern acpi_interrupt_flags	acpi_sci_flags;
 #endif
 
 extern int blk_nohighio;
@@ -831,25 +832,36 @@
 				}
 			}
 		}
+#ifdef	CONFIG_SMP
+		/*
+		 * If the BIOS enumerates physical processors before logical,
+		 * maxcpus=N at enumeration-time can be used to disable HT.
+		 */
+		else if (!memcmp(from, "maxcpus=", 8)) {
+			extern unsigned int max_cpus;
+
+			max_cpus = simple_strtoul(from + 8, NULL, 0);
+		}
+#endif
 
 #ifdef CONFIG_ACPI_BOOT
 		/* "acpi=off" disables both ACPI table parsing and interpreter */
 		else if (!memcmp(from, "acpi=off", 8)) {
-			acpi_ht = 0;
-			acpi_disabled = 1;
+			disable_acpi();
 		}
 
 		/* acpi=force to over-ride black-list */
 		else if (!memcmp(from, "acpi=force", 10)) { 
 			acpi_force = 1;
-			acpi_ht=1;
+			acpi_ht = 1;
 			acpi_disabled = 0;
 		} 
 
 		/* Limit ACPI to boot-time only, still enabled HT */
 		else if (!memcmp(from, "acpi=ht", 7)) { 
+			if (!acpi_force)
+				disable_acpi();
 			acpi_ht = 1; 
-			if (!acpi_force) acpi_disabled = 1; 
 		} 
 
 		/* acpi=strict disables out-of-spec workarounds */
@@ -864,6 +876,16 @@
                 /* disable IO-APIC */
                 else if (!memcmp(from, "noapic", 6))
                         disable_ioapic_setup();
+
+		else if (!memcmp(from, "acpi_sci=edge", 13))
+			acpi_sci_flags.trigger =  1;
+		else if (!memcmp(from, "acpi_sci=level", 14))
+			acpi_sci_flags.trigger = 3;
+		else if (!memcmp(from, "acpi_sci=high", 13))
+			acpi_sci_flags.polarity = 1;
+		else if (!memcmp(from, "acpi_sci=low", 12))
+			acpi_sci_flags.polarity = 3;
+
 #endif
 		/*
 		 * highmem=size forces highmem to be exactly 'size' bytes.
diff -urN linux-2.4.26-pre5/arch/i386/kernel/smpboot.c linux-2.4.26-pre6/arch/i386/kernel/smpboot.c
--- linux-2.4.26-pre5/arch/i386/kernel/smpboot.c	2004-02-18 05:36:30.000000000 -0800
+++ linux-2.4.26-pre6/arch/i386/kernel/smpboot.c	2004-03-24 19:07:28.000000000 -0800
@@ -51,7 +51,7 @@
 static int smp_b_stepping;
 
 /* Setup configured maximum number of CPUs to activate */
-static int max_cpus = NR_CPUS;
+unsigned int max_cpus = NR_CPUS;
 
 /* Total count of live CPUs */
 int smp_num_cpus = 1;
@@ -77,10 +77,6 @@
  *
  * Command-line option of "nosmp" or "maxcpus=0" will disable SMP
  * activation entirely (the MPS table probe still happens, though).
- *
- * Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
- * greater than 0, limits the maximum number of CPUs activated in
- * SMP mode to <NUM>.
  */
 
 static int __init nosmp(char *str)
@@ -91,14 +87,6 @@
 
 __setup("nosmp", nosmp);
 
-static int __init maxcpus(char *str)
-{
-	get_option(&str, &max_cpus);
-	return 1;
-}
-
-__setup("maxcpus=", maxcpus);
-
 /*
  * Trampoline 80x86 program as an array.
  */
@@ -1120,8 +1108,6 @@
 
 		if (!(phys_cpu_present_map & apicid_to_phys_cpu_present(apicid)))
 			continue;
-		if (max_cpus <= cpucount+1)
-			continue;
 
 		do_boot_cpu(apicid);
 
diff -urN linux-2.4.26-pre5/arch/ia64/kernel/acpi.c linux-2.4.26-pre6/arch/ia64/kernel/acpi.c
--- linux-2.4.26-pre5/arch/ia64/kernel/acpi.c	2004-02-18 05:36:30.000000000 -0800
+++ linux-2.4.26-pre6/arch/ia64/kernel/acpi.c	2004-03-24 19:07:28.000000000 -0800
@@ -65,8 +65,6 @@
 
 unsigned char acpi_kbd_controller_present = 1;
 
-int acpi_disabled __initdata;	/* XXX this shouldn't be needed---we can't boot without ACPI! */
-
 const char *
 acpi_get_sysname (void)
 {
diff -urN linux-2.4.26-pre5/arch/m68k/mac/baboon.c linux-2.4.26-pre6/arch/m68k/mac/baboon.c
--- linux-2.4.26-pre5/arch/m68k/mac/baboon.c	2003-06-13 07:51:31.000000000 -0700
+++ linux-2.4.26-pre6/arch/m68k/mac/baboon.c	2004-03-24 19:07:29.000000000 -0800
@@ -19,8 +19,8 @@
 #include <asm/macints.h> 
 #include <asm/mac_baboon.h>
 
-/* #define DEBUG_BABOON /**/
-/* #define DEBUG_IRQS /**/
+/* #define DEBUG_BABOON */
+/* #define DEBUG_IRQS */
 
 int baboon_present,baboon_active;
 volatile struct baboon *baboon;
diff -urN linux-2.4.26-pre5/arch/m68k/mac/config.c linux-2.4.26-pre6/arch/m68k/mac/config.c
--- linux-2.4.26-pre5/arch/m68k/mac/config.c	2003-08-25 04:44:39.000000000 -0700
+++ linux-2.4.26-pre6/arch/m68k/mac/config.c	2004-03-24 19:07:29.000000000 -0800
@@ -33,6 +33,7 @@
 #include <asm/pgtable.h>
 #include <asm/rtc.h>
 #include <asm/machdep.h>
+#include <asm/keyboard.h>
 
 #include <asm/macintosh.h>
 #include <asm/macints.h>
diff -urN linux-2.4.26-pre5/arch/sparc64/defconfig linux-2.4.26-pre6/arch/sparc64/defconfig
--- linux-2.4.26-pre5/arch/sparc64/defconfig	2004-03-24 19:07:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/sparc64/defconfig	2004-03-24 19:07:30.000000000 -0800
@@ -362,6 +362,7 @@
 CONFIG_NET_SCH_TEQL=m
 CONFIG_NET_SCH_TBF=m
 CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DELAY=m
 CONFIG_NET_SCH_DSMARK=m
 CONFIG_NET_SCH_INGRESS=m
 CONFIG_NET_QOS=y
@@ -745,8 +746,8 @@
 CONFIG_BEFS_FS=m
 # CONFIG_BEFS_DEBUG is not set
 CONFIG_BFS_FS=m
-CONFIG_EXT3_FS=m
-CONFIG_JBD=m
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
@@ -770,8 +771,8 @@
 # CONFIG_NTFS_RW is not set
 CONFIG_HPFS_FS=m
 CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-# CONFIG_DEVFS_MOUNT is not set
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
 # CONFIG_DEVFS_DEBUG is not set
 CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
@@ -1045,6 +1046,7 @@
 # CONFIG_USB_GADGET_CONTROLLER is not set
 CONFIG_USB_NET2280=y
 CONFIG_USB_GADGET_CONTROLLER=y
+CONFIG_USB_GADGET_DUALSPEED=y
 
 #
 # USB Gadget Drivers
diff -urN linux-2.4.26-pre5/arch/sparc64/kernel/sys_sparc32.c linux-2.4.26-pre6/arch/sparc64/kernel/sys_sparc32.c
--- linux-2.4.26-pre5/arch/sparc64/kernel/sys_sparc32.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/sparc64/kernel/sys_sparc32.c	2004-03-24 19:07:30.000000000 -0800
@@ -1799,14 +1799,13 @@
 	if (err)
 		goto out;
 
-	if (!type_page) {
-		err = -EINVAL;
-		goto out;
+	if (type_page) {
+		is_smb = !strcmp((char *)type_page, SMBFS_NAME);
+		is_ncp = !strcmp((char *)type_page, NCPFS_NAME);
+	} else {
+		is_smb = is_ncp = 0;
 	}
 
-	is_smb = !strcmp((char *)type_page, SMBFS_NAME);
-	is_ncp = !strcmp((char *)type_page, NCPFS_NAME);
-
 	err = copy_mount_stuff_to_kernel((const void *)AA(data), &data_page);
 	if (err)
 		goto type_out;
diff -urN linux-2.4.26-pre5/arch/x86_64/Makefile linux-2.4.26-pre6/arch/x86_64/Makefile
--- linux-2.4.26-pre5/arch/x86_64/Makefile	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/Makefile	2004-03-24 19:07:30.000000000 -0800
@@ -19,7 +19,7 @@
 # 20010105  Andi Kleen, add IA32 compiler.
 #           ....and later removed it again....
 #
-# $Id: Makefile,v 1.34 2003/09/25 02:50:05 ak Exp $
+# $Id: Makefile,v 1.36 2004/02/27 18:30:19 ak Exp $
 
 #
 # early bootup linking needs 32bit. You can either use real 32bit tools
@@ -53,8 +53,16 @@
 ifneq ($(CONFIG_X86_REMOTE_DEBUG),y)
 CFLAGS += -fno-asynchronous-unwind-tables
 endif
+# this is needed right now for the 32bit ioctl code
 CFLAGS += $(call check_gcc,-fno-unit-at-a-time,)
 
+ifdef CONFIG_MK8
+CFLAGS += $(call check_gcc,-march=k8,)
+endif
+ifdef CONFIG_MPSC
+CFLAGS += $(call check_gcc,-march=prescott,)
+endif
+
 HEAD := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
 
 SUBDIRS := arch/x86_64/tools $(SUBDIRS) arch/x86_64/kernel arch/x86_64/mm arch/x86_64/lib
diff -urN linux-2.4.26-pre5/arch/x86_64/boot/setup.S linux-2.4.26-pre6/arch/x86_64/boot/setup.S
--- linux-2.4.26-pre5/arch/x86_64/boot/setup.S	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/boot/setup.S	2004-03-24 19:07:30.000000000 -0800
@@ -289,8 +289,9 @@
 	/* minimum CPUID flags for x86-64 */
 	/* see http://www.x86-64.org/lists/discuss/msg02971.html */		
 #define SSE_MASK ((1<<25)|(1<<26))
-#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|(1<<11)| \
-					   (1<<13)|(1<<15)|(1<<24)|(1<<29))
+#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|\
+					   (1<<13)|(1<<15)|(1<<24))
+#define REQUIRED_MASK2 (1<<29)
 
 	pushfl				/* standard way to check for cpuid */
 	popl	%eax
@@ -302,10 +303,10 @@
 	popl	%eax
 	cmpl	%eax,%ebx
 	jz	no_longmode		/* cpu has no cpuid */
-	movl	$0x80000000,%eax
+	movl	$0x0,%eax
 	cpuid
-	cmpl	$0x80000001,%eax
-	jb	no_longmode		/* no extended cpuid */
+	cmpl	$0x1,%eax
+	jb	no_longmode		/* no cpuid 1 */
 	xor	%di,%di
 	cmpl	$0x68747541,%ebx	/* AuthenticAMD */
 	jnz	noamd
@@ -315,11 +316,20 @@
 	jnz	noamd
 	mov	$1,%di			/* cpu is from AMD */
 noamd:		
-	movl	$0x80000001,%eax		
+	movl    $0x1,%eax
 	cpuid
 	andl	$REQUIRED_MASK1,%edx
 	xorl	$REQUIRED_MASK1,%edx
 	jnz	no_longmode
+	movl    $0x80000000,%eax
+	cpuid
+	cmpl    $0x80000001,%eax
+	jb      no_longmode             /* no extended cpuid */
+	movl    $0x80000001,%eax
+	cpuid
+	andl    $REQUIRED_MASK2,%edx
+	xorl    $REQUIRED_MASK2,%edx
+	jnz     no_longmode
 sse_test:		
 	movl	$1,%eax
 	cpuid
diff -urN linux-2.4.26-pre5/arch/x86_64/config.in linux-2.4.26-pre6/arch/x86_64/config.in
--- linux-2.4.26-pre5/arch/x86_64/config.in	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/config.in	2004-03-24 19:07:30.000000000 -0800
@@ -34,13 +34,19 @@
 comment 'Processor type and features'
 choice 'Processor family' \
 	"AMD-Hammer			CONFIG_MK8 \
+	 Intel-x86-64			CONFIG_MPSC \
 	 Generic-x86-64			CONFIG_GENERIC_CPU" AMD-Hammer
 	
 #
 # Define implied options from the CPU selection here
 #
+if [ "$CONFIG_GENERIC_CPU" = "y" -o "$CONFIG_MPSC" = "y" ]; then
+define_int CONFIG_X86_L1_CACHE_BYTES 128
+define_int CONFIG_X86_L1_CACHE_SHIFT 7
+else
 define_int CONFIG_X86_L1_CACHE_BYTES 64
 define_int CONFIG_X86_L1_CACHE_SHIFT 6
+fi
 define_bool CONFIG_X86_TSC y
 define_bool CONFIG_X86_GOOD_APIC y
 
@@ -58,6 +64,9 @@
 bool 'Symmetric multi-processing support' CONFIG_SMP
 bool 'HPET timers' CONFIG_HPET_TIMER
 bool 'IOMMU support' CONFIG_GART_IOMMU
+if [ "$CONFIG_GART_IOMMU" = "y" ]; then
+    bool 'SWIOTLB support' CONFIG_SWIOTLB
+fi
 
 if [ "$CONFIG_GART_IOMMU" != "y" ]; then
    define_bool CONFIG_DUMMY_IOMMU y
@@ -141,6 +150,7 @@
 if [ "$CONFIG_IDE" != "n" ]; then
   source drivers/ide/Config.in
 else
+  define_bool CONFIG_BLK_DEV_IDE_MODES n
   define_bool CONFIG_BLK_DEV_HD n
 fi
 endmenu
diff -urN linux-2.4.26-pre5/arch/x86_64/defconfig linux-2.4.26-pre6/arch/x86_64/defconfig
--- linux-2.4.26-pre5/arch/x86_64/defconfig	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/defconfig	2004-03-24 19:07:30.000000000 -0800
@@ -26,10 +26,11 @@
 #
 # Processor type and features
 #
-CONFIG_MK8=y
+# CONFIG_MK8 is not set
+CONFIG_MPSC=y
 # CONFIG_GENERIC_CPU is not set
-CONFIG_X86_L1_CACHE_BYTES=64
-CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_L1_CACHE_BYTES=128
+CONFIG_X86_L1_CACHE_SHIFT=7
 CONFIG_X86_TSC=y
 CONFIG_X86_GOOD_APIC=y
 CONFIG_X86_MSR=y
@@ -43,6 +44,7 @@
 CONFIG_SMP=y
 CONFIG_HPET_TIMER=y
 CONFIG_GART_IOMMU=y
+CONFIG_SWIOTLB=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_NR_CPUS=4
 CONFIG_MCE=y
@@ -159,6 +161,9 @@
 #
 CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+CONFIG_SCTP_HMAC_SHA1=y
+# CONFIG_SCTP_HMAC_MD5 is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
 
@@ -254,7 +259,7 @@
 # CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_HPT34X_AUTODMA is not set
 # CONFIG_BLK_DEV_HPT366 is not set
-# CONFIG_BLK_DEV_PIIX is not set
+CONFIG_BLK_DEV_PIIX=y
 # CONFIG_BLK_DEV_NS87415 is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -275,6 +280,7 @@
 # CONFIG_BLK_DEV_ATARAID is not set
 # CONFIG_BLK_DEV_ATARAID_PDC is not set
 # CONFIG_BLK_DEV_ATARAID_HPT is not set
+# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
 # CONFIG_BLK_DEV_ATARAID_SII is not set
 
 #
@@ -421,7 +427,8 @@
 #
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
+CONFIG_E1000=y
+# CONFIG_E1000_NAPI is not set
 # CONFIG_MYRI_SBUS is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
diff -urN linux-2.4.26-pre5/arch/x86_64/ia32/ia32_ioctl.c linux-2.4.26-pre6/arch/x86_64/ia32/ia32_ioctl.c
--- linux-2.4.26-pre5/arch/x86_64/ia32/ia32_ioctl.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/ia32/ia32_ioctl.c	2004-03-24 19:07:30.000000000 -0800
@@ -1,4 +1,4 @@
-/* $Id: ia32_ioctl.c,v 1.39 2004/01/29 03:01:57 ak Exp $
+/* $Id: ia32_ioctl.c,v 1.44 2004/03/21 22:32:20 ak Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
@@ -1785,7 +1785,10 @@
 	unsigned int		buflen;
 	int			stat;
 	__kernel_caddr_t32	sense;
-	__kernel_caddr_t32	reserved[3];
+	unsigned char		data_direction;
+	int			quiet;
+	int			timeout;
+	__kernel_caddr_t32	reserved[1];
 };
 
 static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
@@ -1827,17 +1830,25 @@
 			return -EFAULT;
 		cdreadaudio.buf = (void *)A(addr);
 		break;
-	case CDROM_SEND_PACKET:
+	case CDROM_SEND_PACKET: {
+		__kernel_caddr_t32 sense;
 		karg = &cgc;
 		err = copy_from_user(cgc.cmd, &((struct cdrom_generic_command32 *)arg)->cmd, sizeof(cgc.cmd));
 		err |= __get_user(addr, &((struct cdrom_generic_command32 *)arg)->buffer);
 		err |= __get_user(cgc.buflen, &((struct cdrom_generic_command32 *)arg)->buflen);
+		err |= __get_user(sense, &((struct cdrom_generic_command32 *)arg)->sense);
+		err |= __get_user(cgc.data_direction, &((struct cdrom_generic_command32 *)arg)->data_direction);
+		err |= __get_user(cgc.timeout, &((struct cdrom_generic_command32 *)arg)->timeout);
 		if (err)
 			return -EFAULT;
 		if (verify_area(VERIFY_WRITE, (void *)A(addr), cgc.buflen))
 			return -EFAULT;
+		if (sense && verify_area(VERIFY_WRITE, (void *)A(sense), sizeof(struct request_sense)))
+			return -EFAULT;
 		cgc.buffer = (void *)A(addr);
+		cgc.sense = (void *)A(sense);
 		break;
+	}
 	default:
 		do {
 			static int count;
@@ -2754,7 +2765,7 @@
 	struct file *file = fget(fd);
 	struct tty_struct *real_tty;
 
-	if (!fd)
+	if (!file)
 		return -EBADF;
 	if (file->f_op->ioctl != tty_ioctl)
 		return -EINVAL; 
@@ -3535,6 +3546,33 @@
 	return sys_ioctl(fd, cmd, (unsigned long) iwr);
 }
 
+struct compat_ctrlmsg_ioctl { 
+	struct usb_ctrlrequest req;
+	u32 data;
+}; 
+
+struct ctrlmsg_ioctl { 
+	struct usb_ctrlrequest req;
+	void *data;
+}; 
+
+#define SCANNER_IOCTL_CTRLMSG _IOWR('U', 0x22, struct usb_ctrlrequest)
+
+static int scanner_ioctl_ctrlmsg(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct ctrlmsg_ioctl *c64;
+	struct compat_ctrlmsg_ioctl *c32 = (void *)arg; 
+	u32 ptr;
+
+	c64 = compat_alloc_user_space(sizeof(struct ctrlmsg_ioctl));
+
+	if (copy_in_user(&c64->req, &c32->req, sizeof(struct usb_ctrlrequest)) ||
+	    get_user(ptr, &c32->data) || 
+	    put_user((void *)(unsigned long)ptr, &c64->data))
+		return -EFAULT;
+	return sys_ioctl(fd,cmd, (unsigned long)c64); 
+} 
+
 struct ioctl_trans {
 	unsigned long cmd;
 	int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
@@ -4423,6 +4461,17 @@
 HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl)
 HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl)
 COMPATIBLE_IOCTL(SIOCGIWNAME)
+
+COMPATIBLE_IOCTL(SIOCSIFNAME)
+/* usb scanner */
+#define SCANNER_IOCTL_VENDOR _IOR('U', 0x20, int)
+#define SCANNER_IOCTL_PRODUCT _IOR('U', 0x21, int)
+
+COMPATIBLE_IOCTL(SCANNER_IOCTL_VENDOR)
+COMPATIBLE_IOCTL(SCANNER_IOCTL_PRODUCT)
+/* USB scanner 'U' */
+HANDLE_IOCTL(SCANNER_IOCTL_CTRLMSG, scanner_ioctl_ctrlmsg)
+
 IOCTL_TABLE_END
 
 #define IOCTL_HASHSIZE 256
@@ -4602,7 +4651,9 @@
 		t = (struct ioctl_trans *)t->next;
 	if (t) {
 		handler = t->handler;
+		lock_kernel();
 		error = handler(fd, cmd, arg, filp);
+		unlock_kernel();
 	} else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
 		error = siocdevprivate_ioctl(fd, cmd, arg);
 	} else {
diff -urN linux-2.4.26-pre5/arch/x86_64/ia32/ptrace32.c linux-2.4.26-pre6/arch/x86_64/ia32/ptrace32.c
--- linux-2.4.26-pre5/arch/x86_64/ia32/ptrace32.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/ia32/ptrace32.c	2004-03-24 19:07:30.000000000 -0800
@@ -8,7 +8,7 @@
  * This allows to access 64bit processes too; but there is no way to see the extended 
  * register contents.
  *
- * $Id: ptrace32.c,v 1.18 2004/01/29 00:50:29 ak Exp $
+ * $Id: ptrace32.c,v 1.19 2004/01/29 03:31:13 ak Exp $
  */ 
 
 #include <linux/kernel.h>
@@ -73,9 +73,12 @@
 	R32(eip, rip);
 	R32(esp, rsp);
 
-	case offsetof(struct user32, regs.eflags): 
-		stack[offsetof(struct pt_regs, eflags)/8] = val & 0x44dd5; 
+	case offsetof(struct user32, regs.eflags): { 
+		__u64 *flags = &stack[offsetof(struct pt_regs, eflags)/8];
+		val &= FLAG_MASK;
+		*flags = val | (*flags & ~FLAG_MASK);
 		break;
+	}
 
 	case offsetof(struct user32, u_debugreg[4]): 
 	case offsetof(struct user32, u_debugreg[5]):
diff -urN linux-2.4.26-pre5/arch/x86_64/ia32/sys_ia32.c linux-2.4.26-pre6/arch/x86_64/ia32/sys_ia32.c
--- linux-2.4.26-pre5/arch/x86_64/ia32/sys_ia32.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/ia32/sys_ia32.c	2004-03-24 19:07:30.000000000 -0800
@@ -16,7 +16,7 @@
  *
  * This file assumes that there is a hole at the end of user address space.
  *
- * $Id: sys_ia32.c,v 1.69 2004/01/29 02:52:13 ak Exp $
+ * $Id: sys_ia32.c,v 1.70 2004/03/03 23:36:43 ak Exp $
  */
 
 #include <linux/config.h>
@@ -1802,7 +1802,7 @@
 			return -EFAULT;
 	}
 	set_fs (KERNEL_DS);
-	ret = sys_rt_sigtimedwait(&s, &info, &t, sigsetsize);
+	ret = sys_rt_sigtimedwait(&s, &info, uts ? &t : NULL, sigsetsize);
 	set_fs (old_fs);
 	if (ret >= 0 && uinfo) {
 		if (copy_to_user (uinfo, siginfo64to32(&info32, &info),
@@ -3042,7 +3042,7 @@
 
 static int __init ia32_init (void)
 {
-	printk("IA32 emulation $Id: sys_ia32.c,v 1.69 2004/01/29 02:52:13 ak Exp $\n");  
+	printk("IA32 emulation $Id: sys_ia32.c,v 1.70 2004/03/03 23:36:43 ak Exp $\n");  
 	ia32_exec_domain.signal_map = default_exec_domain.signal_map;
 	ia32_exec_domain.signal_invmap = default_exec_domain.signal_invmap;
 	register_exec_domain(&ia32_exec_domain);
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/Makefile linux-2.4.26-pre6/arch/x86_64/kernel/Makefile
--- linux-2.4.26-pre5/arch/x86_64/kernel/Makefile	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/Makefile	2004-03-24 19:07:30.000000000 -0800
@@ -14,8 +14,7 @@
 
 O_TARGET := kernel.o
 
-
-export-objs     := mtrr.o msr.o cpuid.o x8664_ksyms.o pci-gart.o setup.o
+export-objs     := mtrr.o msr.o cpuid.o x8664_ksyms.o pci-gart.o setup.o swiotlb.o
 
 obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o \
 		ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
@@ -34,6 +33,7 @@
 obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o  nmi.o
 obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o mpparse.o
 obj-$(CONFIG_EARLY_PRINTK) +=  early_printk.o
+obj-$(CONFIG_SWIOTLB) += swiotlb.o
 obj-$(CONFIG_GART_IOMMU) += pci-gart.o aperture.o
 obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o
 obj-$(CONFIG_MCE) += bluesmoke.o
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/acpi.c linux-2.4.26-pre6/arch/x86_64/kernel/acpi.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/acpi.c	2004-03-24 19:07:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/acpi.c	2004-03-24 19:07:30.000000000 -0800
@@ -51,10 +51,13 @@
 int acpi_ioapic;
 int acpi_strict;
 
+acpi_interrupt_flags acpi_sci_flags __initdata;
+int acpi_sci_override_gsi __initdata;
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
 
+int acpi_ht __initdata = 1;	/* enable HT */
 
 enum acpi_irq_model_id		acpi_irq_model;
 
@@ -226,6 +229,54 @@
 	return 0;
 }
 
+/*
+ * Parse Interrupt Source Override for the ACPI SCI
+ */
+static void
+acpi_parse_sci_int_src_ovr(u8 bus_irq, u16 polarity, u16 trigger, u32 global_irq)
+{
+	if (trigger == 0)	/* compatible SCI trigger is level */
+		trigger = 3;
+
+	if (polarity == 0)	/* compatible SCI polarity is low */
+		polarity = 3;
+
+	/* Command-line over-ride via acpi_sci= */
+	if (acpi_sci_flags.trigger)
+		trigger = acpi_sci_flags.trigger;
+
+	if (acpi_sci_flags.polarity)
+		polarity = acpi_sci_flags.polarity;
+
+	mp_override_legacy_irq(bus_irq, polarity, trigger, global_irq);
+
+	/*
+	 * stash over-ride to indicate we've been here
+	 * and for later update of acpi_fadt
+	 */
+	acpi_sci_override_gsi = global_irq;
+	return;
+}
+
+static int __init
+acpi_parse_fadt(unsigned long phys, unsigned long size)
+{
+	struct fadt_descriptor_rev2 *fadt =0;
+
+	fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
+	if (!fadt) {
+		printk(KERN_WARNING PREFIX "Unable to map FADT\n");
+		return 0;
+	}
+
+#ifdef	CONFIG_ACPI_INTERPRETER
+	/* initialize sci_int early for INT_SRC_OVR MADT parsing */
+	acpi_fadt.sci_int = fadt->sci_int;
+#endif
+
+	return 0;
+}
+
 
 static int __init
 acpi_parse_int_src_ovr (
@@ -239,6 +290,13 @@
 
 	acpi_table_print_madt_entry(header);
 
+	if (intsrc->bus_irq == acpi_fadt.sci_int) {
+		acpi_parse_sci_int_src_ovr(intsrc->bus_irq,
+			intsrc->flags.polarity, intsrc->flags.trigger,
+			intsrc->global_irq);
+		return 0;
+	}
+
 	mp_override_legacy_irq (
 		intsrc->bus_irq,
 		intsrc->flags.polarity,
@@ -292,13 +350,12 @@
 
 #ifdef CONFIG_ACPI_BUS
 /*
- * "acpi_pic_sci=level" (current default)
- * programs the PIC-mode SCI to Level Trigger.
- * (NO-OP if the BIOS set Level Trigger already)
+ * acpi_pic_sci_set_trigger()
+ *
+ * use ELCR to set PIC-mode trigger type for SCI
  *
  * If a PIC-mode SCI is not recognized or gives spurious IRQ7's
- * it may require Edge Trigger -- use "acpi_pic_sci=edge"
- * (NO-OP if the BIOS set Edge Trigger already)
+ * it may require Edge Trigger -- use "acpi_sci=edge"
  *
  * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  * for the 8259 PIC.  bit[n] = 1 means irq[n] is Level, otherwise Edge.
@@ -306,52 +363,32 @@
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
  */
 
-static __initdata int	acpi_pic_sci_trigger;	/* 0: level, 1: edge */
-
 void __init
-acpi_pic_sci_set_trigger(unsigned int irq)
+acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 {
 	unsigned char mask = 1 << (irq & 7);
 	unsigned int port = 0x4d0 + (irq >> 3);
 	unsigned char val = inb(port);
 
-	
+
 	printk(PREFIX "IRQ%d SCI:", irq);
 	if (!(val & mask)) {
 		printk(" Edge");
 
-		if (!acpi_pic_sci_trigger) {
+		if (trigger == 3) {
 			printk(" set to Level");
 			outb(val | mask, port);
 		}
 	} else {
 		printk(" Level");
 
-		if (acpi_pic_sci_trigger) {
+		if (trigger == 1) {
 			printk(" set to Edge");
-			outb(val | mask, port);
+			outb(val & ~mask, port);
 		}
 	}
 	printk(" Trigger.\n");
 }
-
-int __init
-acpi_pic_sci_setup(char *str)
-{
-	while (str && *str) {
-		if (strncmp(str, "level", 5) == 0)
-			acpi_pic_sci_trigger = 0;	/* force level trigger */
-		if (strncmp(str, "edge", 4) == 0)
-			acpi_pic_sci_trigger = 1;	/* force edge trigger */
-		str = strchr(str, ',');
-		if (str)
-			str += strspn(str, ", \t");
-	}
-	return 1;
-}
-
-__setup("acpi_pic_sci=", acpi_pic_sci_setup);
-
 #endif /* CONFIG_ACPI_BUS */
 
 static unsigned long __init
@@ -412,7 +449,7 @@
 	 */
 	result = acpi_table_init();
 	if (result) {
-		acpi_disabled = 1;
+		disable_acpi();
 		return result;
 	}
 
@@ -535,6 +572,9 @@
 	/* Build a default routing table for legacy (ISA) interrupts. */
 	mp_config_acpi_legacy_irqs();
 
+	/* Record sci_int for use when looking for MADT sci_int override */
+	acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
+
 	result = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
@@ -542,6 +582,13 @@
 		return result;
 	}
 
+	/*
+	 * If BIOS did not supply an INT_SRC_OVR for the SCI
+	 * pretend we got one so we can set the SCI flags.
+	 */
+	if (!acpi_sci_override_gsi)
+		acpi_parse_sci_int_src_ovr(acpi_fadt.sci_int, 0, 0, acpi_fadt.sci_int);
+
 	result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src);
 	if (result < 0) {
 		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/aperture.c linux-2.4.26-pre6/arch/x86_64/kernel/aperture.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/aperture.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.26-pre6/arch/x86_64/kernel/aperture.c	2004-03-24 19:07:30.000000000 -0800
@@ -8,7 +8,7 @@
  * because only the bootmem allocator can allocate 32+MB. 
  * 
  * Copyright 2002 Andi Kleen, SuSE Labs.
- * $Id: aperture.c,v 1.7 2003/08/01 03:36:18 ak Exp $
+ * $Id: aperture.c,v 1.8 2004/02/27 18:30:19 ak Exp $
  */
 #include <linux/config.h>
 #include <linux/kernel.h>
@@ -27,6 +27,8 @@
 int fallback_aper_order __initdata = 1; /* 64MB */
 int fallback_aper_force __initdata = 0; 
 
+int iommu_aperture;
+
 extern int no_iommu, force_mmu;
 
 /* This code runs before the PCI subsystem is initialized, so just 
@@ -198,6 +200,8 @@
 		if (read_pci_config(0, num, 3, 0x00) != NB_ID_3) 
 			continue;	
 
+		iommu_aperture = 1;
+
 		aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7; 
 		aper_size = (32 * 1024 * 1024) << aper_order; 
 		aper_base = read_pci_config(0, num, 3, 0x94) & 0x7fff;
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/e820.c linux-2.4.26-pre6/arch/x86_64/kernel/e820.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/e820.c	2004-03-24 19:07:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/e820.c	2004-03-24 19:07:30.000000000 -0800
@@ -1,12 +1,13 @@
 /* 
  * Handle the memory map.
  * The functions here do the job until bootmem takes over.
- * $Id: e820.c,v 1.12 2004/01/13 10:13:30 ak Exp $
+ * $Id: e820.c,v 1.13 2004/03/22 00:31:08 ak Exp $
  */
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/acpi.h>
 #include <linux/bootmem.h>
 #include <linux/ioport.h>
 #include <asm/page.h>
@@ -21,6 +22,10 @@
 extern unsigned long table_start, table_end;
 extern char _end[];
 
+#ifdef	CONFIG_ACPI_BOOT
+extern acpi_interrupt_flags	acpi_sci_flags;
+#endif
+
 extern struct resource code_resource, data_resource, vram_resource;
 
 /* Check for some hardcoded bad areas that early boot is not allowed to touch */ 
@@ -541,9 +546,21 @@
 			iommu_setup(from+6); 
 		} 	
 #endif
+#ifdef	CONFIG_SMP
+		/*
+		 * If the BIOS enumerates physical processors before logical,
+		 * maxcpus=N at enumeration-time can be used to disable HT.
+		 */
+		else if (!memcmp(from, "maxcpus=", 8)) {
+			extern unsigned int max_cpus;
+
+			max_cpus = simple_strtoul(from + 8, NULL, 0);
+		}
+#endif
+
 #ifdef	CONFIG_ACPI_BOOT
  		else if (!memcmp(from, "acpi=off", 8))
-  			acpi_disabled = 1;
+  			disable_acpi();
 
 		/* acpi=strict disables out-of-spec workarounds */
 		else if (!memcmp(from, "acpi=strict", 11)) {
@@ -553,6 +570,15 @@
 		else if (!memcmp(from, "pci=noacpi", 10)) {
 			acpi_noirq_set();
 		}
+
+		else if (!memcmp(from, "acpi_sci=edge", 13))
+			acpi_sci_flags.trigger =  1;
+		else if (!memcmp(from, "acpi_sci=level", 14))
+			acpi_sci_flags.trigger = 3;
+		else if (!memcmp(from, "acpi_sci=high", 13))
+			acpi_sci_flags.polarity = 1;
+		else if (!memcmp(from, "acpi_sci=low", 12))
+			acpi_sci_flags.polarity = 3;
 #endif
 		else if (!memcmp(from,"maxcpus=0",9)) {
 			disable_ioapic_setup();
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/head.S linux-2.4.26-pre6/arch/x86_64/kernel/head.S
--- linux-2.4.26-pre5/arch/x86_64/kernel/head.S	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/head.S	2004-03-24 19:07:30.000000000 -0800
@@ -6,7 +6,7 @@
  *  Copyright (C) 2000 Karsten Keil <kkeil@suse.de>
  *  Copyright (C) 2001,2002 Andi Kleen <ak@suse.de>
  *
- *  $Id: head.S,v 1.58 2003/11/02 05:05:31 ak Exp $
+ *  $Id: head.S,v 1.59 2004/02/10 05:53:06 ak Exp $
  */
 
 
@@ -341,7 +341,7 @@
 .align 64 /* cacheline aligned, keep this synchronized with asm/desc.h */
 ENTRY(gdt_table)
 	.quad	0x0000000000000000	/* This one is magic */
-	.quad	0x00af9a000000ffff ^ (1<<21)	/* __KERNEL_COMPAT32_CS */	
+	.quad	0x008f9a000000ffff	/* __KERNEL_COMPAT32_CS */	
 	.quad	0x00af9a000000ffff	/* __KERNEL_CS */
 	.quad	0x00cf92000000ffff	/* __KERNEL_DS */
 	.quad	0x00cffe000000ffff	/* __USER32_CS */
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/mpparse.c linux-2.4.26-pre6/arch/x86_64/kernel/mpparse.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/mpparse.c	2004-03-24 19:07:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/mpparse.c	2004-03-24 19:07:30.000000000 -0800
@@ -35,6 +35,9 @@
 
 /* Have we found an MP table */
 int smp_found_config = 0;
+#ifdef	CONFIG_SMP
+extern unsigned int max_cpus;
+#endif
 
 /*
  * Various Linux-internal data structures created from the
@@ -111,6 +114,20 @@
 		Dprintk("    Bootup CPU\n");
 		boot_cpu_id = m->mpc_apicid;
 	}
+
+#ifdef	CONFIG_SMP
+	if (num_processors >= NR_CPUS) {
+		printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
+			" Processor ignored.\n", NR_CPUS);
+		return;
+	}
+	if (num_processors >= max_cpus) {
+		printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
+			" Processor ignored.\n", max_cpus);
+		return;
+	}
+#endif
+
 	num_processors++;
 
 	if (m->mpc_apicid > MAX_APICS) {
@@ -889,63 +906,6 @@
 
 extern FADT_DESCRIPTOR acpi_fadt;
 
-void __init mp_config_ioapic_for_sci(int irq)
-{
-	int ioapic;
-	int ioapic_pin;
-	struct acpi_table_madt* madt;
-	struct acpi_table_int_src_ovr *entry = NULL;
-	acpi_interrupt_flags flags;
-	void *madt_end;
-	acpi_status status;
-
-	/*
-	 * Ensure that if there is an interrupt source override entry
-	 * for the ACPI SCI, we leave it as is. Unfortunately this involves
-	 * walking the MADT again.
-	 */
-	status = acpi_get_firmware_table("APIC", 1, ACPI_LOGICAL_ADDRESSING,
-		(struct acpi_table_header **) &madt);
-	if (ACPI_SUCCESS(status)) {
-		madt_end = (void *) (unsigned long)madt + madt->header.length;
-
-		entry = (struct acpi_table_int_src_ovr *)
-                ((unsigned long) madt + sizeof(struct acpi_table_madt));
-
-		while ((void *) entry < madt_end) {
-                	if (entry->header.type == ACPI_MADT_INT_SRC_OVR &&
- 			    acpi_fadt.sci_int == entry->bus_irq)
- 				goto found;
-
-                	entry = (struct acpi_table_int_src_ovr *)
-                	        ((unsigned long) entry + entry->header.length);
-        	}
-	}
- 	/*
- 	 * Although the ACPI spec says that the SCI should be level/low
- 	 * don't reprogram it unless there is an explicit MADT OVR entry
- 	 * instructing us to do so -- otherwise we break Tyan boards which
- 	 * have the SCI wired edge/high but no MADT OVR.
- 	 */
- 	return;
-
-found:
- 	/*
- 	 * See the note at the end of ACPI 2.0b section
- 	 * 5.2.10.8 for what this is about.
- 	 */
- 	flags = entry->flags;
- 	acpi_fadt.sci_int = entry->global_irq;
- 	irq = entry->global_irq;
-
-	ioapic = mp_find_ioapic(irq);
-
-	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
-
- 	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
- 				(flags.trigger >> 1) , (flags.polarity >> 1));
-}
-
 #endif /*CONFIG_ACPI_HT_ONLY*/
 
 int acpi_tolerant;
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/mtrr.c linux-2.4.26-pre6/arch/x86_64/kernel/mtrr.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/mtrr.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/mtrr.c	2004-03-24 19:07:30.000000000 -0800
@@ -144,11 +144,14 @@
 	write_cr0(cr0);
 	wbinvd();
 
-	/* Disable MTRRs, and set the default type to uncached */
 	rdmsr(MSR_MTRRdefType, ctxt->deftype_lo, ctxt->deftype_hi);
-	wrmsr(MSR_MTRRdefType, ctxt->deftype_lo & 0xf300UL, ctxt->deftype_hi);
 }
 
+static void set_mtrr_disable(struct set_mtrr_context *ctxt) 
+{ 
+	/* Disable MTRRs, and set the default type to uncached */
+	wrmsr(MSR_MTRRdefType, ctxt->deftype_lo & 0xf300UL, ctxt->deftype_hi);
+} 
 
 /* Restore the processor after a set_mtrr_prepare */
 static void set_mtrr_done (struct set_mtrr_context *ctxt)
@@ -242,8 +245,10 @@
 	u64 base64;
 	u64 size64;
 
-	if (do_safe)
+	if (do_safe) { 
 		set_mtrr_prepare (&ctxt);
+		set_mtrr_disable (&ctxt); 
+	} 
 
 	if (size == 0) {
 		/* The invalid bit is kept in the mask, so we simply clear the
@@ -430,6 +435,7 @@
 
 
 static atomic_t undone_count;
+static volatile int wait_barrier_mtrr_disable = FALSE;
 static volatile int wait_barrier_execute = FALSE;
 static volatile int wait_barrier_cache_enable = FALSE;
 
@@ -451,8 +457,18 @@
 	set_mtrr_prepare (&ctxt);
 	/* Notify master that I've flushed and disabled my cache  */
 	atomic_dec (&undone_count);
-	while (wait_barrier_execute)
+
+	while (wait_barrier_mtrr_disable) {
+		rep_nop();
 		barrier ();
+	}	
+	set_mtrr_disable (&ctxt); 
+	/* wait again for disable confirmation*/
+	atomic_dec (&undone_count);
+	while (wait_barrier_execute) { 
+		rep_nop(); 
+		barrier(); 
+	}	
 
 	/* The master has cleared me to execute  */
 	set_mtrr_up (data->smp_reg, data->smp_base, data->smp_size,
@@ -462,8 +478,10 @@
 	atomic_dec (&undone_count);
 
 	/* Wait for master to clear me to enable cache and return  */
-	while (wait_barrier_cache_enable)
+	while (wait_barrier_cache_enable) {
+		rep_nop();
 		barrier ();
+	}	
 	set_mtrr_done (&ctxt);
 }
 
@@ -479,6 +497,7 @@
 	data.smp_type = type;
 	wait_barrier_execute = TRUE;
 	wait_barrier_cache_enable = TRUE;
+	wait_barrier_mtrr_disable = TRUE;
 	atomic_set (&undone_count, smp_num_cpus - 1);
 
 	/*  Start the ball rolling on other CPUs  */
@@ -487,10 +506,21 @@
 
 	/* Flush and disable the local CPU's cache */
 	set_mtrr_prepare (&ctxt);
+	while (atomic_read (&undone_count) > 0) { 
+		rep_nop();
+		barrier(); 
+	}
+
+	/* Set up for completion wait and then release other CPUs to change MTRRs*/
+	atomic_set (&undone_count, smp_num_cpus - 1);
+	wait_barrier_mtrr_disable = FALSE;
+	set_mtrr_disable (&ctxt);
 
 	/*  Wait for all other CPUs to flush and disable their caches  */
-	while (atomic_read (&undone_count) > 0)
+	while (atomic_read (&undone_count) > 0) { 
+		rep_nop ();
 		barrier ();
+	}	
 
 	/* Set up for completion wait and then release other CPUs to change MTRRs */
 	atomic_set (&undone_count, smp_num_cpus - 1);
@@ -498,8 +528,10 @@
 	set_mtrr_up (reg, base, size, type, FALSE);
 
 	/*  Now wait for other CPUs to complete the function  */
-	while (atomic_read (&undone_count) > 0)
+	while (atomic_read (&undone_count) > 0) {
+		rep_nop();
 		barrier ();
+	} 	
 
 	/*  Now all CPUs should have finished the function. Release the barrier to
 	   allow them to re-enable their caches and return from their interrupt,
@@ -1282,6 +1314,7 @@
 	   for this CPU while the MTRRs are changed, but changing this requires
 	   more invasive changes to the way the kernel boots  */
 	set_mtrr_prepare (&ctxt);
+	set_mtrr_disable (&ctxt);
 	mask = set_mtrr_state (&smp_mtrr_state, &ctxt);
 	set_mtrr_done (&ctxt);
 
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/nmi.c linux-2.4.26-pre6/arch/x86_64/kernel/nmi.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/nmi.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/nmi.c	2004-03-24 19:07:30.000000000 -0800
@@ -34,6 +34,13 @@
 
 int nmi_watchdog_disabled; 
 
+/* Small problem with theaw events is that they stop ticking
+   when the CPU is idling. This means you get varying NMI watchdog
+   frequencies depending on the CPU load.
+
+   I doubt it can be fixed because it's unlikely that the CPU does 
+   performance counters while being in C* states. -AK */
+
 #define K7_EVNTSEL_ENABLE	(1 << 22)
 #define K7_EVNTSEL_INT		(1 << 20)
 #define K7_EVNTSEL_OS		(1 << 17)
@@ -215,6 +222,11 @@
 {
 	unsigned int evntsel;
 
+#if 0
+	/* No check, so can start with slow frequency */
+	nmi_hz = 1; 
+#endif	
+
 	nmi_perfctr_msr = MSR_K7_PERFCTR0;
 
 	clear_msr_range(MSR_K7_EVNTSEL0, 4);
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/pci-gart.c linux-2.4.26-pre6/arch/x86_64/kernel/pci-gart.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/pci-gart.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/pci-gart.c	2004-03-24 19:07:30.000000000 -0800
@@ -8,7 +8,7 @@
  * See Documentation/DMA-mapping.txt for the interface specification.
  * 
  * Copyright 2002 Andi Kleen, SuSE Labs.
- * $Id: pci-gart.c,v 1.30 2004/01/13 09:09:32 ak Exp $
+ * $Id: pci-gart.c,v 1.32 2004/02/27 18:30:19 ak Exp $
  */
 
 #include <linux/config.h>
@@ -220,7 +220,7 @@
 	unsigned long iommu_page;
 
 	size = round_up(size, PAGE_SIZE); 
-	if (bus >= iommu_bus_base && bus <= iommu_bus_base + iommu_size) { 
+	if (bus >= iommu_bus_base && bus < iommu_bus_base + iommu_size) { 
 		unsigned pages = size >> PAGE_SHIFT;
 		iommu_page = (bus - iommu_bus_base) >> PAGE_SHIFT;
 		vaddr = __va(GPTE_DECODE(iommu_gatt_base[iommu_page]));
@@ -310,6 +310,12 @@
 
 	BUG_ON(dir == PCI_DMA_NONE);
 
+#ifdef CONFIG_SWIOTLB
+       if (swiotlb)
+               return swiotlb_map_single(dev,addr,size,dir);
+#endif
+
+
 	phys_mem = virt_to_phys(addr); 
 	if (!need_iommu(dev, phys_mem, size))
 		return phys_mem; 
@@ -352,8 +358,17 @@
 {
 	unsigned long iommu_page; 
 	int npages;
+
+#ifdef CONFIG_SWIOTLB
+       if (swiotlb) {
+               swiotlb_unmap_single(hwdev,dma_addr,size,direction);
+              return;
+       }
+#endif
+
+
 	if (dma_addr < iommu_bus_base + EMERGENCY_PAGES*PAGE_SIZE || 
-	    dma_addr > iommu_bus_base + iommu_size)
+	    dma_addr >= iommu_bus_base + iommu_size)
 		return;
 	iommu_page = (dma_addr - iommu_bus_base)>>PAGE_SHIFT;	
 	npages = round_up(size + (dma_addr & ~PAGE_MASK), PAGE_SIZE) >> PAGE_SHIFT;
@@ -488,7 +503,14 @@
 	no_agp = no_agp || (agp_init() < 0) || (agp_copy_info(&info) < 0); 
 #endif	
 
-	if (no_iommu || (!force_mmu && end_pfn < 0xffffffff>>PAGE_SHIFT)) { 
+	if (swiotlb) { 
+		no_iommu = 1;
+		printk(KERN_INFO "PCI-DMA: Using SWIOTLB\n"); 
+		return; 
+	} 
+
+
+	if (no_iommu || (!force_mmu && end_pfn < 0xffffffff>>PAGE_SHIFT) || !iommu_aperture) { 
 		printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n"); 
 		no_iommu = 1;
 		return;
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/pci-pc.c linux-2.4.26-pre6/arch/x86_64/kernel/pci-pc.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/pci-pc.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/pci-pc.c	2004-03-24 19:07:30.000000000 -0800
@@ -645,6 +645,9 @@
 	} else if (!strncmp(str, "lastbus=", 8)) {
 		pcibios_last_bus = simple_strtol(str+8, NULL, 0);
 		return NULL;
+	} else if (!strncmp(str, "noacpi", 6)) {
+		acpi_noirq_set();
+		return NULL;
 	}
 	return str;
 }
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/process.c linux-2.4.26-pre6/arch/x86_64/kernel/process.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/process.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/process.c	2004-03-24 19:07:30.000000000 -0800
@@ -9,7 +9,7 @@
  *  X86-64 port
  *	Andi Kleen.
  * 
- *  $Id: process.c,v 1.75 2004/01/13 09:04:32 ak Exp $
+ *  $Id: process.c,v 1.77 2004/03/22 00:37:29 ak Exp $
  */
 
 /*
@@ -147,11 +147,57 @@
 	}
 }
 
+/*
+ * This is a kind of hybrid between poll and halt idle routines. This uses new
+ * Monitor/Mwait instructions on P4 processors with PNI. We Monitor 
+ * need_resched and go to optimized wait state through Mwait. 
+ * Whenever someone changes need_resched, we would be woken up from Mwait 
+ * (without an IPI).
+ */
+static void mwait_idle (void)
+{
+	int oldval;
+
+	__sti();
+	/* Setting need_resched to -1 skips sending IPI during idle resched */
+	oldval = xchg(&current->need_resched, -1);
+	if (!oldval) {
+		do {
+			__monitor((void *)&current->need_resched, 0, 0);
+			if (current->need_resched != -1)
+				break;
+			__mwait(0, 0);
+		} while (current->need_resched == -1);
+	}
+}
+
+int __init select_idle_routine(struct cpuinfo_x86 *c)
+{
+	if (cpu_has(c, X86_FEATURE_MWAIT)) {
+		printk("Monitor/Mwait feature present.\n");
+		/*
+		 * Take care of system with asymmetric CPUs.
+		 * Use, mwait_idle only if all cpus support it.
+		 * If not, we fallback to default_idle()
+		 */
+		if (!pm_idle) {
+			pm_idle = mwait_idle;
+		}
+		return 1;
+	}
+	pm_idle = default_idle;
+	return 1;
+}
+
+
 static int __init idle_setup (char *str)
 {
 	if (!strncmp(str, "poll", 4)) {
 		printk("using polling idle threads.\n");
 		pm_idle = poll_idle;
+	} else if (!strncmp(str, "halt", 4)) {
+		printk("using halt in idle threads.\n");
+                pm_idle = default_idle;
 	}
 
 	return 1;
@@ -301,7 +347,7 @@
 			/* force cold reboot to reinit all hardware*/
 			*((unsigned short *)__va(0x472)) = 0;
 
-		__asm__ __volatile__("lidt %0": :"m" (no_idt));
+			__asm__ __volatile__("lidt (%0)": :"r" (no_idt));
 		__asm__ __volatile__("int3");
 
 			reboot_type = BOOT_KBD;
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/setup.c linux-2.4.26-pre6/arch/x86_64/kernel/setup.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/setup.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/setup.c	2004-03-24 19:07:30.000000000 -0800
@@ -54,6 +54,10 @@
 #endif
 
 
+int swiotlb;
+
+extern	int phys_proc_id[NR_CPUS];
+
 /*
  * Machine setup..
  */
@@ -228,6 +232,8 @@
 
 	e820_end_of_ram();
 
+	check_efer();
+
 	init_memory_mapping(); 
 
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -308,8 +314,7 @@
 	/*
 	 * Parse the ACPI tables for possible boot-time SMP configuration.
 	 */
-	if (!acpi_disabled)
-		acpi_boot_init();
+	acpi_boot_init();
 #endif
 #ifdef CONFIG_X86_LOCAL_APIC
 	/*
@@ -341,6 +346,12 @@
 #ifdef CONFIG_GART_IOMMU
 	iommu_hole_init();
 #endif
+#ifdef CONFIG_SWIOTLB
+       if (!iommu_aperture && end_pfn >= 0xffffffff>>PAGE_SHIFT) { 
+              swiotlb_init();
+              swiotlb = 1;
+       }
+#endif
 
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
@@ -404,6 +415,198 @@
 	}
 }
 
+#define LVL_1_INST      1
+#define LVL_1_DATA      2
+#define LVL_2           3
+#define LVL_3           4
+#define LVL_TRACE       5
+
+struct _cache_table
+{
+        unsigned char descriptor;
+        char cache_type;
+        short size;
+};
+
+/* all the cache descriptor types we care about (no TLB or trace cache entries) */
+static struct _cache_table cache_table[] __initdata =
+{
+	{ 0x06, LVL_1_INST, 8 },
+	{ 0x08, LVL_1_INST, 16 },
+	{ 0x0A, LVL_1_DATA, 8 },
+	{ 0x0C, LVL_1_DATA, 16 },
+	{ 0x22, LVL_3,      512 },
+	{ 0x23, LVL_3,      1024 },
+	{ 0x25, LVL_3,      2048 },
+	{ 0x29, LVL_3,      4096 },
+	{ 0x39, LVL_2,      128 },
+	{ 0x3C, LVL_2,      256 },
+	{ 0x41, LVL_2,      128 },
+	{ 0x42, LVL_2,      256 },
+	{ 0x43, LVL_2,      512 },
+	{ 0x44, LVL_2,      1024 },
+	{ 0x45, LVL_2,      2048 },
+	{ 0x66, LVL_1_DATA, 8 },
+	{ 0x67, LVL_1_DATA, 16 },
+	{ 0x68, LVL_1_DATA, 32 },
+	{ 0x70, LVL_TRACE,  12 },
+	{ 0x71, LVL_TRACE,  16 },
+	{ 0x72, LVL_TRACE,  32 },
+	{ 0x79, LVL_2,      128 },
+	{ 0x7A, LVL_2,      256 },
+	{ 0x7B, LVL_2,      512 },
+	{ 0x7C, LVL_2,      1024 },
+	{ 0x82, LVL_2,      256 },
+	{ 0x83, LVL_2,      512 },
+	{ 0x84, LVL_2,      1024 },
+	{ 0x85, LVL_2,      2048 },
+	{ 0x00, 0, 0}
+};
+
+int select_idle_routine(struct cpuinfo_x86 *c);
+
+static void __init init_intel(struct cpuinfo_x86 *c)
+{
+	unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
+	char *p = NULL;
+	u32 eax, dummy;
+
+	unsigned int n;
+
+
+	select_idle_routine(c);
+	if (c->cpuid_level > 1) {
+		/* supports eax=2  call */
+		int i, j, n;
+		int regs[4];
+		unsigned char *dp = (unsigned char *)regs;
+
+		/* Number of times to iterate */
+		n = cpuid_eax(2) & 0xFF;
+
+		for ( i = 0 ; i < n ; i++ ) {
+			cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]);
+			
+			/* If bit 31 is set, this is an unknown format */
+			for ( j = 0 ; j < 3 ; j++ ) {
+				if ( regs[j] < 0 ) regs[j] = 0;
+			}
+
+			/* Byte 0 is level count, not a descriptor */
+			for ( j = 1 ; j < 16 ; j++ ) {
+				unsigned char des = dp[j];
+				unsigned char k = 0;
+
+				/* look up this descriptor in the table */
+				while (cache_table[k].descriptor != 0)
+				{
+					if (cache_table[k].descriptor == des) {
+						switch (cache_table[k].cache_type) {
+						case LVL_1_INST:
+							l1i += cache_table[k].size;
+							break;
+						case LVL_1_DATA:
+							l1d += cache_table[k].size;
+							break;
+						case LVL_2:
+							l2 += cache_table[k].size;
+							break;
+						case LVL_3:
+							l3 += cache_table[k].size;
+							break;
+						case LVL_TRACE:
+							trace += cache_table[k].size;
+							break;
+						}
+						break;
+					}
+
+					k++;
+				}
+			}
+		}
+
+		if ( trace )
+			printk (KERN_INFO "CPU: Trace cache: %dK uops", trace);
+		else if ( l1i )
+			printk (KERN_INFO "CPU: L1 I cache: %dK", l1i);
+		if ( l1d )
+			printk(", L1 D cache: %dK\n", l1d);
+		else 
+			printk("\n");
+		if ( l2 )
+			printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
+		if ( l3 )
+			printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
+
+		/*
+		 * This assumes the L3 cache is shared; it typically lives in
+		 * the northbridge.  The L1 caches are included by the L2
+		 * cache, and so should not be included for the purpose of
+		 * SMP switching weights.
+		 */
+		c->x86_cache_size = l2 ? l2 : (l1i+l1d);
+	}
+
+	if ( p )
+		strcpy(c->x86_model_id, p);
+	
+#ifdef CONFIG_SMP
+	if (test_bit(X86_FEATURE_HT, &c->x86_capability)) {		
+		int 	index_lsb, index_msb, tmp;
+		int	initial_apic_id;
+		int 	cpu = smp_processor_id();
+		u32 	ebx, ecx, edx;
+
+		cpuid(1, &eax, &ebx, &ecx, &edx);
+		smp_num_siblings = (ebx & 0xff0000) >> 16;
+
+		if (smp_num_siblings == 1) {
+			printk(KERN_INFO  "CPU: Hyper-Threading is disabled\n");
+		} else if (smp_num_siblings > 1 ) {
+			index_lsb = 0;
+			index_msb = 31;
+			/*
+			 * At this point we only support two siblings per
+			 * processor package.
+			 */
+#define NR_SIBLINGS	2
+			if (smp_num_siblings != NR_SIBLINGS) {
+				printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings);
+				smp_num_siblings = 1;
+				return;
+			}
+			tmp = smp_num_siblings;
+			while ((tmp & 1) == 0) {
+				tmp >>=1 ;
+				index_lsb++;
+			}
+			tmp = smp_num_siblings;
+			while ((tmp & 0x80000000 ) == 0) {
+				tmp <<=1 ;
+				index_msb--;
+			}
+			if (index_lsb != index_msb )
+				index_msb++;
+			initial_apic_id = ebx >> 24 & 0xff;
+			phys_proc_id[cpu] = initial_apic_id >> index_msb;
+
+			printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
+                               phys_proc_id[cpu]);
+		}
+
+	}
+#endif
+
+	n = cpuid_eax(0x80000000);
+	if (n >= 0x80000008) {
+		cpuid(0x80000008, &eax, &dummy, &dummy, &dummy); 
+		c->x86_virt_bits = (eax >> 8) & 0xff;
+		c->x86_phys_bits = eax & 0xff;
+	}
+	
+}
+
 static int __init init_amd(struct cpuinfo_x86 *c)
 {
 	int r;
@@ -433,6 +636,8 @@
 
 	if (!strcmp(v, "AuthenticAMD"))
 		c->x86_vendor = X86_VENDOR_AMD;
+	else if (!strcmp(v, "GenuineIntel"))
+		c->x86_vendor = X86_VENDOR_INTEL;
 	else
 		c->x86_vendor = X86_VENDOR_UNKNOWN;
 }
@@ -448,7 +653,7 @@
  */
 void __init identify_cpu(struct cpuinfo_x86 *c)
 {
-	int junk, i;
+	int i;
 	u32 xlvl, tfms;
 
 	c->loops_per_jiffy = loops_per_jiffy;
@@ -472,7 +677,7 @@
 	/* Intel-defined flags: level 0x00000001 */
 	if ( c->cpuid_level >= 0x00000001 ) {	
 		__u32 misc;
-		cpuid(0x00000001, &tfms, &misc, &junk,
+		cpuid(0x00000001, &tfms, &misc, &c->x86_capability[4],
 		      &c->x86_capability[0]);
 		c->x86 = (tfms >> 8) & 15;
 		c->x86_model = (tfms >> 4) & 15;
@@ -521,9 +726,12 @@
 			init_amd(c);
 			break;
 
+		case X86_VENDOR_INTEL:
+			init_intel(c);
+			break;
 		case X86_VENDOR_UNKNOWN:
 		default:
-			/* Not much we can do here... */
+			display_cacheinfo(c);
 			break;
 	}
 
@@ -581,7 +789,7 @@
 	        "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
 	        "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
 	        "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
-	        "fxsr", "sse", "sse2", "ss", NULL, "tm", "ia64", NULL,
+	        "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe",
 
 		/* AMD-defined */
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -600,6 +808,12 @@
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+
+		/* Intel Defined (cpuid 1 and ecx) */
+		"pni", NULL, NULL, "monitor", "ds-cpl", NULL, NULL, "est",
+		"tm2", NULL, "cid", NULL, NULL, "cmpxchg16b", NULL, NULL,
+		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	};
 	static char *x86_power_flags[] = { 
 		"ts",	/* temperature sensor */
@@ -636,6 +850,11 @@
 
 	seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 	
+#ifdef CONFIG_SMP
+	seq_printf(m, "physical id\t: %d\n",phys_proc_id[c - cpu_data]);
+	seq_printf(m, "siblings\t: %d\n",smp_num_siblings);
+#endif
+
 	seq_printf(m,
 	        "fpu\t\t: yes\n"
 	        "fpu_exception\t: yes\n"
@@ -660,6 +879,7 @@
 		seq_printf(m, "TLB size\t: %d 4K pages\n", c->x86_tlbsize);
 	seq_printf(m, "clflush size\t: %d\n", c->x86_clflush_size);
 
+	if (c->x86_phys_bits > 0) 
 	seq_printf(m, "address sizes\t: %u bits physical, %u bits virtual\n", 
 		   c->x86_phys_bits, c->x86_virt_bits);
 
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/setup64.c linux-2.4.26-pre6/arch/x86_64/kernel/setup64.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/setup64.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/setup64.c	2004-03-24 19:07:30.000000000 -0800
@@ -3,7 +3,7 @@
  * Copyright (C) 1995  Linus Torvalds
  * Copyright 2001, 2002 SuSE Labs / Andi Kleen.
  * See setup.c for older changelog.
- * $Id: setup64.c,v 1.26 2003/10/15 01:32:42 ak Exp $
+ * $Id: setup64.c,v 1.27 2004/02/27 18:30:19 ak Exp $
  */ 
 #include <linux/config.h>
 #include <linux/init.h>
@@ -160,6 +160,17 @@
 
 char boot_exception_stacks[N_EXCEPTION_STACKS*EXCEPTION_STKSZ];
 
+void check_efer(void)
+{
+	unsigned long efer;
+	rdmsrl(MSR_EFER, efer); 
+	if (!(efer & EFER_NX) || do_not_nx) { 
+		__supported_pte_mask &= ~_PAGE_NX; 
+	} else { 
+		__supported_pte_mask |= _PAGE_NX; 
+	} 
+}
+
 /*
  * cpu_init() initializes state that is per-CPU. Some data is already
  * initialized (naturally) in the bootstrap process, such as the GDT
@@ -175,7 +186,7 @@
 	int nr = smp_processor_id();
 #endif
 	struct tss_struct * t = &init_tss[nr];
-	unsigned long v, efer; 	
+	unsigned long v; 	
 	unsigned long estack;
 
 	/* CPU 0 is initialised in head64.c */
@@ -202,12 +213,7 @@
 
 	syscall_init();
 
-		rdmsrl(MSR_EFER, efer); 
-	if (!(efer & EFER_NX) || do_not_nx) { 
-			__supported_pte_mask &= ~_PAGE_NX; 
-	} else { 
-		__supported_pte_mask |= _PAGE_NX; 
-		} 
+	check_efer();
 
 	t->io_map_base = INVALID_IO_BITMAP_OFFSET;	
 	memset(t->io_bitmap, 0xff, sizeof(t->io_bitmap));
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/smpboot.c linux-2.4.26-pre6/arch/x86_64/kernel/smpboot.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/smpboot.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/smpboot.c	2004-03-24 19:07:30.000000000 -0800
@@ -53,13 +53,18 @@
 #include <asm/acpi.h>
 
 /* Setup configured maximum number of CPUs to activate */
-static int max_cpus = -1;
+unsigned int max_cpus = NR_CPUS;
 
 static int cpu_mask = -1; 
 
 /* Total count of live CPUs */
 int smp_num_cpus = 1;
 
+/* Number of siblings per CPU package */
+int smp_num_siblings = 1;
+int __initdata phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */
+int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+
 /* Bitmask of currently online CPUs */
 unsigned long cpu_online_map;
 
@@ -84,10 +89,6 @@
  *
  * Command-line option of "nosmp" or "maxcpus=0" will disable SMP
  * activation entirely (the MPS table probe still happens, though).
- *
- * Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
- * greater than 0, limits the maximum number of CPUs activated in
- * SMP mode to <NUM>.
  */
 
 static int __init nosmp(char *str)
@@ -98,15 +99,6 @@
 
 __setup("nosmp", nosmp);
 
-static int __init maxcpus(char *str)
-{
-	get_option(&str, &max_cpus);
-	return 1;
-}
-
-__setup("maxcpus=", maxcpus);
-
-
 static int __init cpumask(char *str)
 {
 	get_option(&str, &cpu_mask);
@@ -936,8 +928,6 @@
 			continue;
 		if (((1<<apicid) & cpu_mask) == 0) 
 			continue;
-		if ((max_cpus >= 0) && (max_cpus <= cpucount+1))
-			continue;
 
 		cpu = do_boot_cpu(apicid);
 
@@ -992,6 +982,34 @@
 	Dprintk("Boot done.\n");
 
 	/*
+	 * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
+	 * that we can tell the sibling CPU efficiently.
+	 */
+	if (test_bit(X86_FEATURE_HT, boot_cpu_data.x86_capability)
+	    && smp_num_siblings > 1) {
+		for (cpu = 0; cpu < NR_CPUS; cpu++)
+			cpu_sibling_map[cpu] = NO_PROC_ID;
+		
+		for (cpu = 0; cpu < smp_num_cpus; cpu++) {
+			int 	i;
+			
+			for (i = 0; i < smp_num_cpus; i++) {
+				if (i == cpu)
+					continue;
+				if (phys_proc_id[cpu] == phys_proc_id[i]) {
+					cpu_sibling_map[cpu] = i;
+					printk("cpu_sibling_map[%d] = %d\n", cpu, cpu_sibling_map[cpu]);
+					break;
+				}
+			}
+			if (cpu_sibling_map[cpu] == NO_PROC_ID) {
+				smp_num_siblings = 1;
+				printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
+			}
+		}
+	}
+	     
+	/*
 	 * Here we can be sure that there is an IO-APIC in the system. Let's
 	 * go and set it up:
 	 */
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/swiotlb.c linux-2.4.26-pre6/arch/x86_64/kernel/swiotlb.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/swiotlb.c	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/swiotlb.c	2004-03-24 19:07:30.000000000 -0800
@@ -0,0 +1 @@
+#include "../../ia64/lib/swiotlb.c"
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/traps.c linux-2.4.26-pre6/arch/x86_64/kernel/traps.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/traps.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/traps.c	2004-03-24 19:07:30.000000000 -0800
@@ -7,7 +7,7 @@
  *  Pentium III FXSR, SSE support
  *	Gareth Hughes <gareth@valinux.com>, May 2000
  *
- *  $Id: traps.c,v 1.69 2003/09/21 04:54:09 ak Exp $
+ *  $Id: traps.c,v 1.71 2004/02/27 22:07:36 ak Exp $
  */
 
 /*
diff -urN linux-2.4.26-pre5/arch/x86_64/kernel/x8664_ksyms.c linux-2.4.26-pre6/arch/x86_64/kernel/x8664_ksyms.c
--- linux-2.4.26-pre5/arch/x86_64/kernel/x8664_ksyms.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/kernel/x8664_ksyms.c	2004-03-24 19:07:31.000000000 -0800
@@ -15,6 +15,7 @@
 #include <linux/string.h>
 #include <linux/nmi.h>
 
+#include <asm/ioctl32.h>
 #include <asm/semaphore.h>
 #include <asm/processor.h>
 #include <asm/i387.h>
@@ -53,6 +54,7 @@
 EXPORT_SYMBOL(kernel_thread);
 EXPORT_SYMBOL(pm_idle);
 EXPORT_SYMBOL(pm_power_off);
+EXPORT_SYMBOL(sys_ioctl);
 
 #ifdef CONFIG_IO_DEBUG
 EXPORT_SYMBOL(__io_virt_debug);
diff -urN linux-2.4.26-pre5/arch/x86_64/lib/copy_page.S linux-2.4.26-pre6/arch/x86_64/lib/copy_page.S
--- linux-2.4.26-pre5/arch/x86_64/lib/copy_page.S	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/lib/copy_page.S	2004-03-24 19:07:31.000000000 -0800
@@ -1,5 +1,7 @@
 /* Written 2003 by Andi Kleen, based on a kernel by Evandro Menezes */
 	
+#include <linux/config.h>
+
 /* Don't use streaming store because it's better when the target
    ends up in cache. */
 	    
@@ -8,10 +10,13 @@
 	.globl copy_page
 	.p2align 4
 copy_page:
-	prefetch (%rsi) 
-	prefetch 1*64(%rsi)
+
+    prefetcht0 (%rsi) 
+    prefetcht0 1*64(%rsi)
+#ifdef CONFIG_MK8	
 	prefetchw (%rdi) 
 	prefetchw 1*64(%rdi) 
+#endif	
 
 	subq	$3*8,%rsp
 	movq	%rbx,(%rsp)
@@ -32,7 +37,7 @@
 	movq     48 (%rsi), %r11
 	movq     56 (%rsi), %r12
 
-	prefetch 5*64(%rsi)
+	prefetcht0 5*64(%rsi)
 
 	movq     %rax,    (%rdi)
 	movq     %rbx,  8 (%rdi)
@@ -43,7 +48,9 @@
 	movq     %r11, 48 (%rdi)
 	movq     %r12, 56 (%rdi)
 
+#ifdef CONFIG_MK8
 	prefetchw 5*64(%rdi)
+#endif	
 
 	leaq    64 (%rsi), %rsi
 	leaq    64 (%rdi), %rdi
diff -urN linux-2.4.26-pre5/arch/x86_64/lib/copy_user.S linux-2.4.26-pre6/arch/x86_64/lib/copy_user.S
--- linux-2.4.26-pre5/arch/x86_64/lib/copy_user.S	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/lib/copy_user.S	2004-03-24 19:07:31.000000000 -0800
@@ -4,6 +4,8 @@
  * Functions to copy from and to user space.		
  */		 
 
+	#include <linux/config.h>
+	
 /* #define FIX_ALIGNMENT 1 */
 
 	#include <asm/current.h>
@@ -59,8 +61,10 @@
 	.globl copy_user_generic	
 	.p2align 4
 copy_user_generic:	
-	prefetch (%rsi)
+	prefetcht0 (%rsi)
+#ifdef CONFIG_MK8
 	prefetchw (%rdi)
+#endif
 	pushq %rbx
 	xorl %eax,%eax		/*zero for the exception handler */
 
diff -urN linux-2.4.26-pre5/arch/x86_64/lib/csum-copy.S linux-2.4.26-pre6/arch/x86_64/lib/csum-copy.S
--- linux-2.4.26-pre5/arch/x86_64/lib/csum-copy.S	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/lib/csum-copy.S	2004-03-24 19:07:31.000000000 -0800
@@ -44,32 +44,9 @@
 	.previous
 	.endm
 			
-	.macro ignore L=.Lignore
-30:
-	.section __ex_table,"a"
-	.align 8
-	.quad 30b,\L
-	.previous
-	.endm
-	
-				
 	.globl csum_partial_copy_generic
 	.p2align 4
 csum_partial_copy_generic:
-	cmpl	 $2*64,%edx
-	jle	 .Lignore
-
-	ignore
-	prefetch 1*64(%rdi)
-	ignore
-	prefetch 2*64(%rdi)
-	ignore
-	prefetchw (%rsi)
-	ignore
-	prefetchw 1*64(%rsi)
-	ignore
-
-.Lignore:		
 	subq  $7*8,%rsp
 	movq  %rbx,2*8(%rsp)
 	movq  %r12,3*8(%rsp)
diff -urN linux-2.4.26-pre5/arch/x86_64/lib/csum-partial.c linux-2.4.26-pre6/arch/x86_64/lib/csum-partial.c
--- linux-2.4.26-pre5/arch/x86_64/lib/csum-partial.c	2003-06-13 07:51:32.000000000 -0700
+++ linux-2.4.26-pre6/arch/x86_64/lib/csum-partial.c	2004-03-24 19:07:31.000000000 -0800
@@ -136,11 +136,10 @@
 }
 
 /*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
+ * this routine is used for miscellaneous IP-like checksums.
  */
 unsigned short ip_compute_csum(unsigned char * buff, int len)
 {
-	return ~csum_partial(buff,len,0); 
+	return csum_fold(csum_partial(buff,len,0)); 
 }
 
diff -urN linux-2.4.26-pre5/arch/x86_64/lib/usercopy.c linux-2.4.26-pre6/arch/x86_64/lib/usercopy.c
--- linux-2.4.26-pre5/arch/x86_64/lib/usercopy.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/lib/usercopy.c	2004-03-24 19:07:31.000000000 -0800
@@ -126,3 +126,11 @@
 		s++;
 	}
 }
+
+unsigned long copy_in_user(void *to, const void *from, unsigned len)
+{
+	if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) { 
+		return copy_user_generic(to, from, len);
+	} 
+	return len;		
+}
diff -urN linux-2.4.26-pre5/arch/x86_64/mm/fault.c linux-2.4.26-pre6/arch/x86_64/mm/fault.c
--- linux-2.4.26-pre5/arch/x86_64/mm/fault.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.26-pre6/arch/x86_64/mm/fault.c	2004-03-24 19:07:31.000000000 -0800
@@ -327,7 +327,8 @@
 					regs->rsp, error_code);
 	
 		tsk->thread.cr2 = address;
-		tsk->thread.error_code = error_code;
+		/* Kernel addresses are always protection faults */
+		tsk->thread.error_code = error_code | (address >= TASK_SIZE);
 		tsk->thread.trap_no = 14;
 		info.si_signo = SIGSEGV;
 		info.si_errno = 0;
diff -urN linux-2.4.26-pre5/arch/x86_64/mm/pageattr.c linux-2.4.26-pre6/arch/x86_64/mm/pageattr.c
--- linux-2.4.26-pre5/arch/x86_64/mm/pageattr.c	2003-06-13 07:51:32.000000000 -0700
+++ linux-2.4.26-pre6/arch/x86_64/mm/pageattr.c	2004-03-24 19:07:31.000000000 -0800
@@ -52,7 +52,7 @@
 		/* is this worth it? */ 
 		int i;
 		for (i = 0; i < PAGE_SIZE; i += cpu->x86_clflush_size) 
-			asm volatile("clflush %0" :: "m" (address + i)); 
+			asm volatile("clflush (%0)" :: "r" (address + i)); 
 	} else
 		asm volatile("wbinvd":::"memory"); 
 	__flush_tlb_one(address);
diff -urN linux-2.4.26-pre5/drivers/acpi/bus.c linux-2.4.26-pre6/drivers/acpi/bus.c
--- linux-2.4.26-pre5/drivers/acpi/bus.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/drivers/acpi/bus.c	2004-03-24 19:07:31.000000000 -0800
@@ -49,9 +49,7 @@
 
 #define	PREFIX			"ACPI: "
 
-extern void __init acpi_pic_sci_set_trigger(unsigned int irq);
-
-extern int			acpi_disabled;
+extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger);
 
 FADT_DESCRIPTOR			acpi_fadt;
 struct acpi_device		*acpi_root;
@@ -1877,11 +1875,18 @@
 	}
 
 #ifdef CONFIG_X86
-        /* Ensure the SCI is set to level-triggered, active-low */
-        if (acpi_ioapic)
-         	mp_config_ioapic_for_sci(acpi_fadt.sci_int);
-	else
-		acpi_pic_sci_set_trigger(acpi_fadt.sci_int);
+	if (!acpi_ioapic) {
+		extern acpi_interrupt_flags acpi_sci_flags;
+		/* Set PIC-mode SCI trigger type */
+		acpi_pic_sci_set_trigger(acpi_fadt.sci_int, acpi_sci_flags.trigger);
+	} else {
+		extern int acpi_sci_override_gsi;
+		/*
+		 * now that acpi_fadt is initialized,
+		 * update it with result from INT_SRC_OVR parsing
+		 */
+		acpi_fadt.sci_int = acpi_sci_override_gsi;
+	}
 #endif
 
 	status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION);
@@ -2048,7 +2053,7 @@
 
 	result = acpi_bus_init();
 	if (result) {
-		acpi_disabled = 1;
+		disable_acpi();
 		return_VALUE(result);
 	}
 
@@ -2074,19 +2079,3 @@
 	return_VOID;
 }
 
-
-int __init
-acpi_setup(char *str)
-{
-	while (str && *str) {
-		if (strncmp(str, "off", 3) == 0)
-			acpi_disabled = 1;
-		str = strchr(str, ',');
-		if (str)
-			str += strspn(str, ", \t");
-	}
-	return 1;
-}
-
-
-__setup("acpi=", acpi_setup);
diff -urN linux-2.4.26-pre5/drivers/acpi/pci_irq.c linux-2.4.26-pre6/drivers/acpi/pci_irq.c
--- linux-2.4.26-pre5/drivers/acpi/pci_irq.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/drivers/acpi/pci_irq.c	2004-03-24 19:07:32.000000000 -0800
@@ -277,6 +277,10 @@
 	return_VALUE(entry->irq);
 }
 
+/*
+ * current thinking is that acpi_pci_irq_derive() adds no value
+ * and should be deleted, so warn if it actually does something.
+ */
 
 static int
 acpi_pci_irq_derive (
@@ -306,7 +310,8 @@
 		return_VALUE(0);
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derived IRQ %d\n", irq));
+	ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Derive IRQ %d for device %s from %s\n",
+		irq, pci_name(dev), pci_name(bridge)));
 
 	return_VALUE(irq);
 }
@@ -343,6 +348,13 @@
  	irq = acpi_pci_irq_lookup(0, dev->bus->number, PCI_SLOT(dev->devfn), pin);
  
 	/*
+	 * Check if the device has an IRQ,
+	 * Hotplug devices may get IRQs by scanning
+	 */
+	if (!irq && dev->irq)
+		irq = dev->irq;
+
+	/*
 	 * If no PRT entry was found, we'll try to derive an IRQ from the
 	 * device's parent bridge.
 	 */
diff -urN linux-2.4.26-pre5/drivers/acpi/processor.c linux-2.4.26-pre6/drivers/acpi/processor.c
--- linux-2.4.26-pre5/drivers/acpi/processor.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/drivers/acpi/processor.c	2004-03-24 19:07:32.000000000 -0800
@@ -69,8 +69,6 @@
 #define ACPI_PROCESSOR_MAX_THROTTLE	250	/* 25% */
 #define ACPI_PROCESSOR_MAX_DUTY_WIDTH	4
 
-const u32 POWER_OF_2[] = {1,2,4,8,16,32,64};
-
 #define ACPI_PROCESSOR_LIMIT_USER	0
 #define ACPI_PROCESSOR_LIMIT_THERMAL	1
 
@@ -1377,7 +1375,7 @@
 		return_VALUE(0);
 	}
 
-	pr->throttling.state_count = POWER_OF_2[acpi_fadt.duty_width];
+	pr->throttling.state_count = 1 << acpi_fadt.duty_width;
 
 	/*
 	 * Compute state values. Note that throttling displays a linear power/
diff -urN linux-2.4.26-pre5/drivers/acpi/toshiba_acpi.c linux-2.4.26-pre6/drivers/acpi/toshiba_acpi.c
--- linux-2.4.26-pre5/drivers/acpi/toshiba_acpi.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/drivers/acpi/toshiba_acpi.c	2004-03-24 19:07:32.000000000 -0800
@@ -33,7 +33,7 @@
  *
  */
 
-#define TOSHIBA_ACPI_VERSION	"0.17"
+#define TOSHIBA_ACPI_VERSION	"0.18"
 #define PROC_INTERFACE_VERSION	1
 
 #include <linux/kernel.h>
@@ -41,6 +41,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/proc_fs.h>
+#include <asm/uaccess.h>
 #include <linux/version.h>
 
 #include <acpi/acpi_drivers.h>
@@ -106,24 +107,6 @@
 	*word = (*word & ~mask) | (mask * value);
 }
 
-/* an sscanf that takes explicit string length */
-static int
-snscanf(const char* str, int n, const char* format, ...)
-{
-	va_list args;
-	int result;
-	char* str2 = kmalloc(n + 1, GFP_KERNEL);
-	if (str2 == 0) return 0;
-	/* NOTE: don't even _think_ about replacing this with strlcpy */
-	strncpy(str2, str, n);
-	str2[n] = 0;
-	va_start(args, format);
-	result = vsscanf(str2, format, args);
-	va_end(args);
-	kfree(str2);
-	return result;
-}
-
 /* acpi interface wrappers
  */
 
@@ -270,10 +253,26 @@
 }
 
 static int
-dispatch_write(struct file* file, const char* buffer, unsigned long count,
-	ProcItem* item)
+dispatch_write(struct file* file, const char* buffer,
+	unsigned long count, ProcItem* item)
 {
-	return item->write_func(buffer, count);
+	int result;
+	char* tmp_buffer;
+
+	/* Arg buffer points to userspace memory, which can't be accessed
+	 * directly.  Since we're making a copy, zero-terminate the
+	 * destination so that sscanf can be used on it safely.
+	 */
+	tmp_buffer = kmalloc(count + 1, GFP_KERNEL);
+	if (copy_from_user(tmp_buffer, buffer, count)) {
+		result = -EFAULT;
+	}
+	else {
+		tmp_buffer[count] = 0;
+		result = item->write_func(tmp_buffer, count);
+	}
+	kfree(tmp_buffer);
+	return result;
 }
 
 static char*
@@ -301,7 +300,7 @@
 	int value;
 	u32 hci_result;
 
-	if (snscanf(buffer, count, " brightness : %i", &value) == 1 &&
+	if (sscanf(buffer, " brightness : %i", &value) == 1 &&
 			value >= 0 && value < HCI_LCD_BRIGHTNESS_LEVELS) {
 		value = value << HCI_LCD_BRIGHTNESS_SHIFT;
 		hci_write1(HCI_LCD_BRIGHTNESS, value, &hci_result);
@@ -351,11 +350,11 @@
 	 *  NOTE: to keep scanning simple, invalid fields are ignored
 	 */
 	while (remain) {
-		if (snscanf(buffer, remain, " lcd_out : %i", &value) == 1)
+		if (sscanf(buffer, " lcd_out : %i", &value) == 1)
 			lcd_out = value & 1;
-		else if (snscanf(buffer, remain, " crt_out : %i", &value) == 1)
+		else if (sscanf(buffer, " crt_out : %i", &value) == 1)
 			crt_out = value & 1;
-		else if (snscanf(buffer, remain, " tv_out : %i", &value) == 1)
+		else if (sscanf(buffer, " tv_out : %i", &value) == 1)
 			tv_out = value & 1;
 		/* advance to one character past the next ; */
 		do {
@@ -408,7 +407,7 @@
 	int value;
 	u32 hci_result;
 
-	if (snscanf(buffer, count, " force_on : %i", &value) == 1 &&
+	if (sscanf(buffer, " force_on : %i", &value) == 1 &&
 			value >= 0 && value <= 1) {
 		hci_write1(HCI_FAN, value, &hci_result);
 		if (hci_result != HCI_SUCCESS)
@@ -459,7 +458,7 @@
 {
 	int value;
 
-	if (snscanf(buffer, count, " hotkey_ready : %i", &value) == 1 &&
+	if (sscanf(buffer, " hotkey_ready : %i", &value) == 1 &&
 			value == 0) {
 		key_event_valid = 0;
 	} else {
diff -urN linux-2.4.26-pre5/drivers/char/q40_keyb.c linux-2.4.26-pre6/drivers/char/q40_keyb.c
--- linux-2.4.26-pre5/drivers/char/q40_keyb.c	2002-11-28 15:53:12.000000000 -0800
+++ linux-2.4.26-pre6/drivers/char/q40_keyb.c	2004-03-24 19:07:33.000000000 -0800
@@ -400,7 +400,7 @@
 #define KBD_NO_DATA	(-1)	/* No data */
 #define KBD_BAD_DATA	(-2)	/* Parity or other error */
 
-static int __init kbd_read_input(void)
+static int __init q40kbd_read_input(void)
 {
 	int retval = KBD_NO_DATA;
 	unsigned char status;
@@ -421,7 +421,7 @@
 	int maxread = 100;	/* Random number */
 
 	do {
-		if (kbd_read_input() == KBD_NO_DATA)
+		if (q40kbd_read_input() == KBD_NO_DATA)
 			break;
 	} while (--maxread);
 }
diff -urN linux-2.4.26-pre5/drivers/char/sonypi.h linux-2.4.26-pre6/drivers/char/sonypi.h
--- linux-2.4.26-pre5/drivers/char/sonypi.h	2004-03-24 19:07:20.000000000 -0800
+++ linux-2.4.26-pre6/drivers/char/sonypi.h	2004-03-24 19:07:33.000000000 -0800
@@ -396,7 +396,6 @@
 }
 
 #ifdef CONFIG_ACPI
-extern int acpi_disabled;
 #define SONYPI_ACPI_ACTIVE (!acpi_disabled)
 #else
 #define SONYPI_ACPI_ACTIVE 0
diff -urN linux-2.4.26-pre5/drivers/net/wan/8253x/build linux-2.4.26-pre6/drivers/net/wan/8253x/build
--- linux-2.4.26-pre5/drivers/net/wan/8253x/build	2004-03-24 19:07:21.000000000 -0800
+++ linux-2.4.26-pre6/drivers/net/wan/8253x/build	1969-12-31 16:00:00.000000000 -0800
@@ -1,8 +0,0 @@
-cc -g  -o 8253xcfg -I. -U__KERNEL__ 8253xcfg.c
-cc -g  -o 8253xspeed -I. -U__KERNEL__ 8253xspeed.c
-cc -g  -o 8253xmode -I. -U__KERNEL__ 8253xmode.c
-cc -g  -o 8253xpeer -I. -U__KERNEL__ 8253xpeer.c
-cc -g  -o eprom9050 -I. -U__KERNEL__ eprom9050.c
-
-
-
diff -urN linux-2.4.26-pre5/drivers/pcmcia/yenta.c linux-2.4.26-pre6/drivers/pcmcia/yenta.c
--- linux-2.4.26-pre5/drivers/pcmcia/yenta.c	2004-02-18 05:36:31.000000000 -0800
+++ linux-2.4.26-pre6/drivers/pcmcia/yenta.c	2004-03-24 19:07:38.000000000 -0800
@@ -870,6 +870,13 @@
 	{ PD(TI,1420),	&ti_ops },
 	{ PD(TI,4410),	&ti_ops },
 	{ PD(TI,4451),	&ti_ops },
+	{ PD(TI,1510),  &ti_ops },
+	{ PD(TI,1520),  &ti_ops },
+
+	{ PD(ENE,1211),  &ti_ops },
+	{ PD(ENE,1225),  &ti_ops },
+	{ PD(ENE,1410),  &ti_ops },
+	{ PD(ENE,1420),  &ti_ops },
 
 	{ PD(RICOH,RL5C465), &ricoh_ops },
 	{ PD(RICOH,RL5C466), &ricoh_ops },
diff -urN linux-2.4.26-pre5/drivers/scsi/scsi_syms.c linux-2.4.26-pre6/drivers/scsi/scsi_syms.c
--- linux-2.4.26-pre5/drivers/scsi/scsi_syms.c	2002-08-02 17:39:44.000000000 -0700
+++ linux-2.4.26-pre6/drivers/scsi/scsi_syms.c	2004-03-24 19:07:39.000000000 -0800
@@ -43,6 +43,7 @@
 EXPORT_SYMBOL(scsi_do_cmd);
 EXPORT_SYMBOL(scsi_command_size);
 EXPORT_SYMBOL(scsi_ioctl);
+EXPORT_SYMBOL(scsi_finish_command);
 EXPORT_SYMBOL(print_command);
 EXPORT_SYMBOL(print_sense);
 EXPORT_SYMBOL(print_req_sense);
diff -urN linux-2.4.26-pre5/drivers/sound/.indent.pro linux-2.4.26-pre6/drivers/sound/.indent.pro
--- linux-2.4.26-pre5/drivers/sound/.indent.pro	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.4.26-pre6/drivers/sound/.indent.pro	1997-09-30 08:46:46.000000000 -0700
@@ -0,0 +1,8 @@
+-bad 
+-bap 
+-nfca
+-bl 
+-psl 
+-di16
+-lp
+-ip5
diff -urN linux-2.4.26-pre5/drivers/sound/.version linux-2.4.26-pre6/drivers/sound/.version
--- linux-2.4.26-pre5/drivers/sound/.version	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.4.26-pre6/drivers/sound/.version	1997-11-09 23:01:54.000000000 -0800
@@ -0,0 +1,2 @@
+3.8s
+0x030804
diff -urN linux-2.4.26-pre5/fs/nfs/dir.c linux-2.4.26-pre6/fs/nfs/dir.c
--- linux-2.4.26-pre5/fs/nfs/dir.c	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/fs/nfs/dir.c	2004-03-24 19:07:42.000000000 -0800
@@ -1070,6 +1070,7 @@
 
 	nfs_zap_caches(new_dir);
 	nfs_zap_caches(old_dir);
+	NFS_CACHEINV(old_inode);
 	error = NFS_PROTO(old_dir)->rename(old_dir, &old_dentry->d_name,
 					   new_dir, &new_dentry->d_name);
 out:
diff -urN linux-2.4.26-pre5/fs/nfs/file.c linux-2.4.26-pre6/fs/nfs/file.c
--- linux-2.4.26-pre5/fs/nfs/file.c	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/fs/nfs/file.c	2004-03-24 19:07:42.000000000 -0800
@@ -81,7 +81,7 @@
 	if (file->f_mode & FMODE_READ)
 		nfs_pagein_inode(inode, 0, 0);
 
-	status = nfs_wb_file(inode, file);
+	status = nfs_wb_all(inode);
 	if (!status) {
 		status = file->f_error;
 		file->f_error = 0;
@@ -136,7 +136,7 @@
 	dfprintk(VFS, "nfs: fsync(%x/%ld)\n", inode->i_dev, inode->i_ino);
 
 	lock_kernel();
-	status = nfs_wb_file(inode, file);
+	status = nfs_wb_all(inode);
 	if (!status) {
 		status = file->f_error;
 		file->f_error = 0;
diff -urN linux-2.4.26-pre5/fs/nfs/inode.c linux-2.4.26-pre6/fs/nfs/inode.c
--- linux-2.4.26-pre5/fs/nfs/inode.c	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.26-pre6/fs/nfs/inode.c	2004-03-24 19:07:42.000000000 -0800
@@ -121,7 +121,7 @@
 {
 	int flags = sync ? FLUSH_WAIT : 0;
 
-	nfs_sync_file(inode, NULL, 0, 0, flags);
+	nfs_sync_file(inode, 0, 0, flags);
 }
 
 static void
diff -urN linux-2.4.26-pre5/fs/nfs/pagelist.c linux-2.4.26-pre6/fs/nfs/pagelist.c
--- linux-2.4.26-pre5/fs/nfs/pagelist.c	2003-06-13 07:51:37.000000000 -0700
+++ linux-2.4.26-pre6/fs/nfs/pagelist.c	2004-03-24 19:07:42.000000000 -0800
@@ -364,7 +364,6 @@
  * nfs_scan_list - Scan a list for matching requests
  * @head: One of the NFS inode request lists
  * @dst: Destination list
- * @file: if set, ensure we match requests from this file
  * @idx_start: lower bound of page->index to scan
  * @npages: idx_start + npages sets the upper bound to scan.
  *
@@ -376,7 +375,6 @@
  */
 int
 nfs_scan_list(struct list_head *head, struct list_head *dst,
-	      struct file *file,
 	      unsigned long idx_start, unsigned int npages)
 {
 	struct list_head	*pos, *tmp;
@@ -395,9 +393,6 @@
 
 		req = nfs_list_entry(pos);
 
-		if (file && req->wb_file != file)
-			continue;
-
 		pg_idx = page_index(req->wb_page);
 		if (pg_idx < idx_start)
 			continue;
diff -urN linux-2.4.26-pre5/fs/nfs/read.c linux-2.4.26-pre6/fs/nfs/read.c
--- linux-2.4.26-pre5/fs/nfs/read.c	2003-06-13 07:51:37.000000000 -0700
+++ linux-2.4.26-pre6/fs/nfs/read.c	2004-03-24 19:07:42.000000000 -0800
@@ -371,7 +371,7 @@
 nfs_scan_read(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages)
 {
 	int	res;
-	res = nfs_scan_list(&inode->u.nfs_i.read, dst, NULL, idx_start, npages);
+	res = nfs_scan_list(&inode->u.nfs_i.read, dst, idx_start, npages);
 	inode->u.nfs_i.nread -= res;
 	if ((inode->u.nfs_i.nread == 0) != list_empty(&inode->u.nfs_i.read))
 		printk(KERN_ERR "NFS: desynchronized value of nfs_i.nread.\n");
diff -urN linux-2.4.26-pre5/fs/nfs/write.c linux-2.4.26-pre6/fs/nfs/write.c
--- linux-2.4.26-pre5/fs/nfs/write.c	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/fs/nfs/write.c	2004-03-24 19:07:42.000000000 -0800
@@ -445,7 +445,7 @@
  * Interruptible by signals only if mounted with intr flag.
  */
 static int
-nfs_wait_on_requests(struct inode *inode, struct file *file, unsigned long idx_start, unsigned int npages)
+nfs_wait_on_requests(struct inode *inode, unsigned long idx_start, unsigned int npages)
 {
 	struct list_head	*p, *head;
 	unsigned long		idx_end;
@@ -464,9 +464,6 @@
 		unsigned long pg_idx;
 		struct nfs_page *req = nfs_inode_wb_entry(p);
 
-		if (file && req->wb_file != file)
-			continue;
-
 		pg_idx = page_index(req->wb_page);
 		if (pg_idx < idx_start)
 			break;
@@ -538,7 +535,6 @@
  * nfs_scan_dirty - Scan an inode for dirty requests
  * @inode: NFS inode to scan
  * @dst: destination list
- * @file: if set, ensure we match requests from this file
  * @idx_start: lower bound of page->index to scan.
  * @npages: idx_start + npages sets the upper bound to scan.
  *
@@ -546,10 +542,10 @@
  * The requests are *not* checked to ensure that they form a contiguous set.
  */
 static int
-nfs_scan_dirty(struct inode *inode, struct list_head *dst, struct file *file, unsigned long idx_start, unsigned int npages)
+nfs_scan_dirty(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages)
 {
 	int	res;
-	res = nfs_scan_list(&inode->u.nfs_i.dirty, dst, file, idx_start, npages);
+	res = nfs_scan_list(&inode->u.nfs_i.dirty, dst, idx_start, npages);
 	inode->u.nfs_i.ndirty -= res;
 	if ((inode->u.nfs_i.ndirty == 0) != list_empty(&inode->u.nfs_i.dirty))
 		printk(KERN_ERR "NFS: desynchronized value of nfs_i.ndirty.\n");
@@ -577,7 +573,7 @@
 	npages = nfs_scan_lru_timeout(&server->lru_commit, dst, 1);
 	if (npages) {
 		inode = nfs_list_entry(dst->next)->wb_inode;
-		npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, NULL, 0, 0);
+		npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, 0, 0);
 		inode->u.nfs_i.ncommit -= npages;
 	}
 	return npages;
@@ -604,7 +600,7 @@
 	npages = nfs_scan_lru(&server->lru_commit, dst, 1);
 	if (npages) {
 		inode = nfs_list_entry(dst->next)->wb_inode;
-		npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, NULL, 0, 0);
+		npages += nfs_scan_list(&inode->u.nfs_i.commit, dst, 0, 0);
 		inode->u.nfs_i.ncommit -= npages;
 	}
 	return npages;
@@ -614,7 +610,6 @@
  * nfs_scan_commit - Scan an inode for commit requests
  * @inode: NFS inode to scan
  * @dst: destination list
- * @file: if set, ensure we collect requests from this file only.
  * @idx_start: lower bound of page->index to scan.
  * @npages: idx_start + npages sets the upper bound to scan.
  *
@@ -622,10 +617,10 @@
  * The requests are *not* checked to ensure that they form a contiguous set.
  */
 static int
-nfs_scan_commit(struct inode *inode, struct list_head *dst, struct file *file, unsigned long idx_start, unsigned int npages)
+nfs_scan_commit(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages)
 {
 	int	res;
-	res = nfs_scan_list(&inode->u.nfs_i.commit, dst, file, idx_start, npages);
+	res = nfs_scan_list(&inode->u.nfs_i.commit, dst, idx_start, npages);
 	inode->u.nfs_i.ncommit -= res;
 	if ((inode->u.nfs_i.ncommit == 0) != list_empty(&inode->u.nfs_i.commit))
 		printk(KERN_ERR "NFS: desynchronized value of nfs_i.ncommit.\n");
@@ -753,12 +748,12 @@
 #ifdef CONFIG_NFS_V3
 	if (NFS_PROTO(inode)->version == 2) {
 		if (dirty >= NFS_STRATEGY_PAGES * wpages)
-			nfs_flush_file(inode, NULL, 0, 0, 0);
+			nfs_flush_file(inode, 0, 0, 0);
 	} else if (dirty >= wpages)
-		nfs_flush_file(inode, NULL, 0, 0, 0);
+		nfs_flush_file(inode, 0, 0, 0);
 #else
 	if (dirty >= NFS_STRATEGY_PAGES * wpages)
-		nfs_flush_file(inode, NULL, 0, 0, 0);
+		nfs_flush_file(inode, 0, 0, 0);
 #endif
 }
 
@@ -1250,7 +1245,7 @@
 }
 #endif
 
-int nfs_flush_file(struct inode *inode, struct file *file, unsigned long idx_start,
+int nfs_flush_file(struct inode *inode, unsigned long idx_start,
 		   unsigned int npages, int how)
 {
 	LIST_HEAD(head);
@@ -1258,7 +1253,7 @@
 				error = 0;
 
 	spin_lock(&nfs_wreq_lock);
-	res = nfs_scan_dirty(inode, &head, file, idx_start, npages);
+	res = nfs_scan_dirty(inode, &head, idx_start, npages);
 	spin_unlock(&nfs_wreq_lock);
 	if (res)
 		error = nfs_flush_list(&head, NFS_SERVER(inode)->wpages, how);
@@ -1268,14 +1263,14 @@
 }
 
 #ifdef CONFIG_NFS_V3
-int nfs_commit_file(struct inode *inode, struct file *file, int how)
+int nfs_commit_file(struct inode *inode, int how)
 {
 	LIST_HEAD(head);
 	int			res,
 				error = 0;
 
 	spin_lock(&nfs_wreq_lock);
-	res = nfs_scan_commit(inode, &head, file, 0, 0);
+	res = nfs_scan_commit(inode, &head, 0, 0);
 	spin_unlock(&nfs_wreq_lock);
 	if (res)
 		error = nfs_commit_list(&head, how);
@@ -1285,7 +1280,7 @@
 }
 #endif
 
-int nfs_sync_file(struct inode *inode, struct file *file, unsigned long idx_start,
+int nfs_sync_file(struct inode *inode, unsigned long idx_start,
 		  unsigned int npages, int how)
 {
 	int	error,
@@ -1294,18 +1289,15 @@
 	wait = how & FLUSH_WAIT;
 	how &= ~FLUSH_WAIT;
 
-	if (!inode && file)
-		inode = file->f_dentry->d_inode;
-
 	do {
 		error = 0;
 		if (wait)
-			error = nfs_wait_on_requests(inode, file, idx_start, npages);
+			error = nfs_wait_on_requests(inode, idx_start, npages);
 		if (error == 0)
-			error = nfs_flush_file(inode, file, idx_start, npages, how);
+			error = nfs_flush_file(inode, idx_start, npages, how);
 #ifdef CONFIG_NFS_V3
 		if (error == 0)
-			error = nfs_commit_file(inode, file, how);
+			error = nfs_commit_file(inode, how);
 #endif
 	} while (error > 0);
 	return error;
diff -urN linux-2.4.26-pre5/include/acpi/acpi_bus.h linux-2.4.26-pre6/include/acpi/acpi_bus.h
--- linux-2.4.26-pre5/include/acpi/acpi_bus.h	2003-11-28 10:26:21.000000000 -0800
+++ linux-2.4.26-pre6/include/acpi/acpi_bus.h	2004-03-24 19:07:42.000000000 -0800
@@ -35,8 +35,6 @@
 
 #include <acpi/acpi.h>
 
-extern int			acpi_disabled;
-
 /* TBD: Make dynamic */
 #define ACPI_MAX_HANDLES	10
 struct acpi_handle_list {
diff -urN linux-2.4.26-pre5/include/asm-i386/acpi.h linux-2.4.26-pre6/include/asm-i386/acpi.h
--- linux-2.4.26-pre5/include/asm-i386/acpi.h	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-i386/acpi.h	2004-03-24 19:07:42.000000000 -0800
@@ -114,6 +114,9 @@
 extern int acpi_ioapic;
 extern int acpi_noirq;
 extern int acpi_strict;
+extern int acpi_disabled;
+extern int acpi_ht;
+static inline void disable_acpi(void) { acpi_disabled = 1; acpi_ht = 0; }
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
diff -urN linux-2.4.26-pre5/include/asm-i386/mpspec.h linux-2.4.26-pre6/include/asm-i386/mpspec.h
--- linux-2.4.26-pre5/include/asm-i386/mpspec.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.26-pre6/include/asm-i386/mpspec.h	2004-03-24 19:07:42.000000000 -0800
@@ -227,10 +227,7 @@
 extern void mp_register_ioapic (u8 id, u32 address, u32 irq_base);
 extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 global_irq);
 extern void mp_config_acpi_legacy_irqs (void);
-extern void mp_config_ioapic_for_sci(int irq);
 extern void mp_parse_prt (void);
-#else /*!CONFIG_X86_IO_APIC*/
-static inline void mp_config_ioapic_for_sci(int irq) { }
 #endif /*!CONFIG_X86_IO_APIC*/
 
 #endif /*CONFIG_ACPI_BOOT*/
diff -urN linux-2.4.26-pre5/include/asm-ia64/acpi.h linux-2.4.26-pre6/include/asm-ia64/acpi.h
--- linux-2.4.26-pre5/include/asm-ia64/acpi.h	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-ia64/acpi.h	2004-03-24 19:07:42.000000000 -0800
@@ -96,7 +96,9 @@
 		:"=r"(Acq):"r"(GLptr):"r2","r29","r30","memory"); \
 	} while (0)
 
+#define acpi_disabled 0	/* ACPI always enabled */
 #define acpi_strict 1	/* no ACPI workarounds */
+static inline void disable_acpi(void) { }
 
 const char *acpi_get_sysname (void);
 int acpi_request_vector (u32 int_type);
diff -urN linux-2.4.26-pre5/include/asm-m68k/keyboard.h linux-2.4.26-pre6/include/asm-m68k/keyboard.h
--- linux-2.4.26-pre5/include/asm-m68k/keyboard.h	2001-08-12 11:13:59.000000000 -0700
+++ linux-2.4.26-pre6/include/asm-m68k/keyboard.h	2004-03-24 19:07:42.000000000 -0800
@@ -65,6 +65,11 @@
 #define kbd_request_region()
 #define kbd_request_irq(handler)
 
+/* How to access the keyboard macros on this platform.  */
+#define kbd_read_input() in_8(KBD_DATA_REG)
+#define kbd_read_status() in_8(KBD_STATUS_REG)
+#define kbd_write_output(val) out_8(KBD_DATA_REG, val)
+#define kbd_write_command(val) out_8(KBD_CNTL_REG, val)
 extern unsigned int SYSRQ_KEY;
 
 #endif /* __KERNEL__ */
diff -urN linux-2.4.26-pre5/include/asm-x86_64/acpi.h linux-2.4.26-pre6/include/asm-x86_64/acpi.h
--- linux-2.4.26-pre5/include/asm-x86_64/acpi.h	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-x86_64/acpi.h	2004-03-24 19:07:42.000000000 -0800
@@ -104,6 +104,9 @@
 extern int acpi_ioapic;
 extern int acpi_noirq;
 extern int acpi_strict;
+extern int acpi_disabled;
+extern int acpi_ht;
+static inline void disable_acpi(void) { acpi_disabled = 1; acpi_ht = 0; }
 
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
@@ -138,8 +141,6 @@
 
 #define boot_cpu_physical_apicid boot_cpu_id
 
-extern void mp_config_ioapic_for_sci(int irq);
-
 #endif /*__KERNEL__*/
 
 #endif /*_ASM_ACPI_H*/
diff -urN linux-2.4.26-pre5/include/asm-x86_64/cpufeature.h linux-2.4.26-pre6/include/asm-x86_64/cpufeature.h
--- linux-2.4.26-pre5/include/asm-x86_64/cpufeature.h	2003-11-28 10:26:21.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-x86_64/cpufeature.h	2004-03-24 19:07:42.000000000 -0800
@@ -10,7 +10,7 @@
 /* Sample usage: CPU_FEATURE_P(cpu.x86_capability, FPU) */
 #define CPU_FEATURE_P(CAP, FEATURE) test_bit(CAP, X86_FEATURE_##FEATURE ##_BIT)
 
-#define NCAPINTS	4	/* Currently we have 4 32-bit words worth of info */
+#define NCAPINTS	5	/* Currently we have 5 32-bit words worth of info */
 
 /* Intel-defined CPU features, CPUID level 0x00000001, word 0 */
 #define X86_FEATURE_FPU		(0*32+ 0) /* Onboard FPU */
@@ -40,8 +40,10 @@
 #define X86_FEATURE_XMM		(0*32+25) /* Streaming SIMD Extensions */
 #define X86_FEATURE_XMM2	(0*32+26) /* Streaming SIMD Extensions-2 */
 #define X86_FEATURE_SELFSNOOP	(0*32+27) /* CPU self snoop */
+#define X86_FEATURE_HT 		(0*32+28) /* Hyper-Threading */
 #define X86_FEATURE_ACC		(0*32+29) /* Automatic clock control */
 #define X86_FEATURE_IA64	(0*32+30) /* IA-64 processor */
+#define X86_FEATURE_PBE	(0*32+31) /* Pending Break Enable */
 
 /* AMD-defined CPU features, CPUID level 0x80000001, word 1 */
 /* Don't duplicate feature flags which are redundant with Intel! */
@@ -62,6 +64,24 @@
 #define X86_FEATURE_K6_MTRR	(3*32+ 1) /* AMD K6 nonstandard MTRRs */
 #define X86_FEATURE_CYRIX_ARR	(3*32+ 2) /* Cyrix ARRs (= MTRRs) */
 #define X86_FEATURE_CENTAUR_MCR	(3*32+ 3) /* Centaur MCRs (= MTRRs) */
+/* cpu types for specific tunings: */
+#define X86_FEATURE_K8          (3*32+ 4) /* Opteron, Athlon64 */
+#define X86_FEATURE_K7          (3*32+ 5) /* Athlon */
+#define X86_FEATURE_P3          (3*32+ 6) /* P3 */
+#define X86_FEATURE_P4          (3*32+ 7) /* P4 */
+
+
+/* Intel-defined CPU features, CPUID level 0x00000001, ecx, word 4 */
+#define X86_FEATURE_PNI		(4*32+ 0) /* Streaming SIMD Extensions 3 */
+#define X86_FEATURE_MWAIT	(4*32+ 3) /* Monitor-Mwait Support */
+#define X86_FEATURE_DS_CPL	(4*32+ 4) /* CPL qualified debug store */
+#define X86_FEATURE_EST	(4*32+ 7) /* Enhanced SpeedStep */
+#define X86_FEATURE_TM2	(4*32+ 8) /* Thermal monitor 2 */
+#define X86_FEATURE_CNXT_ID	(4*32+ 10) /* L1 Context ID */
+
+#define boot_cpu_has(bit)  test_bit(bit, boot_cpu_data.x86_capability)
+#define cpu_has(c, bit)            test_bit(bit, (c)->x86_capability)
+
 
 #define cpu_has(c, bit)                test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)      test_bit(bit, boot_cpu_data.x86_capability)
@@ -75,7 +95,7 @@
 #define cpu_has_fxsr 1
 #define cpu_has_xmm 1
 #define cpu_has_apic 		boot_cpu_has(X86_FEATURE_APIC)
-#define cpu_has_ht 0 
+#define cpu_has_ht 		boot_cpu_has(X86_FEATURE_HT) 
 #define cpu_has_mp             boot_cpu_has(X86_FEATURE_MP)
 #define cpu_has_k6_mtrr 0
 #define cpu_has_cyrix_arr 0
diff -urN linux-2.4.26-pre5/include/asm-x86_64/mpspec.h linux-2.4.26-pre6/include/asm-x86_64/mpspec.h
--- linux-2.4.26-pre5/include/asm-x86_64/mpspec.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.26-pre6/include/asm-x86_64/mpspec.h	2004-03-24 19:07:42.000000000 -0800
@@ -196,7 +196,6 @@
 extern void mp_register_ioapic (u8 id, u32 address, u32 irq_base);
 extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 global_irq);
 extern void mp_config_acpi_legacy_irqs (void);
-extern void mp_config_ioapic_for_sci(int irq);
 extern void mp_parse_prt (void);
 #endif /*CONFIG_X86_IO_APIC*/
 
diff -urN linux-2.4.26-pre5/include/asm-x86_64/pci-direct.h linux-2.4.26-pre6/include/asm-x86_64/pci-direct.h
--- linux-2.4.26-pre5/include/asm-x86_64/pci-direct.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.26-pre6/include/asm-x86_64/pci-direct.h	2004-03-24 19:07:42.000000000 -0800
@@ -28,7 +28,7 @@
 	return v;
 }
 
-static inline u8 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset)
+static inline u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset)
 {
 	u16 v; 
 	outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
diff -urN linux-2.4.26-pre5/include/asm-x86_64/pci.h linux-2.4.26-pre6/include/asm-x86_64/pci.h
--- linux-2.4.26-pre5/include/asm-x86_64/pci.h	2003-11-28 10:26:21.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-x86_64/pci.h	2004-03-24 19:07:42.000000000 -0800
@@ -65,6 +65,18 @@
 extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
 				void *vaddr, dma_addr_t dma_handle);
 
+#ifdef CONFIG_SWIOTLB
+extern int swiotlb; 
+extern dma_addr_t swiotlb_map_single (struct pci_dev *hwdev, void *ptr, size_t size, 
+                                     int dir);
+extern void swiotlb_unmap_single (struct pci_dev *hwdev, dma_addr_t dev_addr,
+                                 size_t size, int dir);
+extern void swiotlb_sync_single (struct pci_dev *hwdev, dma_addr_t dev_addr, 
+                                size_t size, int dir);
+extern void swiotlb_sync_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, 
+                            int dir);
+#endif
+
 #ifdef CONFIG_GART_IOMMU
 
 /* Map a single buffer of the indicated size for DMA in streaming mode.
@@ -105,6 +117,10 @@
 				       dma_addr_t dma_handle,
 				       size_t size, int direction)
 {
+#ifdef CONFIG_SWIOTLB
+       if (swiotlb)
+               return swiotlb_sync_single(hwdev,dma_handle,size,direction);
+#endif
 	BUG_ON(direction == PCI_DMA_NONE); 
 } 
 
@@ -113,6 +129,10 @@
 				   int nelems, int direction)
 { 
 	BUG_ON(direction == PCI_DMA_NONE); 
+#ifdef CONFIG_SWIOTLB
+       if (swiotlb)
+               return swiotlb_sync_sg(hwdev,sg,nelems,direction);
+#endif
 } 
 
 /* The PCI address space does equal the physical memory
diff -urN linux-2.4.26-pre5/include/asm-x86_64/pgtable.h linux-2.4.26-pre6/include/asm-x86_64/pgtable.h
--- linux-2.4.26-pre5/include/asm-x86_64/pgtable.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.26-pre6/include/asm-x86_64/pgtable.h	2004-03-24 19:07:42.000000000 -0800
@@ -79,7 +79,7 @@
  * ZERO_PAGE is a global shared page that is always zero: used
  * for zero-mapped memory areas etc..
  */
-extern unsigned long empty_zero_page[1024];
+extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
 
 #endif /* !__ASSEMBLY__ */
diff -urN linux-2.4.26-pre5/include/asm-x86_64/processor.h linux-2.4.26-pre6/include/asm-x86_64/processor.h
--- linux-2.4.26-pre5/include/asm-x86_64/processor.h	2003-11-28 10:26:21.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-x86_64/processor.h	2004-03-24 19:07:42.000000000 -0800
@@ -400,13 +400,40 @@
 } 
 
 #define ARCH_HAS_PREFETCH
-#define ARCH_HAS_PREFETCHW
 #define ARCH_HAS_SPINLOCK_PREFETCH
 
-#define prefetch(x) __builtin_prefetch((x),0)
+#ifdef CONFIG_MK8
+#define ARCH_HAS_PREFETCHW
 #define prefetchw(x) __builtin_prefetch((x),1)
 #define spin_lock_prefetch(x)  prefetchw(x)
+#else
+#define spin_lock_prefetch(x)  prefetch(x)
+#endif
+
+#define prefetch(x) __builtin_prefetch((x),0)
+
 #define cpu_relax()   rep_nop()
 
 
+static __inline__ void __monitor(const void *eax, unsigned long ecx,
+               unsigned long edx)
+{
+       /* "monitor %eax,%ecx,%edx;" */
+       asm volatile(
+               ".byte 0x0f,0x01,0xc8;"
+               : :"a" (eax), "c" (ecx), "d"(edx));
+}
+
+static __inline__ void __mwait(unsigned long eax, unsigned long ecx)
+{
+       /* "mwait %eax,%ecx;" */
+       asm volatile(
+               ".byte 0x0f,0x01,0xc9;"
+               : :"a" (eax), "c" (ecx));
+}
+
+#define ARCH_HAS_SMP_BALANCE 1
+
 #endif /* __ASM_X86_64_PROCESSOR_H */
+
+
diff -urN linux-2.4.26-pre5/include/asm-x86_64/proto.h linux-2.4.26-pre6/include/asm-x86_64/proto.h
--- linux-2.4.26-pre5/include/asm-x86_64/proto.h	2003-11-28 10:26:21.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-x86_64/proto.h	2004-03-24 19:07:42.000000000 -0800
@@ -25,6 +25,8 @@
 
 extern void do_softirq_thunk(void);
 
+extern void swiotlb_init(void);
+
 extern int setup_early_printk(char *); 
 extern void early_printk(const char *fmt, ...) __attribute__((format(printf,1,2)));
 
@@ -36,7 +38,10 @@
 extern void reserve_bootmem_generic(unsigned long phys, unsigned len);
 extern void free_bootmem_generic(unsigned long phys, unsigned len);
 
+extern void check_efer(void);
+
 extern unsigned long start_pfn, end_pfn, end_pfn_map; 
+extern int iommu_aperture;
 
 extern void show_stack(unsigned long * rsp);
 extern void show_trace(unsigned long *stack);
@@ -44,7 +49,6 @@
 extern void show_regs(struct pt_regs * regs);
 
 extern int apic_disabled;
-extern int acpi_disabled;
 
 #define round_up(x,y) (((x) + (y) - 1) & ~((y)-1))
 #define round_down(x,y) ((x) & ~((y)-1))
diff -urN linux-2.4.26-pre5/include/asm-x86_64/scatterlist.h linux-2.4.26-pre6/include/asm-x86_64/scatterlist.h
--- linux-2.4.26-pre5/include/asm-x86_64/scatterlist.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.26-pre6/include/asm-x86_64/scatterlist.h	2004-03-24 19:07:42.000000000 -0800
@@ -9,6 +9,7 @@
 
     unsigned int length;
     dma_addr_t dma_address;
+    unsigned int dma_length;
 };
 
 #define ISA_DMA_THRESHOLD (0x00ffffff)
diff -urN linux-2.4.26-pre5/include/asm-x86_64/smp.h linux-2.4.26-pre6/include/asm-x86_64/smp.h
--- linux-2.4.26-pre5/include/asm-x86_64/smp.h	2003-11-28 10:26:21.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-x86_64/smp.h	2004-03-24 19:07:42.000000000 -0800
@@ -36,6 +36,9 @@
 extern unsigned long cpu_online_map;
 extern volatile unsigned long smp_invalidate_needed;
 extern int pic_mode;
+extern int smp_num_siblings;
+extern int cpu_sibling_map[];
+
 extern void smp_flush_tlb(void);
 extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
 extern void smp_send_reschedule(int cpu);
@@ -89,8 +92,8 @@
 	return GET_APIC_ID(*(unsigned *)(APIC_BASE+APIC_ID));
 }
 
-/* Assume apicid == cpuid */
-#define safe_smp_processor_id() (cpuid_ebx(1) >> 24) 
+extern int apic_disabled;
+#define safe_smp_processor_id() (apic_disabled ? 0 : x86_apicid_to_cpu[hard_smp_processor_id()])
 
 #endif /* !ASSEMBLY */
 
diff -urN linux-2.4.26-pre5/include/asm-x86_64/uaccess.h linux-2.4.26-pre6/include/asm-x86_64/uaccess.h
--- linux-2.4.26-pre5/include/asm-x86_64/uaccess.h	2004-02-18 05:36:32.000000000 -0800
+++ linux-2.4.26-pre6/include/asm-x86_64/uaccess.h	2004-03-24 19:07:42.000000000 -0800
@@ -236,6 +236,7 @@
 
 extern unsigned long copy_to_user(void *to, const void *from, unsigned len); 
 extern unsigned long copy_from_user(void *to, const void *from, unsigned len); 
+extern unsigned long copy_in_user(void *to, const void *from, unsigned len); 
 
 static inline int __copy_from_user(void *dst, const void *src, unsigned size) 
 { 
diff -urN linux-2.4.26-pre5/include/linux/nfs_fs.h linux-2.4.26-pre6/include/linux/nfs_fs.h
--- linux-2.4.26-pre5/include/linux/nfs_fs.h	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/include/linux/nfs_fs.h	2004-03-24 19:07:42.000000000 -0800
@@ -209,13 +209,13 @@
  * Try to write back everything synchronously (but check the
  * return value!)
  */
-extern int  nfs_sync_file(struct inode *, struct file *, unsigned long, unsigned int, int);
-extern int  nfs_flush_file(struct inode *, struct file *, unsigned long, unsigned int, int);
+extern int  nfs_sync_file(struct inode *, unsigned long, unsigned int, int);
+extern int  nfs_flush_file(struct inode *, unsigned long, unsigned int, int);
 extern int  nfs_flush_list(struct list_head *, int, int);
 extern int  nfs_scan_lru_dirty(struct nfs_server *, struct list_head *);
 extern int  nfs_scan_lru_dirty_timeout(struct nfs_server *, struct list_head *);
 #ifdef CONFIG_NFS_V3
-extern int  nfs_commit_file(struct inode *, struct file *, int);
+extern int  nfs_commit_file(struct inode *, int);
 extern int  nfs_commit_list(struct list_head *, int);
 extern int  nfs_scan_lru_commit(struct nfs_server *, struct list_head *);
 extern int  nfs_scan_lru_commit_timeout(struct nfs_server *, struct list_head *);
@@ -236,7 +236,7 @@
 static inline int
 nfs_wb_all(struct inode *inode)
 {
-	int error = nfs_sync_file(inode, 0, 0, 0, FLUSH_WAIT);
+	int error = nfs_sync_file(inode, 0, 0, FLUSH_WAIT);
 	return (error < 0) ? error : 0;
 }
 
@@ -246,17 +246,7 @@
 static inline int
 nfs_wb_page(struct inode *inode, struct page* page)
 {
-	int error = nfs_sync_file(inode, 0, page_index(page), 1, FLUSH_WAIT | FLUSH_STABLE);
-	return (error < 0) ? error : 0;
-}
-
-/*
- * Write back all pending writes for one user.. 
- */
-static inline int
-nfs_wb_file(struct inode *inode, struct file *file)
-{
-	int error = nfs_sync_file(inode, file, 0, 0, FLUSH_WAIT);
+	int error = nfs_sync_file(inode, page_index(page), 1, FLUSH_WAIT | FLUSH_STABLE);
 	return (error < 0) ? error : 0;
 }
 
diff -urN linux-2.4.26-pre5/include/linux/nfs_page.h linux-2.4.26-pre6/include/linux/nfs_page.h
--- linux-2.4.26-pre5/include/linux/nfs_page.h	2002-08-02 17:39:45.000000000 -0700
+++ linux-2.4.26-pre6/include/linux/nfs_page.h	2004-03-24 19:07:42.000000000 -0800
@@ -53,7 +53,7 @@
 extern	int nfs_scan_lru(struct list_head *, struct list_head *, int);
 extern	int nfs_scan_lru_timeout(struct list_head *, struct list_head *, int);
 extern	int nfs_scan_list(struct list_head *, struct list_head *,
-			  struct file *, unsigned long, unsigned int);
+				unsigned long, unsigned int);
 extern	int nfs_coalesce_requests(struct list_head *, struct list_head *,
 				  unsigned int);
 extern  int nfs_wait_on_request(struct nfs_page *);
diff -urN linux-2.4.26-pre5/include/linux/pci.h linux-2.4.26-pre6/include/linux/pci.h
--- linux-2.4.26-pre5/include/linux/pci.h	2003-11-28 10:26:21.000000000 -0800
+++ linux-2.4.26-pre6/include/linux/pci.h	2004-03-24 19:07:42.000000000 -0800
@@ -34,6 +34,7 @@
 #define  PCI_COMMAND_WAIT 	0x80	/* Enable address/data stepping */
 #define  PCI_COMMAND_SERR	0x100	/* Enable SERR */
 #define  PCI_COMMAND_FAST_BACK	0x200	/* Enable back-to-back writes */
+#define  PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
 
 #define PCI_STATUS		0x06	/* 16 bits */
 #define  PCI_STATUS_CAP_LIST	0x10	/* Support Capability List */
diff -urN linux-2.4.26-pre5/include/linux/pci_ids.h linux-2.4.26-pre6/include/linux/pci_ids.h
--- linux-2.4.26-pre5/include/linux/pci_ids.h	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/include/linux/pci_ids.h	2004-03-24 19:07:42.000000000 -0800
@@ -526,6 +526,7 @@
 #define PCI_DEVICE_ID_SI_6202		0x0002
 #define PCI_DEVICE_ID_SI_503		0x0008
 #define PCI_DEVICE_ID_SI_ACPI		0x0009
+#define PCI_DEVICE_ID_SI_180		0x0180
 #define PCI_DEVICE_ID_SI_5597_VGA	0x0200
 #define PCI_DEVICE_ID_SI_6205		0x0205
 #define PCI_DEVICE_ID_SI_501		0x0406
@@ -660,6 +661,8 @@
 #define PCI_DEVICE_ID_TI_4410		0xac41
 #define PCI_DEVICE_ID_TI_4451		0xac42
 #define PCI_DEVICE_ID_TI_1420		0xac51
+#define PCI_DEVICE_ID_TI_1520		0xac55
+#define PCI_DEVICE_ID_TI_1510		0xac56
 
 #define PCI_VENDOR_ID_SONY		0x104d
 #define PCI_DEVICE_ID_SONY_CXD3222	0x8039
@@ -1687,6 +1690,12 @@
 #define PCI_DEVICE_ID_TIGON3_5901_2	0x170e
 #define PCI_DEVICE_ID_BCM4401		0x4401
 
+#define PCI_VENDOR_ID_ENE		0x1524
+#define PCI_DEVICE_ID_ENE_1211		0x1211
+#define PCI_DEVICE_ID_ENE_1225		0x1225
+#define PCI_DEVICE_ID_ENE_1410		0x1410
+#define PCI_DEVICE_ID_ENE_1420		0x1420
+
 #define PCI_VENDOR_ID_SYBA		0x1592
 #define PCI_DEVICE_ID_SYBA_2P_EPP	0x0782
 #define PCI_DEVICE_ID_SYBA_1P_ECP	0x0783
diff -urN linux-2.4.26-pre5/mm/filemap.c linux-2.4.26-pre6/mm/filemap.c
--- linux-2.4.26-pre5/mm/filemap.c	2004-02-18 05:36:32.000000000 -0800
+++ linux-2.4.26-pre6/mm/filemap.c	2004-03-24 19:07:42.000000000 -0800
@@ -1346,7 +1346,7 @@
 	while (ahead < max_ahead) {
 		unsigned long ra_index = raend + ahead + 1;
 
-		if (ra_index > end_index)
+		if (ra_index >= end_index)
 			break;
 		if (page_cache_read(filp, ra_index) < 0)
 			break;
diff -urN linux-2.4.26-pre5/mm/vmalloc.c linux-2.4.26-pre6/mm/vmalloc.c
--- linux-2.4.26-pre5/mm/vmalloc.c	2004-03-24 19:07:24.000000000 -0800
+++ linux-2.4.26-pre6/mm/vmalloc.c	2004-03-24 19:07:42.000000000 -0800
@@ -184,7 +184,7 @@
 	spin_unlock(&init_mm.page_table_lock);
 	flush_cache_all();
 	if (address > start)
-		vmfree_area_pages(address, address - start);
+		vmfree_area_pages(start, address - start);
 	return -ENOMEM;
 }
 
