Patches contributed by Eötvös Lorand University


commit 45e96f26f257bd873017c6244a6cafd27f6f5439
Author: Ingo Molnar <mingo@elte.hu>
Date:   Wed Aug 27 10:37:14 2008 +0200

    warnings: fix arch/x86/kernel/early_printk.c
    
    fix warning:
    
      arch/x86/kernel/early_printk.c:993: warning: ‘enable_debug_console’ defined but not used
    
    Eliminate dead code.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 02fc5b40c14b..34ad997d3834 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -989,22 +989,4 @@ static int __init setup_early_printk(char *buf)
 	return 0;
 }
 
-static void __init enable_debug_console(char *buf)
-{
-#ifdef DBGP_DEBUG
-	struct console *old_early_console = NULL;
-
-	if (early_console_initialized && early_console) {
-		old_early_console = early_console;
-		unregister_console(early_console);
-		early_console_initialized = 0;
-	}
-
-	setup_early_printk(buf);
-
-	if (early_console == old_early_console && old_early_console)
-		register_console(old_early_console);
-#endif
-}
-
 early_param("earlyprintk", setup_early_printk);

commit 9f482807a6bd7e2aa1ed0d8cfc48463ec4ca3568
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Aug 18 12:59:32 2008 +0200

    x86, fpu: check __clear_user() return value
    
    fix warning:
    
      arch/x86/kernel/xsave.c: In function ‘save_i387_xstate’:
      arch/x86/kernel/xsave.c:98: warning: ignoring return value of ‘__clear_user’, declared with attribute warn_unused_result
    
    check the return value and act on it. We should not be ignoring faults
    at this point.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 2f98323716d9..9abac8a9d823 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -95,7 +95,9 @@ int save_i387_xstate(void __user *buf)
 	 	 * Start with clearing the user buffer. This will present a
 	 	 * clean context for the bytes not touched by the fxsave/xsave.
 		 */
-		__clear_user(buf, sig_xstate_size);
+		err = __clear_user(buf, sig_xstate_size);
+		if (err)
+			return err;
 
 		if (task_thread_info(tsk)->status & TS_XSAVE)
 			err = xsave_user(buf);

commit 620f2efcdc5c7a2db68da41bc3df3cf9a718024e
Merge: 04944b793e18 fd0480883066
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 15:17:14 2008 +0200

    Merge branch 'linus' into x86/xsave

commit 46eaa6702016e3ac9a188172a2c309d6ca1be1cd
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 15:06:29 2008 +0200

    x86: memory corruption check - cleanup
    
    Move the prototypes from the generic kernel.h header to the more
    appropriate include/asm-x86/bios_ebda.h header file.
    
    Also, remove the check from the power management code - this is a
    pure x86 matter for now.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 7e05462ffb11..bbe044dbe014 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -31,6 +31,7 @@
 #include <linux/cpumask.h>
 
 #include <asm/asm.h>
+#include <asm/bios_ebda.h>
 #include <asm/processor.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index d84d3e91d348..3e10054c5731 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -31,6 +31,7 @@
 #include <linux/nmi.h>
 
 #include <asm/processor.h>
