From patchwork Thu May 19 12:50:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 9127587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCE1760873 for ; Thu, 19 May 2016 13:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5D4A2825F for ; Thu, 19 May 2016 12:52:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA44D28261; Thu, 19 May 2016 12:52:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6471A2825F for ; Thu, 19 May 2016 12:52:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b3NQ5-0006fg-T1; Thu, 19 May 2016 12:51:17 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b3NPu-0006Uy-VB for linux-arm-kernel@lists.infradead.org; Thu, 19 May 2016 12:51:07 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 930442F; Thu, 19 May 2016 05:51:03 -0700 (PDT) Received: from e104818-lin.cambridge.arm.com (e104818-lin.cambridge.arm.com [10.1.203.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 847793F213; Thu, 19 May 2016 05:50:43 -0700 (PDT) Date: Thu, 19 May 2016 13:50:40 +0100 From: Catalin Marinas To: "Xiaqing (A)" Subject: Re: [PATCH] arm64: cpuinfo: add AArch64 & elf platform for app compatibility Message-ID: <20160519125039.GN22378@e104818-lin.cambridge.arm.com> References: <1463625873-60016-1-git-send-email-saberlily.xia@hisilicon.com> <20160519104925.GL22378@e104818-lin.cambridge.arm.com> <573D9E40.4000705@hisilicon.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <573D9E40.4000705@hisilicon.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160519_055107_017839_2AD231D5 X-CRM114-Status: GOOD ( 13.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linaro-kernel@lists.linaro.org, puck.chen@hisilicon.com, suzhuangluan@hisilicon.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, May 19, 2016 at 07:06:40PM +0800, Xiaqing (A) wrote: > > > ? 2016/5/19 18:49, Catalin Marinas ??: > >On Thu, May 19, 2016 at 10:44:33AM +0800, x00195127 wrote: > >>we find that some apps will read cpuinfo when start up, > >>they need the string as follows: > >>"Processor : AArch64 Processor rev 0 (aarch64)" > >> > >>Then thay could load the corresponding libs. But now > >>arm64 platform's cpuinfo don't has this now, so > >>we need add this. > > > >I have the same question as Martinez: what are those apps? If they are > >64-bit apps, they can always assume AArch64 processor. > > Those are 32-bit apps, and those apps are very popular in our country. 32-bit apps checking for "AArch64" is a really silly idea. What do they do with this information? I'm rather inclined to merge this patch: As discussed here: http://article.gmane.org/gmane.linux.kernel/2209217 diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 3808470486f3..623d7d291dd6 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -127,7 +127,8 @@ 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 (is_compat_task() || + personality(current->personality) == PER_LINUX32) { #ifdef CONFIG_COMPAT for (j = 0; compat_hwcap_str[j]; j++) if (compat_elf_hwcap & (1 << j))