public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] strange work_notifysig code since 2.6.16
@ 2006-10-24 23:19 Joe Korty
  2006-10-25  5:48 ` Matt Mackall
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Korty @ 2006-10-24 23:19 UTC (permalink / raw)
  To: mpm; +Cc: akpm, linux-kernel

tree 9b5daef5280800a0006343a17f63072658d91a1d is surely wrong.

	[PATCH] Make vm86 support optional
	Jan 8, 2006, tree first appears in 2.6.16

If the branch to work_notifysig_86 is taken and CONFIG_VM86=n,
then entry.S drops into unrelated assembly code.

The branch to work_notifysig_v86, a few lines above the patch, says:
    "returning to kernel-space or vm86-space"
which implies if vm86-space isn't being supported we still need the
branch & jumped-to code in order to handle the kernel case.

However, I don't understand this area all that well, so take this patch
as more of an indication of a possible problem area than as a true fix.

Signed-off-by: Joe Korty <joe.korty@ccur.com>

Index: 2.6.18.1/arch/i386/kernel/entry.S
===================================================================
--- 2.6.18.1.orig/arch/i386/kernel/entry.S	2006-09-19 23:42:06.000000000 -0400
+++ 2.6.18.1/arch/i386/kernel/entry.S	2006-10-24 19:08:36.000000000 -0400
@@ -457,7 +457,6 @@
 
 	ALIGN
 work_notifysig_v86:
-#ifdef CONFIG_VM86
 	pushl %ecx			# save ti_flags for do_notify_resume
 	CFI_ADJUST_CFA_OFFSET 4
 	call save_v86_state		# %eax contains pt_regs pointer
@@ -467,7 +466,6 @@
 	xorl %edx, %edx
 	call do_notify_resume
 	jmp resume_userspace_sig
-#endif
 
 	# perform syscall exit tracing
 	ALIGN

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

* Re: [PATCH] strange work_notifysig code since 2.6.16
  2006-10-24 23:19 [PATCH] strange work_notifysig code since 2.6.16 Joe Korty
@ 2006-10-25  5:48 ` Matt Mackall
  2006-10-25 14:29   ` Joe Korty
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Mackall @ 2006-10-25  5:48 UTC (permalink / raw)
  To: Joe Korty; +Cc: akpm, linux-kernel

On Tue, Oct 24, 2006 at 07:19:21PM -0400, Joe Korty wrote:
> tree 9b5daef5280800a0006343a17f63072658d91a1d is surely wrong.
> 
> 	[PATCH] Make vm86 support optional
> 	Jan 8, 2006, tree first appears in 2.6.16
> 
> If the branch to work_notifysig_86 is taken and CONFIG_VM86=n,
> then entry.S drops into unrelated assembly code.
>
> The branch to work_notifysig_v86, a few lines above the patch, says:
>     "returning to kernel-space or vm86-space"
> which implies if vm86-space isn't being supported we still need the
> branch & jumped-to code in order to handle the kernel case.
> 
> However, I don't understand this area all that well, so take this patch
> as more of an indication of a possible problem area than as a true fix.
> 
> Signed-off-by: Joe Korty <joe.korty@ccur.com>
> 
> Index: 2.6.18.1/arch/i386/kernel/entry.S
> ===================================================================
> --- 2.6.18.1.orig/arch/i386/kernel/entry.S	2006-09-19 23:42:06.000000000 -0400
> +++ 2.6.18.1/arch/i386/kernel/entry.S	2006-10-24 19:08:36.000000000 -0400
> @@ -457,7 +457,6 @@
>  
>  	ALIGN
>  work_notifysig_v86:
> -#ifdef CONFIG_VM86
>  	pushl %ecx			# save ti_flags for do_notify_resume
>  	CFI_ADJUST_CFA_OFFSET 4
>  	call save_v86_state		# %eax contains pt_regs pointer

I suspect this won't link with CONFIG_VM86 disabled because
save_v86_state goes away. I think we just need to move the #endif up a
few lines.

> @@ -467,7 +466,6 @@
>  	xorl %edx, %edx
>  	call do_notify_resume
>  	jmp resume_userspace_sig
> -#endif
>  
>  	# perform syscall exit tracing
>  	ALIGN

-- 
Mathematics is the supreme nostalgia of our time.

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

* Re: [PATCH] strange work_notifysig code since 2.6.16
  2006-10-25  5:48 ` Matt Mackall
