LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: WANG Cong <xiyou.wangcong@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: [PATCH 08/16] x86: use get_personality()
Date: Sat, 23 Feb 2008 16:14:11 +0800	[thread overview]
Message-ID: <12037545424136-git-send-email-xiyou.wangcong@gmail.com> (raw)
In-Reply-To: <12037545311452-git-send-email-xiyou.wangcong@gmail.com>

Use get_personality() macro instead of explicit reference
for x86 code.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc:  Ingo Molnar <mingo@redhat.com>

---
 arch/x86/ia32/sys_ia32.c     |    6 +++---
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    2 +-
 arch/x86/kernel/sys_x86_64.c |    2 +-
 arch/x86/mm/mmap.c           |    2 +-
 include/asm-x86/page.h       |    2 +-
 include/asm-x86/processor.h  |    2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index abf71d2..80e7431 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -666,7 +666,7 @@ asmlinkage long sys32_personality(unsigned long personality)
 {
 	int ret;
 
-	if (personality(current->personality) == PER_LINUX32 &&
+	if (personality(get_personality()) == PER_LINUX32 &&
 		personality == PER_LINUX)
 		personality = PER_LINUX32;
 	ret = sys_personality(personality);
@@ -744,7 +744,7 @@ asmlinkage long sys32_olduname(struct oldold_utsname __user *name)
 			      __OLD_UTS_LEN);
 	err |= __put_user(0, name->version+__OLD_UTS_LEN);
 
-	if (personality(current->personality) == PER_LINUX32)
+	if (personality(get_personality()) == PER_LINUX32)
 		arch = "i686";
 
 	err |= __copy_to_user(&name->machine, arch, strlen(arch) + 1);
@@ -765,7 +765,7 @@ long sys32_uname(struct old_utsname __user *name)
 	down_read(&uts_sem);
 	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/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index a7d50a5..c4992fc 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -837,7 +837,7 @@ unsigned long get_wchan(struct task_struct *p)
 
 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/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index b0cc8f0..8223f3f 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -915,7 +915,7 @@ long sys_arch_prctl(int code, unsigned long addr)
 
 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/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index bd802a5..0b7548b 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -247,7 +247,7 @@ asmlinkage long sys_uname(struct new_utsname __user * name)
 	down_read(&uts_sem);
 	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/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index 56fe712..f299d64 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -55,7 +55,7 @@ static int mmap_is_ia32(void)
 
 static int mmap_is_legacy(void)
 {
-	if (current->personality & ADDR_COMPAT_LAYOUT)
+	if (get_personality() & ADDR_COMPAT_LAYOUT)
 		return 1;
 
 	if (current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY)
diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h
index 1cb7c51..fd90c7a 100644
--- a/include/asm-x86/page.h
+++ b/include/asm-x86/page.h
@@ -42,7 +42,7 @@
 #define PAGE_OFFSET		((unsigned long)__PAGE_OFFSET)
 
 #define VM_DATA_DEFAULT_FLAGS \
-	(((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+	(((get_personality() & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
 	 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
 
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 45a2f0a..c426dc1 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -791,7 +791,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
 /* This decides where the kernel will search for a free chunk of vm
  * space during mmap's.
  */
-#define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? \
+#define IA32_PAGE_OFFSET ((get_personality() & ADDR_LIMIT_3GB) ? \
 			   0xc0000000 : 0xFFFFe000)
 
 #define TASK_SIZE 		(test_thread_flag(TIF_IA32) ? \
-- 
1.5.3.8


  reply	other threads:[~2008-02-23  8:33 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23  8:14 [PATCH 00/16] (Resend) Use get_personality() WANG Cong
2008-02-23  8:14 ` [PATCH 01/16] Make the macro get_personality function-like WANG Cong
2008-02-23  8:14   ` [PATCH 02/16] mm: use get_personality() WANG Cong
2008-02-23  8:14     ` [PATCH 03/16] fs: " WANG Cong
2008-02-23  8:14       ` [PATCH 04/16] powerpc: " WANG Cong
2008-02-23  8:14         ` [PATCH 05/16] parisc: " WANG Cong
2008-02-23  8:14           ` [PATCH 06/16] sparc(64): " WANG Cong
2008-02-23  8:14             ` [PATCH 07/16] arm: " WANG Cong
2008-02-23  8:14               ` WANG Cong [this message]
2008-02-23  8:14                 ` [PATCH 09/16] um: " WANG Cong
2008-02-23  8:14                   ` [PATCH 10/16] s390: " WANG Cong
2008-02-23  8:14                     ` [PATCH 11/16] mips: " WANG Cong
2008-02-23  8:14                       ` [PATCH 12/16] ia64: " WANG Cong
2008-02-23  8:14                         ` [PATCH 13/16] alpha: " WANG Cong
2008-02-23  8:14                           ` [PATCH 14/16] frv: " WANG Cong
2008-02-23  8:14                             ` [PATCH 15/16] mn10300: " WANG Cong
2008-02-23  8:14                               ` [PATCH 16/16] kernel: " WANG Cong
2008-02-23 12:03                             ` [PATCH 15/16] mn10300: " David Howells
2008-02-23 12:02                           ` [PATCH 14/16] frv: " David Howells
2008-02-23 10:08                 ` [PATCH 08/16] x86: " Ingo Molnar
2008-02-23 10:19                   ` Ingo Molnar
2008-02-23 10:39                     ` WANG Cong
2008-02-23  9:06           ` Accessor macros vs reference counting Matthew Wilcox
2008-02-23 12:46             ` David Newall
2008-02-23 14:56               ` Matthew Wilcox
2008-02-23  8:58   ` [PATCH 01/16] Make the macro get_personality function-like Bryan Wu
2008-02-23  8:51 ` [PATCH 00/16] (Resend) Use get_personality() Alexey Dobriyan
2008-02-23  8:59   ` WANG Cong
2008-02-23  9:27     ` Alexey Dobriyan
2008-02-23  9:56       ` WANG Cong
2008-02-23 18:37       ` Christoph Hellwig
2008-02-23 19:16         ` Andrew Morton
2008-02-24  4:03           ` WANG Cong
2008-02-25  2:14           ` [PATCH] Remove the macro get_personality WANG Cong
2008-02-23 12:02 ` [PATCH 01/16] Make the macro get_personality function-like David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12037545424136-git-send-email-xiyou.wangcong@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --subject='Re: [PATCH 08/16] x86: use get_personality()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).