Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753673AbcDYJMp (ORCPT ); Mon, 25 Apr 2016 05:12:45 -0400 Received: from foss.arm.com ([217.140.101.70]:44202 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbcDYJMo (ORCPT ); Mon, 25 Apr 2016 05:12:44 -0400 Date: Mon, 25 Apr 2016 10:12:39 +0100 From: Catalin Marinas To: Zeng Tao Cc: will.deacon@arm.com, mark.rutland@arm.com, yang.shi@linaro.org, suzuki.poulose@arm.com, linux-kernel@vger.kernel.org, james.morse@arm.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: fix /proc/cpuinfo for elf32 Message-ID: <20160425091239.GB9614@e104818-lin.cambridge.arm.com> References: <1461555453-60440-1-git-send-email-prime.zeng@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461555453-60440-1-git-send-email-prime.zeng@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1157 Lines: 32 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 > --- > 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)) 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. -- Catalin