From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 05/19] arm64: rename COMPAT to AARCH32_EL0 in Kconfig Date: Thu, 11 Aug 2016 10:53:01 +0200 Message-ID: <3043310.yXUR8Er0VK@wuerfel> References: <1466207668-10549-1-git-send-email-ynorov@caviumnetworks.com> <1466207668-10549-6-git-send-email-ynorov@caviumnetworks.com> <57AC2AA5.1030808@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <57AC2AA5.1030808@huawei.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: "Zhangjian (Bamvor)" Cc: linux-doc@vger.kernel.org, szabolcs.nagy@arm.com, catalin.marinas@arm.com, heiko.carstens@de.ibm.com, Yury Norov , Hanjun Guo , philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, linux-arch@vger.kernel.org, Prasun.Kapoor@caviumnetworks.com, agraf@suse.de, Andrew Pinski , geert@linux-m68k.org, kilobyte@angband.pl, manuel.montezelo@gmail.com, pinskia@gmail.com, linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, Bamvor Jian Zhang , linux-arm-kernel@lists.infradead.org, maxim.kuvyrkov@linaro.org, libc-alpha@sourceware.org, Nathan_Lynch@mentor.com, linux-kernel@vger.kernel.org, Andrew Pinski , schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com List-Id: linux-arch.vger.kernel.org On Thursday, August 11, 2016 3:35:01 PM CEST Zhangjian (Bamvor) wrote: > On 2016/6/18 7:54, Yury Norov wrote: > > From: Andrew Pinski > > > > In this patchset ILP32 ABI support is added. Additionally to AARCH32, > > which is binary-compatible with ARM, ILP32 is (mostly) ABI-compatible. > > > > From now, AARCH32_EL0 (former COMPAT) config option means the support of > > AARCH32 userspace, ARM64_ILP32 - support of ILP32 ABI (see next patches), > > and COMPAT indicates that one of them, or both, is enabled. > > > > Where needed, CONFIG_COMPAT is changed over to use CONFIG_AARCH32_EL0 instead > > > > Reviewed-by: David Daney > > Signed-off-by: Andrew Pinski > > Signed-off-by: Philipp Tomsich > > Signed-off-by: Christoph Muellner > > Signed-off-by: Bamvor Jian Zhang > > Signed-off-by: Yury Norov > ... > > diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c > > index c173d32..af200a8 100644 > > --- a/arch/arm64/kernel/cpuinfo.c > > +++ b/arch/arm64/kernel/cpuinfo.c > > @@ -134,15 +134,17 @@ static int c_show(struct seq_file *m, void *v) > > */ > > seq_puts(m, "Features\t:"); > > if (compat) { > > -#ifdef CONFIG_COMPAT > > - for (j = 0; compat_hwcap_str[j]; j++) > > - if (compat_elf_hwcap & (1 << j)) > > - seq_printf(m, " %s", compat_hwcap_str[j]); > > - > > - for (j = 0; compat_hwcap2_str[j]; j++) > > - if (compat_elf_hwcap2 & (1 << j)) > > - seq_printf(m, " %s", compat_hwcap2_str[j]); > > -#endif /* CONFIG_COMPAT */ > > +#ifdef CONFIG_AARCH32_EL0 > I saw that compat_hwcap_str and compat_hwcap2_str is defined when > "CONFIG_COMPAT" is true. Why we only change it to CONFIG_AARCH32_EL0 > in c show()? > > + if (personality(current->personality) == PER_LINUX32) { > And "compat" is "personality(current->personality) == PER_LINUX32;", > it seems that there is no need to add this twice. I think it would be best to remove the #ifdef here completely, the PER_LINUX32 concept is not strictly tied to the emulation of ARM binaries, it literally just changes the output of /proc/cpuinfo and 'uname', and you can have ARM binaries with PER_LINUX (using the arm64 uname) just like you can have arm64 binaries running with PER_LINUX32. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de ([212.227.126.134]:58744 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932787AbcHKIyX (ORCPT ); Thu, 11 Aug 2016 04:54:23 -0400 From: Arnd Bergmann Subject: Re: [PATCH 05/19] arm64: rename COMPAT to AARCH32_EL0 in Kconfig Date: Thu, 11 Aug 2016 10:53:01 +0200 Message-ID: <3043310.yXUR8Er0VK@wuerfel> In-Reply-To: <57AC2AA5.1030808@huawei.com> References: <1466207668-10549-1-git-send-email-ynorov@caviumnetworks.com> <1466207668-10549-6-git-send-email-ynorov@caviumnetworks.com> <57AC2AA5.1030808@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-arch-owner@vger.kernel.org List-ID: To: "Zhangjian (Bamvor)" Cc: Yury Norov , catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, pinskia@gmail.com, broonie@kernel.org, joseph@codesourcery.com, christoph.muellner@theobroma-systems.com, szabolcs.nagy@arm.com, klimov.linux@gmail.com, Nathan_Lynch@mentor.com, agraf@suse.de, Prasun.Kapoor@caviumnetworks.com, kilobyte@angband.pl, geert@linux-m68k.org, philipp.tomsich@theobroma-systems.com, manuel.montezelo@gmail.com, linyongting@huawei.com, maxim.kuvyrkov@linaro.org, davem@davemloft.net, Andrew Pinski , Andrew Pinski , Bamvor Jian Zhang , Hanjun Guo Message-ID: <20160811085301.BzyR2yvtl0sev_kPr2pc-4xc4mLpH3WkJPkgPzZ23tI@z> On Thursday, August 11, 2016 3:35:01 PM CEST Zhangjian (Bamvor) wrote: > On 2016/6/18 7:54, Yury Norov wrote: > > From: Andrew Pinski > > > > In this patchset ILP32 ABI support is added. Additionally to AARCH32, > > which is binary-compatible with ARM, ILP32 is (mostly) ABI-compatible. > > > > From now, AARCH32_EL0 (former COMPAT) config option means the support of > > AARCH32 userspace, ARM64_ILP32 - support of ILP32 ABI (see next patches), > > and COMPAT indicates that one of them, or both, is enabled. > > > > Where needed, CONFIG_COMPAT is changed over to use CONFIG_AARCH32_EL0 instead > > > > Reviewed-by: David Daney > > Signed-off-by: Andrew Pinski > > Signed-off-by: Philipp Tomsich > > Signed-off-by: Christoph Muellner > > Signed-off-by: Bamvor Jian Zhang > > Signed-off-by: Yury Norov > ... > > diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c > > index c173d32..af200a8 100644 > > --- a/arch/arm64/kernel/cpuinfo.c > > +++ b/arch/arm64/kernel/cpuinfo.c > > @@ -134,15 +134,17 @@ static int c_show(struct seq_file *m, void *v) > > */ > > seq_puts(m, "Features\t:"); > > if (compat) { > > -#ifdef CONFIG_COMPAT > > - for (j = 0; compat_hwcap_str[j]; j++) > > - if (compat_elf_hwcap & (1 << j)) > > - seq_printf(m, " %s", compat_hwcap_str[j]); > > - > > - for (j = 0; compat_hwcap2_str[j]; j++) > > - if (compat_elf_hwcap2 & (1 << j)) > > - seq_printf(m, " %s", compat_hwcap2_str[j]); > > -#endif /* CONFIG_COMPAT */ > > +#ifdef CONFIG_AARCH32_EL0 > I saw that compat_hwcap_str and compat_hwcap2_str is defined when > "CONFIG_COMPAT" is true. Why we only change it to CONFIG_AARCH32_EL0 > in c show()? > > + if (personality(current->personality) == PER_LINUX32) { > And "compat" is "personality(current->personality) == PER_LINUX32;", > it seems that there is no need to add this twice. I think it would be best to remove the #ifdef here completely, the PER_LINUX32 concept is not strictly tied to the emulation of ARM binaries, it literally just changes the output of /proc/cpuinfo and 'uname', and you can have ARM binaries with PER_LINUX (using the arm64 uname) just like you can have arm64 binaries running with PER_LINUX32. Arnd