From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: allow kprobes to run on top of preempt emulation Date: Thu, 5 Jun 2008 01:09:33 +0200 Message-ID: <20080604230933.GU21613@duo.random> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from host36-195-149-62.serverdedicati.aruba.it ([62.149.195.36]:42601 "EHLO mx.cpushare.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758471AbYFDXJf (ORCPT ); Wed, 4 Jun 2008 19:09:35 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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"