From patchwork Thu May 19 12:50:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 68125 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3183045qge; Thu, 19 May 2016 05:50:53 -0700 (PDT) X-Received: by 10.98.26.18 with SMTP id a18mr3971857pfa.39.1463662251604; Thu, 19 May 2016 05:50:51 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o25si19891381pfa.151.2016.05.19.05.50.51; Thu, 19 May 2016 05:50:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755007AbcESMus (ORCPT + 29 others); Thu, 19 May 2016 08:50:48 -0400 Received: from foss.arm.com ([217.140.101.70]:34850 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754829AbcESMup (ORCPT ); Thu, 19 May 2016 08:50:45 -0400 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)" 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 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- Catalin 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))