Patches contributed by Eötvös Lorand University
commit a3eeeefbf1cd1d142c52238cc19c75d14c3bc8d5
Merge: 30cd324e9787 7e3cbc3f774f
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 25 12:48:18 2008 +0100
Merge branch 'x86/tsc' into tracing/core
Merge it to resolve this incidental conflict between the BTS fixes/cleanups
and changes in x86/tsc:
Conflicts:
arch/x86/kernel/cpu/intel.c
diff --cc arch/x86/kernel/cpu/intel.c
index cd413d9a0218,ccfd2047630c..8ea6929e974c
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@@ -308,7 -326,9 +325,6 @@@ static void __cpuinit init_intel(struc
set_cpu_cap(c, X86_FEATURE_P3);
#endif
- detect_extended_topology(c);
- if (cpu_has_bts)
- ptrace_bts_init_intel(c);
-
if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) {
/*
* let's use the legacy cpuid vector 0x1 and 0x4 for topology
commit 4e17fee24a39448f3a20e9cf98887b7665825848
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 25 12:04:17 2008 +0100
x86: turn CONFIG_SPARSE_IRQ off by default
New feature - lets disable it by default first - can flip it around
later.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5c243826334a..d14a8806227d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -241,7 +241,6 @@ config X86_HAS_BOOT_CPU_ID
config SPARSE_IRQ
bool "Support sparse irq numbering"
depends on PCI_MSI || HT_IRQ
- default y
help
This enables support for sparse irq, esp for msi/msi-x. You may need
if you have lots of cards supports msi-x installed.
commit 79a66b96c339626a3e4b226fefc0e45244cfe6ff
Merge: bed4f13065b5 c1c15b65ec30 1fcccb008be1 4a6908a3a050
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 25 11:50:41 2008 +0100
Merge branches 'x86/pat2' and 'x86/fpu'; commit 'v2.6.28' into x86/core
diff --cc arch/x86/kernel/traps.c
index 73ece2633f47,04d242ab0161,f37cee75ab58,04d242ab0161..141907ab6e22
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@@@@ -684,15 -689,14 -688,15 -689,14 +684,15 @@@@@ void math_error(void __user *ip
*/
cwd = get_fpu_cwd(task);
swd = get_fpu_swd(task);
- - switch (swd & ~cwd & 0x3f) {
- - case 0x000: /* No unmasked exception */
+ +
+ + err = swd & ~cwd & 0x3f;
+ +
- #if CONFIG_X86_32
+ #ifdef CONFIG_X86_32
+ + if (!err)
return;
#endif
- - default: /* Multiple exceptions */
- - break;
- - case 0x001: /* Invalid Op */
+ +
+ + if (err & 0x001) { /* Invalid op */
/*
* swd & 0x240 == 0x040: Stack Underflow
* swd & 0x240 == 0x240: Stack Overflow
commit 9212ddb5eada64fec5a08b28207401f3cc3d0876
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 25 11:21:20 2008 +0100
stacktrace: provide save_stack_trace_tsk() weak alias
Impact: build fix
Some architectures have not implemented save_stack_trace_tsk() yet:
fs/built-in.o: In function `proc_pid_stack':
base.c:(.text+0x3f140): undefined reference to `save_stack_trace_tsk'
So warn about that if the facility is used.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
index 94b527ef1d1e..eb212f8f8bc8 100644
--- a/kernel/stacktrace.c
+++ b/kernel/stacktrace.c
@@ -6,6 +6,7 @@
* Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
*/
#include <linux/sched.h>
+#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
#include <linux/stacktrace.h>
@@ -24,3 +25,13 @@ void print_stack_trace(struct stack_trace *trace, int spaces)
}
EXPORT_SYMBOL_GPL(print_stack_trace);
+/*
+ * Architectures that do not implement save_stack_trace_tsk get this
+ * weak alias and a once-per-bootup warning (whenever this facility
+ * is utilized - for example by procfs):
+ */
+__weak void
+save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
+{
+ WARN_ONCE(1, KERN_INFO "save_stack_trace_tsk() not implemented yet.\n");
+}
commit e44aef58ecfbe061eb4c53b939bcc35fb1bee82d
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 25 09:02:11 2008 +0100
perfcounters: include asm/perf_counter.h only if CONFIG_PERF_COUNTERS=y
Impact: build fix on ia64
KOSAKI Motohiro reported that -tip doesnt build on ia64 because
asm/perf_counter.h only exists on x86 for now. Fix it.
Reported-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Tested-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index ec77d1643d37..cc3a75a239a9 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -14,7 +14,10 @@
#define _LINUX_PERF_COUNTER_H
#include <asm/atomic.h>
-#include <asm/perf_counter.h>
+
+#ifdef CONFIG_PERF_COUNTERS
+# include <asm/perf_counter.h>
+#endif
#include <linux/list.h>
#include <linux/mutex.h>
commit 12d79bafb75639f406a9f71aab94808c414c836e
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 25 09:31:28 2008 +0100
rcu: provide RCU options on non-preempt architectures too
Impact: build fix
Some old architectures still do not use kernel/Kconfig.preempt, so the
moving of the RCU options there broke their build:
In file included from /home/mingo/tip/include/linux/sem.h:81,
from /home/mingo/tip/include/linux/sched.h:69,
from /home/mingo/tip/arch/alpha/kernel/asm-offsets.c:9:
/home/mingo/tip/include/linux/rcupdate.h:62:2: error: #error "Unknown RCU implementation specified to kernel configuration"
Move these options back to init/Kconfig, which every architecture
includes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/init/Kconfig b/init/Kconfig
index 9dd7958a71f0..6b0fdedf3596 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -928,6 +928,80 @@ source "block/Kconfig"
config PREEMPT_NOTIFIERS
bool
+choice
+ prompt "RCU Implementation"
+ default CLASSIC_RCU
+
+config CLASSIC_RCU
+ bool "Classic RCU"
+ help
+ This option selects the classic RCU implementation that is
+ designed for best read-side performance on non-realtime
+ systems.
+
+ Select this option if you are unsure.
+
+config TREE_RCU
+ bool "Tree-based hierarchical RCU"
+ help
+ This option selects the RCU implementation that is
+ designed for very large SMP system with hundreds or
+ thousands of CPUs.
+
+config PREEMPT_RCU
+ bool "Preemptible RCU"
+ depends on PREEMPT
+ help
+ This option reduces the latency of the kernel by making certain
+ RCU sections preemptible. Normally RCU code is non-preemptible, if
+ this option is selected then read-only RCU sections become
+ preemptible. This helps latency, but may expose bugs due to
+ now-naive assumptions about each RCU read-side critical section
+ remaining on a given CPU through its execution.
+
+endchoice
+
+config RCU_TRACE
+ bool "Enable tracing for RCU"
+ depends on TREE_RCU || PREEMPT_RCU
+ help
+ This option provides tracing in RCU which presents stats
+ in debugfs for debugging RCU implementation.
+
+ Say Y here if you want to enable RCU tracing
+ Say N if you are unsure.
+
+config RCU_FANOUT
+ int "Tree-based hierarchical RCU fanout value"
+ range 2 64 if 64BIT
+ range 2 32 if !64BIT
+ depends on TREE_RCU
+ default 64 if 64BIT
+ default 32 if !64BIT
+ help
+ This option controls the fanout of hierarchical implementations
+ of RCU, allowing RCU to work efficiently on machines with
+ large numbers of CPUs. This value must be at least the cube
+ root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit
+ systems and up to 262,144 for 64-bit systems.
+
+ Select a specific number if testing RCU itself.
+ Take the default if unsure.
+
+config RCU_FANOUT_EXACT
+ bool "Disable tree-based hierarchical RCU auto-balancing"
+ depends on TREE_RCU
+ default n
+ help
+ This option forces use of the exact RCU_FANOUT value specified,
+ regardless of imbalances in the hierarchy. This is useful for
+ testing RCU itself, and might one day be useful on systems with
+ strong NUMA behavior.
+
+ Without RCU_FANOUT_EXACT, the code will balance the hierarchy.
+
+ Say N if unsure.
+
config TREE_RCU_TRACE
def_bool RCU_TRACE && TREE_RCU
select DEBUG_FS
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
index 463f29743ea0..bf987b95b356 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -52,78 +52,3 @@ config PREEMPT
endchoice
-choice
- prompt "RCU Implementation"
- default CLASSIC_RCU
-
-config CLASSIC_RCU
- bool "Classic RCU"
- help
- This option selects the classic RCU implementation that is
- designed for best read-side performance on non-realtime
- systems.
-
- Select this option if you are unsure.
-
-config TREE_RCU
- bool "Tree-based hierarchical RCU"
- help
- This option selects the RCU implementation that is
- designed for very large SMP system with hundreds or
- thousands of CPUs.
-
-config PREEMPT_RCU
- bool "Preemptible RCU"
- depends on PREEMPT
- help
- This option reduces the latency of the kernel by making certain
- RCU sections preemptible. Normally RCU code is non-preemptible, if
- this option is selected then read-only RCU sections become
- preemptible. This helps latency, but may expose bugs due to
- now-naive assumptions about each RCU read-side critical section
- remaining on a given CPU through its execution.
-
-endchoice
-
-config RCU_TRACE
- bool "Enable tracing for RCU"
- depends on TREE_RCU || PREEMPT_RCU
- help
- This option provides tracing in RCU which presents stats
- in debugfs for debugging RCU implementation.
-
- Say Y here if you want to enable RCU tracing
- Say N if you are unsure.
-
-config RCU_FANOUT
- int "Tree-based hierarchical RCU fanout value"
- range 2 64 if 64BIT
- range 2 32 if !64BIT
- depends on TREE_RCU
- default 64 if 64BIT
- default 32 if !64BIT
- help
- This option controls the fanout of hierarchical implementations
- of RCU, allowing RCU to work efficiently on machines with
- large numbers of CPUs. This value must be at least the cube
- root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit
- systems and up to 262,144 for 64-bit systems.
-
- Select a specific number if testing RCU itself.
- Take the default if unsure.
-
-config RCU_FANOUT_EXACT
- bool "Disable tree-based hierarchical RCU auto-balancing"
- depends on TREE_RCU
- default n
- help
- This option forces use of the exact RCU_FANOUT value specified,
- regardless of imbalances in the hierarchy. This is useful for
- testing RCU itself, and might one day be useful on systems with
- strong NUMA behavior.
-
- Without RCU_FANOUT_EXACT, the code will balance the hierarchy.
-
- Say n if unsure.
-
-
commit 664134d2916109be76648977705a2bea3ff76427
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Nov 25 23:19:24 2008 +0800
crypto: testmgr - Fix error flow of test_comp
This warning:
crypto/testmgr.c: In function ‘test_comp’:
crypto/testmgr.c:829: warning: ‘ret’ may be used uninitialized in this function
triggers because GCC correctly notices that in the ctcount == 0 &&
dtcount != 0 input condition case this function can return an undefined
value, if the second loop fails.
Remove the shadowed 'ret' variable from the second loop that was probably
unintended.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 67dce77d49d5..67ff4aaa3c9c 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -853,7 +853,7 @@ static int test_comp(struct crypto_comp *tfm, struct comp_testvec *ctemplate,
}
for (i = 0; i < dtcount; i++) {
- int ilen, ret, dlen = COMP_BUF_SIZE;
+ int ilen, dlen = COMP_BUF_SIZE;
memset(result, 0, sizeof (result));
commit 67be403d897f818b1a5ecc201967b0ee6a0332f9
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Dec 24 21:08:37 2008 +0100
Revert "x86: disable X86_PTRACE_BTS"
This reverts commit 40f15ad8aadff5ebb621b17a6f303ad2cd3f847d.
The CONFIG_X86_PTRACE_BTS bugs have been fixed via:
c5dee61: x86, bts: memory accounting
bf53de9: x86, bts: add fork and exit handling
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index b54903efb39e..85a78575956c 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -521,7 +521,6 @@ config X86_PTRACE_BTS
bool "Branch Trace Store"
default y
depends on X86_DEBUGCTLMSR
- depends on BROKEN
help
This adds a ptrace interface to the hardware's branch trace store.
commit db8862eafe8a5d030a3b02e81b8bb47447c315e3
Merge: c5dee6177f4b c20137fc5329
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Dec 24 21:08:26 2008 +0100
Merge branch 'linus' into tracing/hw-branch-tracing
commit 40f15ad8aadff5ebb621b17a6f303ad2cd3f847d
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Dec 24 10:49:51 2008 +0100
x86: disable X86_PTRACE_BTS
there's a new ptrace arch level feature in .28:
config X86_PTRACE_BTS
bool "Branch Trace Store"
it has broken fork() handling: the old DS area gets copied over into
a new task without clearing it.
Fixes exist but they came too late:
c5dee61: x86, bts: memory accounting
bf53de9: x86, bts: add fork and exit handling
and are queued up for v2.6.29. This shows that the facility is still not
tested well enough to release into a stable kernel - disable it for now and
reactivate in .29. In .29 the hardware-branch-tracer will use the DS/BTS
facilities too - hopefully resulting in better code.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index b815664fe370..8e99073b9e0f 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -520,6 +520,7 @@ config X86_PTRACE_BTS
bool "Branch Trace Store"
default y
depends on X86_DEBUGCTLMSR
+ depends on BROKEN
help
This adds a ptrace interface to the hardware's branch trace store.