public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@qumranet.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm@vger.kernel.org
Subject: allow kprobes to run on top of preempt emulation
Date: Thu, 5 Jun 2008 01:09:33 +0200	[thread overview]
Message-ID: <20080604230933.GU21613@duo.random> (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.

Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>

--- kvm-userland/kernel/preempt.c	2008-05-06 19:33:40.000000000 +0200
+++ /home/andrea/kernel/qumranet/kvm/kernel/preempt.c	2008-06-05 00:18:06.000000000 +0200
@@ -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"

             reply	other threads:[~2008-06-04 23:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-04 23:09 Andrea Arcangeli [this message]
2008-06-05  7:06 ` allow kprobes to run on top of preempt emulation Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080604230933.GU21613@duo.random \
    --to=andrea@qumranet.com \
    --cc=avi@qumranet.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox