Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1431097 > unrolled thread

[GIT pull] perf fix for 4.7

Started byThomas Gleixner <tglx@linutronix.de>
First post2016-06-25 10:30 +0200
Last post2016-06-25 10:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [GIT pull] perf fix for 4.7 Thomas Gleixner <tglx@linutronix.de> - 2016-06-25 10:30 +0200

#1431097 — [GIT pull] perf fix for 4.7

FromThomas Gleixner <tglx@linutronix.de>
Date2016-06-25 10:30 +0200
Subject[GIT pull] perf fix for 4.7
Message-ID<rNR8t-38L-19@gated-at.bofh.it>
Linus,

please pull the latest perf-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-for-linus

A single fix clearing the TF bit when a fault is single stepped.

Thanks,

	tglx

------------------>
Masami Hiramatsu (1):
      kprobes/x86: Clear TF bit in fault on single-stepping


 arch/x86/kernel/kprobes/core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 38cf7a741250..7847e5c0e0b5 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -961,7 +961,19 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 		 * normal page fault.
 		 */
 		regs->ip = (unsigned long)cur->addr;
+		/*
+		 * Trap flag (TF) has been set here because this fault
+		 * happened where the single stepping will be done.
+		 * So clear it by resetting the current kprobe:
+		 */
+		regs->flags &= ~X86_EFLAGS_TF;
+
+		/*
+		 * If the TF flag was set before the kprobe hit,
+		 * don't touch it:
+		 */
 		regs->flags |= kcb->kprobe_old_flags;
+
 		if (kcb->kprobe_status == KPROBE_REENTER)
 			restore_previous_kprobe(kcb);
 		else

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web