@ 2006-10-25 14:29   ` Joe Korty
  2006-10-25 19:02     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Korty @ 2006-10-25 14:29 UTC (permalink / raw)
  To: Matt Mackall; +Cc: akpm, linux-kernel

> I suspect this won't link with CONFIG_VM86 disabled because save_v86_state
> goes away. I think we just need to move the #endif up a few lines.

Hi Matt,
Since that also makes the 'then' and 'else' branches identical, perhaps
this patch would be better .. it eliminates the VM86 test entirely when
CONFIG_VM86=n.

Boot tested with CONFIG_VM86=y.

Regards,
Joe

The entry.S code at work_notifysig is surely wrong.  It drops into unrelated
code if the branch to work_notifysig_v86 is taken, and CONFIG_VM86=n.

	[PATCH] Make vm86 support optional
	tree 9b5daef5280800a0006343a17f63072658d91a1d
	pushed to git Jan 8, 2006, and first appears in 2.6.16

The 'fix' here is to also compile out the vm86 test & branch when
CONFIG_VM86=n.

Signed-off-by: Joe Korty <joe.korty@ccur.com>

Index: 2.6.18.1/arch/i386/kernel/entry.S
===================================================================
--- 2.6.18.1.orig/arch/i386/kernel/entry.S	2006-10-25 10:06:25.000000000 -0400
+++ 2.6.18.1/arch/i386/kernel/entry.S	2006-10-25 10:10:38.000000000 -0400
@@ -447,6 +447,7 @@
 
 work_notifysig:				# deal with pending signals and
 					# notify-resume requests
+#ifdef CONFIG_VM86
 	testl $VM_MASK, EFLAGS(%esp)
 	movl %esp, %eax
 	jne work_notifysig_v86		# returning to kernel-space or
@@ -457,17 +458,18 @@
 
 	ALIGN
 work_notifysig_v86:
-#ifdef CONFIG_VM86
 	pushl %ecx			# save ti_flags for do_notify_resume
 	CFI_ADJUST_CFA_OFFSET 4
 	call save_v86_state		# %eax contains pt_regs pointer
 	popl %ecx
 	CFI_ADJUST_CFA_OFFSET -4
 	movl %eax, %esp
+#else
+	movl %esp, %eax
+#endif
 	xorl %edx, %edx
 	call do_notify_resume
 	jmp resume_userspace_sig
-#endif
 
 	# perform syscall exit tracing
 	ALIGN

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

* Re: [PATCH] strange work_notifysig code since 2.6.16
  2006-10-25 14:29   ` Joe Korty
@ 2006-10-25 19:02     ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2006-10-25 19:02 UTC (permalink / raw)
  To: Joe Korty; +Cc: akpm, linux-kernel

Joe Korty <joe.korty@ccur.com> writes:

> > I suspect this won't link with CONFIG_VM86 disabled because save_v86_state
> > goes away. I think we just need to move the #endif up a few lines.
> 
> Hi Matt,
> Since that also makes the 'then' and 'else' branches identical, perhaps
> this patch would be better .. it eliminates the VM86 test entirely when
> CONFIG_VM86=n.
> 
> Boot tested with CONFIG_VM86=y.

Added.

-Andi

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

end of thread, other threads:[~2006-10-25 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-24 23:19 [PATCH] strange work_notifysig code since 2.6.16 Joe Korty
2006-10-25  5:48 ` Matt Mackall
2006-10-25 14:29   ` Joe Korty
2006-10-25 19:02     ` Andi Kleen

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