All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: fix /proc/cpuinfo for elf32
@ 2016-04-25  3:37 ` Zeng Tao
  0 siblings, 0 replies; 13+ messages in thread
From: Zeng Tao @ 2016-04-25  3:37 UTC (permalink / raw)
  To: linux-arm-kernel

For elf32 thread, personality is used for arm32,
and thread_flag for arm64.

Here personality is used for arm64, so fix it.

Signed-off-by: Zeng Tao <prime.zeng@huawei.com>
---
 arch/arm64/kernel/cpuinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index 84c8684..f739398 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -126,7 +126,7 @@ static int c_show(struct seq_file *m, void *v)
 		 * software which does already (at least for 32-bit).
 		 */
 		seq_puts(m, "Features\t:");
-		if (personality(current->personality) == PER_LINUX32) {
+		if (test_thread_flag(TIF_32BIT)) {
 #ifdef CONFIG_COMPAT
 			for (j = 0; compat_hwcap_str[j]; j++)
 				if (compat_elf_hwcap & (1 << j))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: fix /proc/cpuinfo for elf32
@ 2016-04-26  2:07 Zengtao (B)
  0 siblings, 0 replies; 13+ messages in thread
From: Zengtao (B) @ 2016-04-26  2:07 UTC (permalink / raw)
  To: catalin.marinas@arm.com
  Cc: Zengtao (B), linux-arm-kernel@lists.infradead.org,
	mark.rutland@arm.com, suzuki.poulose@arm.com, will.deacon@arm.com,
	james.morse@arm.com, linux-kernel@vger.kernel.org,
	yang.shi@linaro.org

On 2016-04-25 09:12, Catalin Marinas wrote:
> On Mon, Apr 25, 2016 at 11:37:33AM +0800, Zeng Tao wrote:
> > For elf32 thread, personality is used for arm32,
> > and thread_flag for arm64.
> > 
> > Here personality is used for arm64, so fix it.
> > 
> > Signed-off-by: Zeng Tao <prime.zeng@huawei.com>
> > ---
> >  arch/arm64/kernel/cpuinfo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> 
> We discussed this some time ago and we decided against it. One reason
> was scripts where you may or may not end up with the desired cpuinfo
> (e.g. grep being 64-bit invoked by a 32-bit bash). The personality at
> least is inherited by child processes.
> 
So you mean the 64-bit grep should see the same cpuinfo as 32-bit bash as 
It is the child process?
But currently we have same 32-bit application which don't have their
personality set, so they get the wrong cpuinfo. 
How to fix, call the personality syscall?  

> -- 
> Catalin
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
> 

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

end of thread, other threads:[~2016-04-27 10:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25  3:37 [PATCH] arm64: fix /proc/cpuinfo for elf32 Zeng Tao
2016-04-25  3:37 ` Zeng Tao
2016-04-25  9:12 ` Catalin Marinas
2016-04-25  9:12   ` Catalin Marinas
2016-04-26  2:21   ` Zengtao (B)
2016-04-26  2:21     ` Zengtao (B)
2016-04-26  9:20     ` Suzuki K Poulose
2016-04-26  9:20       ` Suzuki K Poulose
2016-04-27  2:13       ` Zengtao (B)
2016-04-27  2:13         ` Zengtao (B)
2016-04-27 10:24         ` Catalin Marinas
2016-04-27 10:24           ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2016-04-26  2:07 Zengtao (B)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.