mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix broken vm86 interrupt/signal handling
@ 2006-05-19 22:09 Aleksey Gorelov
  2006-05-20  2:29 ` Arjan van de Ven
  0 siblings, 1 reply; 3+ messages in thread
From: Aleksey Gorelov @ 2006-05-19 22:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: roland, anemo, mingo, Andrew Morton

Hi,

  This patch
www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h
=c3ff8ec31c1249d268cd11390649768a12bec1b9 has broken vm86
interrupt/signal handling in case when vm86 is called from kernel space.
In this scenario, if signal is pending because of vm86 interrupt,
do_notify_resume/do_signal exits immediately due to user_mode() check,
without processing any signals. Thus, resume_userspace handler is
spinning in a tight loop with signal pending and TIF_SIGPENDING is set.
Previously everything worked Ok.

  The following patch fixes the issue

Signed-off-by: Aleksey Gorelov <aleksey_gorelov@phoenix.com>

--- linux-2.6.16/arch/i386/kernel/entry.S-old	2006-05-19
14:31:41.000000000 -0700
+++ linux-2.6.16/arch/i386/kernel/entry.S	2006-05-19
14:33:31.000000000 -0700
@@ -82,6 +82,12 @@
 #define resume_kernel		restore_nocheck
 #endif
 
+#ifdef CONFIG_VM86
+#define resume_userspace_sig	check_userspace
+#else
+#define resume_userspace_sig	resume_userspace
+#endif
+
 #define SAVE_ALL \
 	cld; \
 	pushl %es; \
@@ -143,6 +149,7 @@
 	preempt_stop
 ret_from_intr:
 	GET_THREAD_INFO(%ebp)
+check_userspace:
 	movl EFLAGS(%esp), %eax		# mix EFLAGS and CS
 	movb CS(%esp), %al
 	testl $(VM_MASK | 3), %eax
@@ -319,7 +326,7 @@
 					# vm86-space
 	xorl %edx, %edx
 	call do_notify_resume
-	jmp resume_userspace
+	jmp resume_userspace_sig
 
 	ALIGN
 work_notifysig_v86:
@@ -330,7 +337,7 @@
 	movl %eax, %esp
 	xorl %edx, %edx
 	call do_notify_resume
-	jmp resume_userspace
+	jmp resume_userspace_sig
 #endif
 
 	# perform syscall exit tracing

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix broken vm86 interrupt/signal handling
  2006-05-19 22:09 [PATCH] fix broken vm86 interrupt/signal handling Aleksey Gorelov
@ 2006-05-20  2:29 ` Arjan van de Ven
  2006-05-22 11:25   ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Arjan van de Ven @ 2006-05-20  2:29 UTC (permalink / raw)
  To: Aleksey Gorelov; +Cc: linux-kernel, roland, anemo, mingo, Andrew Morton

On Fri, 2006-05-19 at 15:09 -0700, Aleksey Gorelov wrote:
> Hi,
> 
>   This patch
> www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h
> =c3ff8ec31c1249d268cd11390649768a12bec1b9 has broken vm86
> interrupt/signal handling in case when vm86 is called from kernel space.

can you point out where vm86 is called from kernel space?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix broken vm86 interrupt/signal handling
  2006-05-20  2:29 ` Arjan van de Ven
@ 2006-05-22 11:25   ` Andi Kleen
  0 siblings, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2006-05-22 11:25 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: linux-kernel, roland, anemo, mingo, Andrew Morton, Aleksey_Gorelov

Arjan van de Ven <arjan@infradead.org> writes:

D> On Fri, 2006-05-19 at 15:09 -0700, Aleksey Gorelov wrote:
> > Hi,
> > 
> >   This patch
> > www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h
> > =c3ff8ec31c1249d268cd11390649768a12bec1b9 has broken vm86
> > interrupt/signal handling in case when vm86 is called from kernel space.
> 
> can you point out where vm86 is called from kernel space?

Programs inside vm86 can run with segments that look like ring 0.
That is why i386 always checks (ring > 0 || vmmask in eflags) when it checks
for user mode.

I guess Aleksey meant that.

-Andi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-22 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-19 22:09 [PATCH] fix broken vm86 interrupt/signal handling Aleksey Gorelov
2006-05-20  2:29 ` Arjan van de Ven
2006-05-22 11:25   ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®