Re: [PATCH 1/4] x86: Save return value from kernel_thread

2016-05-21 Thread Brian Gerst
On Sat, May 21, 2016 at 9:44 PM, Andy Lutomirski  wrote:
> On Sat, May 21, 2016 at 9:04 AM, Brian Gerst  wrote:
>> Kernel threads should always return zero on success after calling 
>> do_execve().  The
>> two existing cases in the kernel (kernel_init() and 
>> call_usermodehelper_exec_async())
>> correctly do this.  Save a few bytes by storing EAX/RAX instead of an 
>> immediate zero.
>> Also fix the 64-bit case which should save the full 64-bits.
>
> Does this have any additional motivation beyond cleanup and fixing an
> inconsequential bug?  I.e. does the rest of your series need this?
>
> --Andy

It's just a minor cleanup, not necessary.

--
Brian Gerst


Re: [PATCH 1/4] x86: Save return value from kernel_thread

2016-05-21 Thread Brian Gerst
On Sat, May 21, 2016 at 9:44 PM, Andy Lutomirski  wrote:
> On Sat, May 21, 2016 at 9:04 AM, Brian Gerst  wrote:
>> Kernel threads should always return zero on success after calling 
>> do_execve().  The
>> two existing cases in the kernel (kernel_init() and 
>> call_usermodehelper_exec_async())
>> correctly do this.  Save a few bytes by storing EAX/RAX instead of an 
>> immediate zero.
>> Also fix the 64-bit case which should save the full 64-bits.
>
> Does this have any additional motivation beyond cleanup and fixing an
> inconsequential bug?  I.e. does the rest of your series need this?
>
> --Andy

It's just a minor cleanup, not necessary.

--
Brian Gerst


Re: [PATCH 1/4] x86: Save return value from kernel_thread

2016-05-21 Thread Andy Lutomirski
On Sat, May 21, 2016 at 9:04 AM, Brian Gerst  wrote:
> Kernel threads should always return zero on success after calling 
> do_execve().  The
> two existing cases in the kernel (kernel_init() and 
> call_usermodehelper_exec_async())
> correctly do this.  Save a few bytes by storing EAX/RAX instead of an 
> immediate zero.
> Also fix the 64-bit case which should save the full 64-bits.

Does this have any additional motivation beyond cleanup and fixing an
inconsequential bug?  I.e. does the rest of your series need this?

--Andy


Re: [PATCH 1/4] x86: Save return value from kernel_thread

2016-05-21 Thread Andy Lutomirski
On Sat, May 21, 2016 at 9:04 AM, Brian Gerst  wrote:
> Kernel threads should always return zero on success after calling 
> do_execve().  The
> two existing cases in the kernel (kernel_init() and 
> call_usermodehelper_exec_async())
> correctly do this.  Save a few bytes by storing EAX/RAX instead of an 
> immediate zero.
> Also fix the 64-bit case which should save the full 64-bits.

Does this have any additional motivation beyond cleanup and fixing an
inconsequential bug?  I.e. does the rest of your series need this?

--Andy


[PATCH 1/4] x86: Save return value from kernel_thread

2016-05-21 Thread Brian Gerst
Kernel threads should always return zero on success after calling do_execve().  
The
two existing cases in the kernel (kernel_init() and 
call_usermodehelper_exec_async())
correctly do this.  Save a few bytes by storing EAX/RAX instead of an immediate 
zero.
Also fix the 64-bit case which should save the full 64-bits.

Signed-off-by: Brian Gerst 
---
 arch/x86/entry/entry_32.S | 2 +-
 arch/x86/entry/entry_64.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 983e5d3..ee6fea0 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -221,7 +221,7 @@ ENTRY(ret_from_kernel_thread)
popl%eax
movlPT_EBP(%esp), %eax
call*PT_EBX(%esp)
-   movl$0, PT_EAX(%esp)
+   movl%eax, PT_EAX(%esp)
 
/*
 * Kernel threads return to userspace as if returning from a syscall.
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 9ee0da1..ab9f8c8 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -387,7 +387,7 @@ ENTRY(ret_from_fork)
 */
movqRBP(%rsp), %rdi
call*RBX(%rsp)
-   movl$0, RAX(%rsp)
+   movq%rax, RAX(%rsp)
 
/*
 * Fall through as though we're exiting a syscall.  This makes a
-- 
2.5.5



[PATCH 1/4] x86: Save return value from kernel_thread

2016-05-21 Thread Brian Gerst
Kernel threads should always return zero on success after calling do_execve().  
The
two existing cases in the kernel (kernel_init() and 
call_usermodehelper_exec_async())
correctly do this.  Save a few bytes by storing EAX/RAX instead of an immediate 
zero.
Also fix the 64-bit case which should save the full 64-bits.

Signed-off-by: Brian Gerst 
---
 arch/x86/entry/entry_32.S | 2 +-
 arch/x86/entry/entry_64.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 983e5d3..ee6fea0 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -221,7 +221,7 @@ ENTRY(ret_from_kernel_thread)
popl%eax
movlPT_EBP(%esp), %eax
call*PT_EBX(%esp)
-   movl$0, PT_EAX(%esp)
+   movl%eax, PT_EAX(%esp)
 
/*
 * Kernel threads return to userspace as if returning from a syscall.
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 9ee0da1..ab9f8c8 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -387,7 +387,7 @@ ENTRY(ret_from_fork)
 */
movqRBP(%rsp), %rdi
call*RBX(%rsp)
-   movl$0, RAX(%rsp)
+   movq%rax, RAX(%rsp)
 
/*
 * Fall through as though we're exiting a syscall.  This makes a
-- 
2.5.5