+#include <asm/bios_ebda.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index bf6d3554e506..273a944d4040 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -254,7 +254,6 @@ static char *pm_verb(int event)
 
 static void pm_dev_dbg(struct device *dev, pm_message_t state, char *info)
 {
-	check_for_bios_corruption();
 	dev_dbg(dev, "%s%s%s\n", info, pm_verb(state.event),
 		((state.event & PM_EVENT_SLEEP) && device_may_wakeup(dev)) ?
 		", may wakeup" : "");
diff --git a/include/asm-x86/bios_ebda.h b/include/asm-x86/bios_ebda.h
index ec42ed874591..79b4b88505d7 100644
--- a/include/asm-x86/bios_ebda.h
+++ b/include/asm-x86/bios_ebda.h
@@ -16,4 +16,21 @@ static inline unsigned int get_bios_ebda(void)
 
 void reserve_ebda_region(void);
 
+#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
+/*
+ * This is obviously not a great place for this, but we want to be
+ * able to scatter it around anywhere in the kernel.
+ */
+void check_for_bios_corruption(void);
+void start_periodic_check_for_corruption(void);
+#else
+static inline void check_for_bios_corruption(void)
+{
+}
+
+static inline void start_periodic_check_for_corruption(void)
+{
+}
+#endif
+
 #endif /* ASM_X86__BIOS_EBDA_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 50873b211788..2651f805ba6d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -240,23 +240,6 @@ extern const char *print_tainted(void);
 extern void add_taint(unsigned);
 extern int root_mountflags;
 
-#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
-/*
- * This is obviously not a great place for this, but we want to be
- * able to scatter it around anywhere in the kernel.
- */
-void check_for_bios_corruption(void);
-void start_periodic_check_for_corruption(void);
-#else
-static inline void check_for_bios_corruption(void)
-{
-}
-
-static inline void start_periodic_check_for_corruption(void)
-{
-}
-#endif
-
 /* Values used for system_state */
 extern enum system_states {
 	SYSTEM_BOOTING,

commit a9b9e81c915e4a57ac3b21d1a7fa7ff184639780
Merge: a8b71a281038 fd0480883066
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 15:05:39 2008 +0200

    Merge branch 'linus' into x86/memory-corruption-check

commit eceb1383361c6327cef4de01d278cd6722ebceeb
Merge: 365d46dc9be9 84e9c95ad92f 4c7145a1ec1b
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 13:20:25 2008 +0200

    Merge branches 'core/signal' and 'x86/spinlocks' into x86/xen
    
    Conflicts:
            include/asm-x86/spinlock.h

diff --cc include/asm-x86/spinlock.h
index 8badab09146b,93adae338ac6,b5a4551fd565..157ff7fab97a
--- a/include/asm-x86/spinlock.h
+++ b/include/asm-x86/spinlock.h
@@@@ -182,6 -182,8 -158,22 +158,20 @@@@ static __always_inline void __ticket_sp
   }
   #endif
   
 - #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
++ static inline int __ticket_spin_is_locked(raw_spinlock_t *lock)
++ {
++ 	int tmp = ACCESS_ONCE(lock->slock);
++ 
++ 	return !!(((tmp >> TICKET_SHIFT) ^ tmp) & ((1 << TICKET_SHIFT) - 1));
++ }
++ 
++ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
++ {
++ 	int tmp = ACCESS_ONCE(lock->slock);
++ 
++ 	return (((tmp >> TICKET_SHIFT) - tmp) & ((1 << TICKET_SHIFT) - 1)) > 1;
++ }
+  
  -#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
  -
   #ifdef CONFIG_PARAVIRT
   /*
    * Define virtualization-friendly old-style lock byte lock, for use in

commit 84e9c95ad92f7afcd960342b6012b0a1b039e21b
Merge: 206855c321ad 1389ac4b976a
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 13:17:07 2008 +0200

    Merge branch 'x86/signal' into core/signal

commit 1389ac4b976abdc0555280dfc1aa2c3abcc19641
Merge: 69e13ad56f9e fd0480883066
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 12:49:27 2008 +0200

    Merge branch 'linus' into x86/signal
    
    Conflicts:
            arch/x86/kernel/signal_64.c

commit acbaa41a780490c791492c41144c774c04875af1
Merge: 8d89adf44cf7 fd0480883066
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 12:43:21 2008 +0200

    Merge branch 'linus' into x86/quirks
    
    Conflicts:
            arch/x86/kernel/early-quirks.c

diff --cc arch/x86/kernel/early-quirks.c
index 6b839b147644,24bb5faf5efa..733c4f8d42ea
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@@ -95,52 -95,20 +95,66 @@@ static void __init nvidia_bugs(int num
  
  }
  
 +static u32 ati_ixp4x0_rev(int num, int slot, int func)
 +{
 +	u32 d;
 +	u8  b;
 +
 +	b = read_pci_config_byte(num, slot, func, 0xac);
 +	b &= ~(1<<5);
 +	write_pci_config_byte(num, slot, func, 0xac, b);
 +
 +	d = read_pci_config(num, slot, func, 0x70);
 +	d |= 1<<8;
 +	write_pci_config(num, slot, func, 0x70, d);
 +
 +	d = read_pci_config(num, slot, func, 0x8);
 +	d &= 0xff;
 +	return d;
 +}
 +
 +static void __init ati_bugs(int num, int slot, int func)
 +{
 +#if defined(CONFIG_ACPI) && defined (CONFIG_X86_IO_APIC)
 +	u32 d;
 +	u8  b;
 +
 +	if (acpi_use_timer_override)
 +		return;
 +
 +	d = ati_ixp4x0_rev(num, slot, func);
 +	if (d  < 0x82)
 +		acpi_skip_timer_override = 1;
 +	else {
 +		/* check for IRQ0 interrupt swap */
 +		outb(0x72, 0xcd6); b = inb(0xcd7);
 +		if (!(b & 0x2))
 +			acpi_skip_timer_override = 1;
 +	}
 +
 +	if (acpi_skip_timer_override) {
 +		printk(KERN_INFO "SB4X0 revision 0x%x\n", d);
 +		printk(KERN_INFO "Ignoring ACPI timer override.\n");
 +		printk(KERN_INFO "If you got timer trouble "
 +		       "try acpi_use_timer_override\n");
 +	}
 +#endif
 +}
 +
+ #ifdef CONFIG_DMAR
+ static void __init intel_g33_dmar(int num, int slot, int func)
+ {
+ 	struct acpi_table_header *dmar_tbl;
+ 	acpi_status status;
+ 
+ 	status = acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_tbl);
+ 	if (ACPI_SUCCESS(status)) {
+ 		printk(KERN_INFO "BIOS BUG: DMAR advertised on Intel G31/G33 chipset -- ignoring\n");
+ 		dmar_disabled = 1;
+ 	}
+ }
+ #endif
+ 
  #define QFLAG_APPLY_ONCE 	0x1
  #define QFLAG_APPLIED		0x2
  #define QFLAG_DONE		(QFLAG_APPLY_ONCE|QFLAG_APPLIED)
@@@ -160,8 -128,10 +174,12 @@@ static struct chipset early_qrk[] __ini
  	  PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, via_bugs },
  	{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB,
  	  PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, fix_hypertransport_config },
 +	{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS,
 +	  PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs },
+ #ifdef CONFIG_DMAR
+ 	{ PCI_VENDOR_ID_INTEL, 0x29c0,
+ 	  PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, intel_g33_dmar },
+ #endif
  	{}
  };
  

commit 4c7145a1ec1bb789d5f07e47510e8bda546a7c4a
Merge: 74e91604b245 fd0480883066
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Oct 12 12:39:30 2008 +0200

    Merge branch 'linus' into x86/spinlocks
    
    Done to prevent this failure of an Octopus merge:
    
     Added arch/arm/include/asm/byteorder.h in both, but differently.
     ERROR: Merge conflict in arch/arm/include/asm/byteorder.h
     Auto-merging include/asm-x86/spinlock.h
     ERROR: Merge conflict in include/asm-x86/spinlock.h
     fatal: merge program failed