]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/process_64.c
x86, bts: add fork and exit handling
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / process_64.c
index 1cfd2a4bf853d4e04ac6a87a1e9aaa2213531f49..416fb9282f4fc73b666586d1964ca277f14f44cc 100644 (file)
@@ -53,6 +53,7 @@
 #include <asm/ia32.h>
 #include <asm/idle.h>
 #include <asm/syscalls.h>
+#include <asm/ds.h>
 
 asmlinkage extern void ret_from_fork(void);
 
@@ -236,17 +237,8 @@ void exit_thread(void)
                t->io_bitmap_max = 0;
                put_cpu();
        }
-#ifdef CONFIG_X86_DS
-       /* Free any BTS tracers that have not been properly released. */
-       if (unlikely(current->bts)) {
-               ds_release_bts(current->bts);
-               current->bts = NULL;
-
-               kfree(current->bts_buffer);
-               current->bts_buffer = NULL;
-               current->bts_size = 0;
-       }
-#endif /* CONFIG_X86_DS */
+
+       ds_exit_thread(current);
 }
 
 void flush_thread(void)
@@ -376,6 +368,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
                if (err)
                        goto out;
        }
+
+       ds_copy_thread(p, me);
+
+       clear_tsk_thread_flag(p, TIF_DEBUGCTLMSR);
+       p->thread.debugctlmsr = 0;
+
        err = 0;
 out:
        if (err && p->thread.io_bitmap_ptr) {