Patches contributed by Eötvös Lorand University
commit 430b5294bd72c085c730e1e4b86580f164d976bf
Author: Ingo Molnar <mingo@elte.hu>
Date: Sun Sep 14 16:33:01 2008 +0200
timers: fix itimer/many thread hang, fix
fix:
kernel/fork.c:843: error: ‘struct signal_struct’ has no member named ‘sum_sched_runtime’
kernel/irq/handle.c:117: warning: ‘sparse_irq_lock’ defined but not used
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/fork.c b/kernel/fork.c
index a8ac2efb8e30..1181b9aac48e 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -834,7 +834,6 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0;
sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0;
task_io_accounting_init(&sig->ioac);
- sig->sum_sched_runtime = 0;
INIT_LIST_HEAD(&sig->cpu_timers[0]);
INIT_LIST_HEAD(&sig->cpu_timers[1]);
INIT_LIST_HEAD(&sig->cpu_timers[2]);
commit a1c75cc5018f17ff6d80ce45a13435b1536f76db
Author: Ingo Molnar <mingo@elte.hu>
Date: Sun Sep 14 14:50:26 2008 +0200
x86, microcode rework, v2, fix
based on patch from Dmitry Adamushko.
- add missing vfree()
- update debug printks
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 902dada2eb6d..0c2634f4fd7c 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -70,8 +70,6 @@
* Fix sigmatch() macro to handle old CPUs with pf == 0.
* Thanks to Stuart Swales for pointing out this bug.
*/
-
-/* #define DEBUG pr_debug */
#include <linux/capability.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -396,7 +394,7 @@ static int mc_sysdev_resume(struct sys_device *dev)
if (!cpu_online(cpu))
return 0;
- pr_debug("microcode: CPU%d resumed\n", cpu);
+
/* only CPU 0 will apply ucode here */
microcode_update_cpu(0);
return 0;
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 6815837a7753..48aec9f48e4f 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -92,7 +92,7 @@ static int get_matching_microcode(int cpu, void *mc, int rev)
unsigned int i = 0;
/*
- * dimm: do we need this? Why an update via /dev/... is different
+ * FIXME! dimm: do we need this? Why an update via /dev/... is different
* from the one via firmware?
*
* This is a tricky part. We might be called from a write operation
@@ -246,7 +246,7 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
return NULL;
}
- /* Why not by means of get_totalsize(hdr)? */
+ /* FIXME! dimm: Why not by means of get_totalsize(hdr)? */
total_size = (unsigned long) (hdr[4] + (hdr[5] << 8));
printk(KERN_INFO "microcode: size %u, total_size %u\n",
@@ -342,6 +342,8 @@ static int generic_load_microcode(int cpu, void *data, size_t size,
mc_header = (struct microcode_header_amd *)mc;
if (get_matching_microcode(cpu, mc, new_rev)) {
+ if (new_mc)
+ vfree(new_mc);
new_rev = mc_header->patch_id;
new_mc = mc;
} else
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c
index f4930b55c6a0..48ed3cef58c1 100644
--- a/arch/x86/kernel/microcode_intel.c
+++ b/arch/x86/kernel/microcode_intel.c
@@ -70,8 +70,6 @@
* Fix sigmatch() macro to handle old CPUs with pf == 0.
* Thanks to Stuart Swales for pointing out this bug.
*/
-
-/* #define DEBUG */ /* pr_debug */
#include <linux/capability.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -356,6 +354,8 @@ static int generic_load_microcode(int cpu, void *data, size_t size,
}
if (get_matching_microcode(&uci->cpu_sig, mc, new_rev)) {
+ if (new_mc)
+ vfree(new_mc);
new_rev = mc_header.rev;
new_mc = mc;
} else
commit a9853dd6d285c30a3ddeb3cce8c05e1678400bef
Author: Ingo Molnar <mingo@elte.hu>
Date: Sun Sep 14 14:46:58 2008 +0200
x86: cpuid, fix typo
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 3e2ce4d33d3a..cef3519b3bbb 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -529,7 +529,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
identify_cpu_without_cpuid(c);
/* cyrix could have cpuid enabled via c_identify()*/
- if (!have_cpuid())
+ if (!have_cpuid_p())
return;
cpu_detect(c);
@@ -611,7 +611,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
identify_cpu_without_cpuid(c);
/* cyrix could have cpuid enabled via c_identify()*/
- if (!have_cpuid())
+ if (!have_cpuid_p())
return;
cpu_detect(c);
commit 30742d5c2277c325fb0e9d2d817d55a19995fe8f
Author: Ingo Molnar <mingo@elte.hu>
Date: Sun Sep 14 14:43:39 2008 +0200
Revert "lockdep: fix compilation when CONFIG_TRACE_IRQFLAGS_SUPPORT is not set"
This reverts commit bd8fbdee6562ee526f3c2582a3b373ef195015dd.
This broke the powerpc build - more fixes are needed before we can
undo this revert.
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index f2993512b3b5..74bde13224c9 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -52,10 +52,10 @@
# define start_critical_timings() do { } while (0)
#endif
-#include <asm/irqflags.h>
-
#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+#include <asm/irqflags.h>
+
#define local_irq_enable() \
do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0)
#define local_irq_disable() \
@@ -84,20 +84,21 @@
* The local_irq_*() APIs are equal to the raw_local_irq*()
* if !TRACE_IRQFLAGS.
*/
-#define local_irq_disable() raw_local_irq_disable()
-#define local_irq_enable() raw_local_irq_enable()
-#define local_irq_save(flags) \
+# define raw_local_irq_disable() local_irq_disable()
+# define raw_local_irq_enable() local_irq_enable()
+# define raw_local_irq_save(flags) \
do { \
typecheck(unsigned long, flags); \
- raw_local_irq_save(flags); \
+ local_irq_save(flags); \
} while (0)
-# define local_irq_restore(flags) \
+# define raw_local_irq_restore(flags) \
do { \
typecheck(unsigned long, flags); \
- raw_local_irq_restore(flags); \
+ local_irq_restore(flags); \
} while (0)
#endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
#define safe_halt() \
do { \
trace_hardirqs_on(); \
@@ -123,5 +124,6 @@
typecheck(unsigned long, flags); \
raw_irqs_disabled_flags(flags); \
})
+#endif /* CONFIG_X86 */
#endif
commit 6e03f99803195e5aaf7f247db31b0d11857ccc35
Merge: 982162602b31 6bfb09a10051
Author: Ingo Molnar <mingo@elte.hu>
Date: Sun Sep 14 14:07:00 2008 +0200
Merge branch 'linus' into x86/iommu
Conflicts:
lib/swiotlb.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
commit 1d18ef489509314506328b9e464dd47c24c1d68f
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Sep 11 20:53:21 2008 +0200
x86: some lock annotations for user copy paths, v3
- add annotation back to clear_user()
- change probe_kernel_address() to _inatomic*() method
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
index 7393152a252e..fab5faba1d3e 100644
--- a/arch/x86/lib/usercopy_32.c
+++ b/arch/x86/lib/usercopy_32.c
@@ -148,6 +148,7 @@ do { \
unsigned long
clear_user(void __user *to, unsigned long n)
{
+ might_fault();
if (access_ok(VERIFY_WRITE, to, n))
__do_clear_user(to, n);
return n;
diff --git a/include/asm-x86/uaccess.h b/include/asm-x86/uaccess.h
index 39f8420c75d9..dc8edb5c4659 100644
--- a/include/asm-x86/uaccess.h
+++ b/include/asm-x86/uaccess.h
@@ -267,7 +267,6 @@ extern void __put_user_8(void);
#define __put_user_size(x, ptr, size, retval, errret) \
do { \
retval = 0; \
- might_fault(); \
__chk_user_ptr(ptr); \
switch (size) { \
case 1: \
@@ -320,7 +319,6 @@ do { \
#define __get_user_size(x, ptr, size, retval, errret) \
do { \
retval = 0; \
- might_fault(); \
__chk_user_ptr(ptr); \
switch (size) { \
case 1: \
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index fec6decfb983..2062293e57e6 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -78,7 +78,7 @@ static inline unsigned long __copy_from_user_nocache(void *to,
\
set_fs(KERNEL_DS); \
pagefault_disable(); \
- ret = __get_user(retval, (__force typeof(retval) __user *)(addr)); \
+ ret = __copy_from_user_inatomic((__force typeof(retval) __user *)(addr), &(retval), sizeof(retval)); \
pagefault_enable(); \
set_fs(old_fs); \
ret; \
commit 09b22a2f678ae733801b888c44756d0abd686b8a
Merge: 3ba35573ad9a adee14b2e155
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Sep 11 13:37:28 2008 +0200
Merge commit 'v2.6.27-rc6' into sched/devel
commit 6ef62164e794c480259ac158aa6c8c7b85746545
Merge: e75b986af788 adee14b2e155
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Sep 11 11:13:58 2008 +0200
Merge commit 'v2.6.27-rc6' into timers/urgent
commit 3ce9bcb583536c45a46c7302747029450e22279c
Merge: 26fd10517e81 f7d0b926ac8c
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Sep 10 14:05:45 2008 +0200
Merge branch 'core/xen' into x86/xen
commit 59c37bf8924c30fbac7ebb66a1d92dcb9f05f6b1
Merge: ec70cae86986 adee14b2e155
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Sep 10 14:00:45 2008 +0200
Merge commit 'v2.6.27-rc6' into x86/unify-cpu-detect
Conflicts:
arch/x86/kernel/cpu/amd.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/common_64.c
arch/x86/kernel/cpu/feature_names.c
include/asm-x86/cpufeature.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>