Skip to content

x86, bts, ptrace, hw-branch-tracer: fixes and cleanups

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18x86, bts: fix race when bts tracer is removedarch/x86/kernel/ds.c+29 -195 replies
2/18sched: add task_is_running() fucntion to sched.hinclude/linux/sched.h kernel/sched.c+21 -00 replies
3/18x86, ptrace, bts: defer branch trace stoppingarch/x86/kernel/ptrace.c include/linux/mm.h include/linux/sched.h +1 more+173 -961 reply
4/18x86, bts: wait until traced task has been scheduled outarch/x86/kernel/ds.c+40 -04 replies
5/18x86, bts: fix race between per-task and per-cpu branch tracingarch/x86/kernel/ds.c+46 -320 replies
6/18x86, debugctlmsr: add _on_cpu variants to debugctlmsr functionsarch/x86/include/asm/processor.h+27 -00 replies
7/18x86, bts, hw-branch-tracer: add _noirq variants to the debug store interfacearch/x86/include/asm/ds.h arch/x86/kernel/ds.c arch/x86/kernel/ds_selftest.c +2 more+492 -2460 replies
8/18x86, hw-branch-tracer: allocate selftest iterator on heapkernel/trace/trace_selftest.c+12 -80 replies
9/18x86, ds: fix compiler warningarch/x86/kernel/ds_selftest.c+1 -10 replies
10/18x86, ds: fix bounds check in ds selftestarch/x86/kernel/ds_selftest.c+6 -10 replies
11/18x86, ds: selftest each cpuarch/x86/kernel/ds_selftest.c+137 -490 replies
12/18x86, ds: add task tracing selftestarch/x86/kernel/ds_selftest.c+71 -00 replies
13/18x86, ds: add leakage warningarch/x86/include/asm/ds.h arch/x86/include/asm/processor.h arch/x86/kernel/ds.c +1 more+10 -92 replies
14/18x86, ds: use single debug store cpu configurationarch/x86/kernel/ds.c+6 -32 replies
15/18x86, ptrace: remove duplicate functionalityarch/x86/include/asm/ptrace.h arch/x86/kernel/ptrace.c include/linux/ptrace.h +2 more+22 -420 replies
16/18x86, ds: dont use TIF_DEBUGCTLMSRarch/x86/kernel/ds.c+0 -50 replies
17/18x86, ds: fix bad ds_reset_pebs()arch/x86/kernel/ds.c+1 -10 replies
18/18x86, ds: support Core i7arch/x86/include/asm/ds.h arch/x86/kernel/ds.c+71 -100 replies

Reviews trailers per patch

3 of 18 patches have a Reviewed-by or Acked-by.

PatchOleg Nesterov
1/18R-b
2/18
3/18R-b
4/18R-b
5/18
6/18
7/18
8/18
9/18
10/18
11/18
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 00/18] x86, bts, ptrace, hw-branch-tracer: fixes and cleanups
Signature · 58 lines
Patches 1-5 fix races with context swithcing code when the branch traced task
is currently running.

In the worst case, this might cause context switch code to access freed
memory or the tracing hardware to continue tracing into a freed buffer.
Both might crash the kernel.

The first 4 patches apply to .29 using the below preparation patch.


The remaining patches fix bugs in the context of per-cpu tracing (i.e.
hw-branch-tracer) and pebs, add more selftest code, and do some cleanups.


Signed-off-by: Markus Metzger <[email protected]>
---

Index: linux-2.6.29/arch/x86/kernel/ds.c
===================================================================
--- linux-2.6.29.orig/arch/x86/kernel/ds.c	2009-04-01 17:39:55.000000000 +0200
+++ linux-2.6.29/arch/x86/kernel/ds.c	2009-04-01 17:40:42.000000000 +0200
@@ -78,8 +78,8 @@ struct bts_tracer {
 	struct ds_tracer ds;
 	/* the trace including the DS configuration */
 	struct bts_trace trace;
-	/* buffer overflow notification function */
-	bts_ovfl_callback_t ovfl;
+	/* Buffer overflow notification function: */
+	bts_ovfl_callback_t	ovfl;
 };
 
 struct pebs_tracer {
Index: linux-2.6.29/arch/x86/kernel/ptrace.c
===================================================================
--- linux-2.6.29.orig/arch/x86/kernel/ptrace.c	2009-04-01 17:39:55.000000000 +0200
+++ linux-2.6.29/arch/x86/kernel/ptrace.c	2009-04-01 17:40:42.000000000 +0200
@@ -21,6 +21,7 @@
 #include <linux/audit.h>
 #include <linux/seccomp.h>
 #include <linux/signal.h>
+#include <linux/ftrace.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.