Skip to contentSkip to conversation

allow kprobes to run on top of preempt emulation

PATCH Applied Andrea Arcangeli 2 participants 2 messages Jun 4, 2008 – Jun 5, 2008 KVM

lore
Share & tools
lore
#0 lore raw

This patch makes preempt emulation more strict in differentiating its own dr0 hardware breakpoint from a singlestep in return from kprobes pre-handler that will invoke the post-handler through int1 debug TS on eflags. This avoids GPF when kprobes returns from pre-handler with the dr7 loaded with preempt emulation.

home/andrea/kernel/qumranet/kvm/kernel/preempt.c renamed from kernel/preempt.c +5 -0
@@ -140,6 +147,11 @@
      "cmp $0x701, " TMP " \n\t"
      "pop "  TMP " \n\t"
      "jnz .Lnotme \n\t"
+     "push "  TMP " \n\t"
+     "mov %db6, " TMP " \n\t"
+     "test $0x1, " TMP " \n\t"
+     "pop "  TMP " \n\t"
+     "jz .Lnotme \n\t"
      SAVE_REGS "\n\t"
 #ifdef CONFIG_X86_64
      "leaq 120(%rsp),%rdi\n\t"
Applied
#1 lore raw
Quoted 7 lines · Andrea Arcangeli

This patch makes preempt emulation more strict in differentiating its own dr0 hardware breakpoint from a singlestep in return from kprobes pre-handler that will invoke the post-handler through int1 debug TS on eflags. This avoids GPF when kprobes returns from pre-handler with the dr7 loaded with preempt emulation.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function