public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] x86/paravirt for v2.6.33
@ 2009-12-03 21:09 Ingo Molnar
  2009-12-08 21:34 ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: Ingo Molnar @ 2009-12-03 21:09 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin, Andrew Morton

Linus,

Please pull the latest x86-paravirt-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-paravirt-for-linus

 Thanks,

	Ingo

------------------>
Jeremy Fitzhardinge (1):
      x86: unify sys_iopl


 arch/x86/include/asm/syscalls.h |    8 +++-----
 arch/x86/kernel/ioport.c        |   11 ++---------
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 372b76e..5336ce2 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -33,11 +33,11 @@ long sys_rt_sigreturn(struct pt_regs *);
 asmlinkage int sys_set_thread_area(struct user_desc __user *);
 asmlinkage int sys_get_thread_area(struct user_desc __user *);
 
-/* X86_32 only */
-#ifdef CONFIG_X86_32
 /* kernel/ioport.c */
-long sys_iopl(struct pt_regs *);
+asmlinkage long sys_iopl(unsigned int);
 
+/* X86_32 only */
+#ifdef CONFIG_X86_32
 /* kernel/process_32.c */
 int sys_clone(struct pt_regs *);
 int sys_execve(struct pt_regs *);
@@ -70,8 +70,6 @@ int sys_vm86(struct pt_regs *);
 #else /* CONFIG_X86_32 */
 
 /* X86_64 only */
-/* kernel/ioport.c */
-asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
 
 /* kernel/process_64.c */
 asmlinkage long sys_clone(unsigned long, unsigned long,
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index 99c4d30..bad4f22 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -119,11 +119,10 @@ static int do_iopl(unsigned int level, struct pt_regs *regs)
 	return 0;
 }
 
-#ifdef CONFIG_X86_32
-long sys_iopl(struct pt_regs *regs)
+asmlinkage long sys_iopl(unsigned int level)
 {
-	unsigned int level = regs->bx;
 	struct thread_struct *t = &current->thread;
+	struct pt_regs *regs = task_pt_regs(current);
 	int rc;
 
 	rc = do_iopl(level, regs);
@@ -135,9 +134,3 @@ long sys_iopl(struct pt_regs *regs)
 out:
 	return rc;
 }
-#else
-asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs)
-{
-	return do_iopl(level, regs);
-}
-#endif

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* Re: [GIT PULL] x86/paravirt for v2.6.33
@ 2009-12-09 18:29 H. Peter Anvin
  2009-12-09 18:38 ` Linus Torvalds
  0 siblings, 1 reply; 17+ messages in thread
From: H. Peter Anvin @ 2009-12-09 18:29 UTC (permalink / raw)
  To: Jeremy Fitzhardinge, Ingo Molnar
  Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, Andrew Morton,
	Hugh Dickens

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

Linus clearly prefers the style with pt_regs passed on the stack as the sole form.  Since we *have* to use that form for things like clone(), it makes sense to use it as the only form.

For what it's worth I did look at this when the patch first came up; it does make the individual patch a fair bit uglier, but I can understand Linus' consistency argument.

As far as I know, we don't allow any system calls from inside v86 mode.


	-hpa

"Jeremy Fitzhardinge" <jeremy@goop.org> wrote:

>On 12/08/09 23:36, Ingo Molnar wrote:
>>> The old version that actually passed the stack frame was better. Why
>>> pick the inferior version?
>>>      
>> Yeah, agreed. I missed that detail.
>>    
>
>Which detail is that?  The whole patch? ;)
>
>> Jeremy, mind sending a patch that updates this code to use the less
>> obfuscated 32-bit version, not the 64-bit version? (a delta patch
>> against tip:master would be nice, as there's a fair amount of testing in
>> the unification change itself already, which we dont want to discard.)
>>    
>
>Sure.
>
>But I'm not sure I understand the objection to task_pt_regs(); is it 
>considered deprecated?   This patch received quite a lot of discussion 
>with no mention of it.  Should we consider all its uses as suspect?
>
>Would it be better to have something similar which just returns a 
>pointer to the saved [re]flags, since that's all we care about?  That 
>should be easier to make robust against
>
>     J

--
Sent from my mobile phone. Please excuse any lack of formatting.

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

end of thread, other threads:[~2009-12-09 21:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 21:09 [GIT PULL] x86/paravirt for v2.6.33 Ingo Molnar
2009-12-08 21:34 ` Linus Torvalds
2009-12-09  7:36   ` Ingo Molnar
2009-12-09 18:19     ` Jeremy Fitzhardinge
2009-12-09 18:31     ` Jeremy Fitzhardinge
2009-12-09 18:47       ` Linus Torvalds
2009-12-09 18:54         ` H. Peter Anvin
2009-12-09 19:08           ` Linus Torvalds
2009-12-09 19:25           ` Brian Gerst
2009-12-09 19:35             ` H. Peter Anvin
2009-12-09 19:32         ` Jeremy Fitzhardinge
2009-12-09 20:05           ` H. Peter Anvin
2009-12-09 18:49       ` H. Peter Anvin
2009-12-09 18:18   ` Jeremy Fitzhardinge
2009-12-09 21:58     ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2009-12-09 18:29 H. Peter Anvin
2009-12-09 18:38 ` Linus Torvalds

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