From da14d784f07805c4d7b4c86d910c50ac64614de4 Mon Sep 17 00:00:00 2001
From: "Prasanna S. Panchamukhi" <prasanna@in.ibm.com>
Date: Thu, 18 Nov 2004 22:53:04 -0800
Subject: [PATCH] [PATCH] kprobes: dont steal interrupts from vm86

This patch fixes the problem reported by Stas Sergeev, that kprobes steals
the virtual-8086 exceptions.  This fix modifies kprobe_handler() to return
0 when in virtual-8086 mode.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
 arch/i386/kernel/kprobes.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index f96a30d7caf7..b9eb1a95bb53 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -117,6 +117,11 @@ static inline int kprobe_handler(struct pt_regs *regs)
 	p = get_kprobe(addr);
 	if (!p) {
 		unlock_kprobes();
+		if (regs->eflags & VM_MASK) {
+			/* We are in virtual-8086 mode. Return 0 */
+			goto no_kprobe;
+		}
+
 		if (*addr != BREAKPOINT_INSTRUCTION) {
 			/*
 			 * The breakpoint instruction was removed right
-- 
2.30.9