[PATCH 09/16] um: use get_personality()

2008-02-23 Thread WANG Cong
Use get_personality() macro instead of explicit reference for
uml code.

Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
Cc: Jeff Dike <[EMAIL PROTECTED]>

---
 arch/um/kernel/process.c   |2 +-
 arch/um/sys-x86_64/syscalls.c  |2 +-
 include/asm-um/vm-flags-i386.h |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index fc50d2f..91e0a84 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -405,7 +405,7 @@ int singlestepping(void * t)
 #ifndef arch_align_stack
 unsigned long arch_align_stack(unsigned long sp)
 {
-   if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
+   if (!(get_personality() & ADDR_NO_RANDOMIZE) && randomize_va_space)
sp -= get_random_int() % 8192;
return sp & ~0xf;
 }
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index f1199fd..cf7b61e 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -20,7 +20,7 @@ asmlinkage long sys_uname64(struct new_utsname __user * name)
err = copy_to_user(name, utsname(), sizeof (*name));
up_read(_sem);
 
-   if (personality(current->personality) == PER_LINUX32)
+   if (personality(get_personality()) == PER_LINUX32)
err |= copy_to_user(>machine, "i686", 5);
 
return err ? -EFAULT : 0;
diff --git a/include/asm-um/vm-flags-i386.h b/include/asm-um/vm-flags-i386.h
index e0d24c5..c30e0f6 100644
--- a/include/asm-um/vm-flags-i386.h
+++ b/include/asm-um/vm-flags-i386.h
@@ -8,7 +8,7 @@
 
 #define VM_DATA_DEFAULT_FLAGS \
(VM_READ | VM_WRITE | \
-   ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+   ((get_personality() & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
 #endif
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 09/16] um: use get_personality()

2008-02-23 Thread WANG Cong
Use get_personality() macro instead of explicit reference for
uml code.

Signed-off-by: WANG Cong [EMAIL PROTECTED]
Cc: Jeff Dike [EMAIL PROTECTED]

---
 arch/um/kernel/process.c   |2 +-
 arch/um/sys-x86_64/syscalls.c  |2 +-
 include/asm-um/vm-flags-i386.h |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index fc50d2f..91e0a84 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -405,7 +405,7 @@ int singlestepping(void * t)
 #ifndef arch_align_stack
 unsigned long arch_align_stack(unsigned long sp)
 {
-   if (!(current-personality  ADDR_NO_RANDOMIZE)  randomize_va_space)
+   if (!(get_personality()  ADDR_NO_RANDOMIZE)  randomize_va_space)
sp -= get_random_int() % 8192;
return sp  ~0xf;
 }
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index f1199fd..cf7b61e 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -20,7 +20,7 @@ asmlinkage long sys_uname64(struct new_utsname __user * name)
err = copy_to_user(name, utsname(), sizeof (*name));
up_read(uts_sem);
 
-   if (personality(current-personality) == PER_LINUX32)
+   if (personality(get_personality()) == PER_LINUX32)
err |= copy_to_user(name-machine, i686, 5);
 
return err ? -EFAULT : 0;
diff --git a/include/asm-um/vm-flags-i386.h b/include/asm-um/vm-flags-i386.h
index e0d24c5..c30e0f6 100644
--- a/include/asm-um/vm-flags-i386.h
+++ b/include/asm-um/vm-flags-i386.h
@@ -8,7 +8,7 @@
 
 #define VM_DATA_DEFAULT_FLAGS \
(VM_READ | VM_WRITE | \
-   ((current-personality  READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+   ((get_personality()  READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
 #endif
-- 
1.5.3.8

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 09/16] um: use get_personality()

2008-02-22 Thread Andrew Morton
On Fri, 22 Feb 2008 20:39:00 +0800 (CST) WANG Cong <[EMAIL PROTECTED]> wrote:

> From: Jeff Dike <[EMAIL PROTECTED]>
> Subject: Re: [PATCH 09/16] um: use get_personality()
> Date: Wed, 20 Feb 2008 11:27:34 -0500
> Message-ID: <[EMAIL PROTECTED]>
> 
> > On Wed, Feb 20, 2008 at 07:19:13PM +0800, WANG Cong wrote:
> > > Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
> > 
> > Looks good - you should add some sort of changelog though.
> > 
> 
> Thanks, Jeff.
> 
> It seems that you're the only one who received this patchset of mine.
> And I found that lkml.org didn't receive these neither. ;(
> 
> I don't know if Andrew received all of them, if not, I must resend.
> 

No, I don't seem to have received them.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 09/16] um: use get_personality()

2008-02-22 Thread WANG Cong
From: Jeff Dike <[EMAIL PROTECTED]>
Subject: Re: [PATCH 09/16] um: use get_personality()
Date: Wed, 20 Feb 2008 11:27:34 -0500
Message-ID: <[EMAIL PROTECTED]>

> On Wed, Feb 20, 2008 at 07:19:13PM +0800, WANG Cong wrote:
> > Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
> 
> Looks good - you should add some sort of changelog though.
> 

Thanks, Jeff.

It seems that you're the only one who received this patchset of mine.
And I found that lkml.org didn't receive these neither. ;(

I don't know if Andrew received all of them, if not, I must resend.

Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 09/16] um: use get_personality()

2008-02-22 Thread WANG Cong
From: Jeff Dike [EMAIL PROTECTED]
Subject: Re: [PATCH 09/16] um: use get_personality()
Date: Wed, 20 Feb 2008 11:27:34 -0500
Message-ID: [EMAIL PROTECTED]

 On Wed, Feb 20, 2008 at 07:19:13PM +0800, WANG Cong wrote:
  Signed-off-by: WANG Cong [EMAIL PROTECTED]
 
 Looks good - you should add some sort of changelog though.
 

Thanks, Jeff.

It seems that you're the only one who received this patchset of mine.
And I found that lkml.org didn't receive these neither. ;(

I don't know if Andrew received all of them, if not, I must resend.

Regards.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 09/16] um: use get_personality()

2008-02-22 Thread Andrew Morton
On Fri, 22 Feb 2008 20:39:00 +0800 (CST) WANG Cong [EMAIL PROTECTED] wrote:

 From: Jeff Dike [EMAIL PROTECTED]
 Subject: Re: [PATCH 09/16] um: use get_personality()
 Date: Wed, 20 Feb 2008 11:27:34 -0500
 Message-ID: [EMAIL PROTECTED]
 
  On Wed, Feb 20, 2008 at 07:19:13PM +0800, WANG Cong wrote:
   Signed-off-by: WANG Cong [EMAIL PROTECTED]
  
  Looks good - you should add some sort of changelog though.
  
 
 Thanks, Jeff.
 
 It seems that you're the only one who received this patchset of mine.
 And I found that lkml.org didn't receive these neither. ;(
 
 I don't know if Andrew received all of them, if not, I must resend.
 

No, I don't seem to have received them.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 09/16] um: use get_personality()

2008-02-20 Thread Jeff Dike
On Wed, Feb 20, 2008 at 07:19:13PM +0800, WANG Cong wrote:
> Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

Looks good - you should add some sort of changelog though.

Jeff

-- 
Work email - jdike at linux dot intel dot com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 09/16] um: use get_personality()

2008-02-20 Thread Jeff Dike
On Wed, Feb 20, 2008 at 07:19:13PM +0800, WANG Cong wrote:
 Signed-off-by: WANG Cong [EMAIL PROTECTED]

Looks good - you should add some sort of changelog though.

Jeff

-- 
Work email - jdike at linux dot intel dot com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/