From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8A08C433E0 for ; Thu, 14 May 2020 01:45:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C313E2054F for ; Thu, 14 May 2020 01:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728100AbgENBpe (ORCPT ); Wed, 13 May 2020 21:45:34 -0400 Received: from foss.arm.com ([217.140.110.172]:56460 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgENBpe (ORCPT ); Wed, 13 May 2020 21:45:34 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B6E3531B; Wed, 13 May 2020 18:45:33 -0700 (PDT) Received: from [10.163.73.129] (unknown [10.163.73.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 924303F305; Wed, 13 May 2020 18:45:30 -0700 (PDT) Subject: Re: [PATCH V2] arm64/cpuinfo: Move HWCAP name arrays alongside their bit definitions To: Dave Martin Cc: linux-arm-kernel@lists.infradead.org, Mark Rutland , Catalin Marinas , Suzuki K Poulose , linux-kernel@vger.kernel.org, Mark Brown , Will Deacon , Ard Biesheuvel References: <1588858150-26823-1-git-send-email-anshuman.khandual@arm.com> <20200513150405.GS21779@arm.com> From: Anshuman Khandual Message-ID: <0999fa28-3ee7-3f02-4def-a0c6013ec6dd@arm.com> Date: Thu, 14 May 2020 07:14:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200513150405.GS21779@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/13/2020 08:34 PM, Dave Martin wrote: > On Thu, May 07, 2020 at 06:59:10PM +0530, Anshuman Khandual wrote: >> All HWCAP name arrays (i.e hwcap_str, compat_hwcap_str, compat_hwcap2_str) >> that are scanned for /proc/cpuinfo output are detached from their bit fild >> definitions making it difficult to corelate. This is also bit problematic >> because during /proc/cpuinfo dump these arrays get traversed sequentially >> assuming that they reflect and match HWCAP bit sequence, to test various >> features for a given CPU. >> >> This moves all HWCAP name arrays near their bit definitions. But first it >> defines all missing COMPAT_HWCAP_XXX that are present in the name string. >> >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Mark Brown >> Cc: Ard Biesheuvel >> Cc: Mark Rutland >> Cc: Suzuki K Poulose >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-kernel@vger.kernel.org >> >> Signed-off-by: Anshuman Khandual >> Acked-by: Mark Rutland >> --- >> This applies on 5.7-rc4 >> >> Changes in V2: >> >> - Defined COMPAT_KERNEL_HWCAP[2] and updated the name arrays per Mark >> - Updated the commit message as required >> >> Changes in V1: (https://patchwork.kernel.org/patch/11532945/) >> >> arch/arm64/include/asm/hwcap.h | 101 +++++++++++++++++++++++++++++++++ >> arch/arm64/kernel/cpuinfo.c | 90 ----------------------------- >> 2 files changed, 101 insertions(+), 90 deletions(-) >> >> diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h >> index 0f00265248b5..589ac02e1ddd 100644 >> --- a/arch/arm64/include/asm/hwcap.h >> +++ b/arch/arm64/include/asm/hwcap.h >> @@ -8,18 +8,27 @@ >> #include >> #include >> >> +#define COMPAT_HWCAP_SWP (1 << 0) >> #define COMPAT_HWCAP_HALF (1 << 1) >> #define COMPAT_HWCAP_THUMB (1 << 2) >> +#define COMPAT_HWCAP_26BIT (1 << 3) >> #define COMPAT_HWCAP_FAST_MULT (1 << 4) >> +#define COMPAT_HWCAP_FPA (1 << 5) >> #define COMPAT_HWCAP_VFP (1 << 6) >> #define COMPAT_HWCAP_EDSP (1 << 7) >> +#define COMPAT_HWCAP_JAVA (1 << 8) >> +#define COMPAT_HWCAP_IWMMXT (1 << 9) >> +#define COMPAT_HWCAP_CRUNCH (1 << 10) >> +#define COMPAT_HWCAP_THUMBEE (1 << 11) >> #define COMPAT_HWCAP_NEON (1 << 12) >> #define COMPAT_HWCAP_VFPv3 (1 << 13) >> +#define COMPAT_HWCAP_VFPV3D16 (1 << 14) >> #define COMPAT_HWCAP_TLS (1 << 15) >> #define COMPAT_HWCAP_VFPv4 (1 << 16) >> #define COMPAT_HWCAP_IDIVA (1 << 17) >> #define COMPAT_HWCAP_IDIVT (1 << 18) >> #define COMPAT_HWCAP_IDIV (COMPAT_HWCAP_IDIVA|COMPAT_HWCAP_IDIVT) >> +#define COMPAT_HWCAP_VFPD32 (1 << 19) >> #define COMPAT_HWCAP_LPAE (1 << 20) >> #define COMPAT_HWCAP_EVTSTRM (1 << 21) > > With the possible exception of SWP (does the swp emulation allow us to > report this as supported?), I think all these weren't mentioned because > they aren't included in ARMv8 and so can never be reported. > > If we find ourselves reporting them, there's a bug somewhere. > > So, can we just default all obsolete string entries to NULL? > > When generating the cpuinfo strings we could WARN and just emit an empty > string for that hwcap. All these above will be a change in the existing user visible behavior on the system and this patch never intended to create one. Hence, I will just defer this to maintainers on whether we should change existing /proc/cpuinfo output (including non-practically-possible ones on ARMv8) or even treat swap emulation as SWP. But IMHO, in case we decide to go for a /proc/cpuinfo change (which I would be happy implement), it should be applied over and above this patch which just preserved existing semantics and behavior. - Anshuman From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C88DC433E0 for ; Thu, 14 May 2020 01:45:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FBA82054F for ; Thu, 14 May 2020 01:45:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="V1gyMP+f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FBA82054F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+7bpHPaK6B6nd3poyA4NpA9RyeGDRTA9PMBrNq6lkPY=; b=V1gyMP+fLrUI+S we7TwkwdffkPdfENiJOUD5HToBUo1TJHI3zIZXIJVXZ5or6XIp4F1ZRJ2oRX3hzdLlueHEbqsoWvp feGuUyOV04tG2IrkhhRyzX6ppZ0zPVIoinK2/W2Xqli6Bzz9ADREt+8npoKIuAQiDM9WgFfDk0HLh uPw/Ox+/9u2AQ4yT9bPoRhcpC0ybXsMgREh0LsZcrfT5QCYkUK8Gj6xkSxadHgwPFdk40Ydd2ggZw 2ZWjSGXzA9W4KJbMo270QVBQX91bdrHlTvKitfQWf54yD7urzb1io0hvLqW8wf4gIvEiRj510xw3N ejCTqTAKk4uGwpEbG34g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZ2wN-0005m4-Bd; Thu, 14 May 2020 01:45:39 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZ2wJ-0005jF-4Y for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 01:45:36 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B6E3531B; Wed, 13 May 2020 18:45:33 -0700 (PDT) Received: from [10.163.73.129] (unknown [10.163.73.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 924303F305; Wed, 13 May 2020 18:45:30 -0700 (PDT) Subject: Re: [PATCH V2] arm64/cpuinfo: Move HWCAP name arrays alongside their bit definitions To: Dave Martin References: <1588858150-26823-1-git-send-email-anshuman.khandual@arm.com> <20200513150405.GS21779@arm.com> From: Anshuman Khandual Message-ID: <0999fa28-3ee7-3f02-4def-a0c6013ec6dd@arm.com> Date: Thu, 14 May 2020 07:14:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200513150405.GS21779@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200513_184535_267823_CB373943 X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Suzuki K Poulose , Catalin Marinas , linux-kernel@vger.kernel.org, Mark Brown , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 05/13/2020 08:34 PM, Dave Martin wrote: > On Thu, May 07, 2020 at 06:59:10PM +0530, Anshuman Khandual wrote: >> All HWCAP name arrays (i.e hwcap_str, compat_hwcap_str, compat_hwcap2_str) >> that are scanned for /proc/cpuinfo output are detached from their bit fild >> definitions making it difficult to corelate. This is also bit problematic >> because during /proc/cpuinfo dump these arrays get traversed sequentially >> assuming that they reflect and match HWCAP bit sequence, to test various >> features for a given CPU. >> >> This moves all HWCAP name arrays near their bit definitions. But first it >> defines all missing COMPAT_HWCAP_XXX that are present in the name string. >> >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Mark Brown >> Cc: Ard Biesheuvel >> Cc: Mark Rutland >> Cc: Suzuki K Poulose >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-kernel@vger.kernel.org >> >> Signed-off-by: Anshuman Khandual >> Acked-by: Mark Rutland >> --- >> This applies on 5.7-rc4 >> >> Changes in V2: >> >> - Defined COMPAT_KERNEL_HWCAP[2] and updated the name arrays per Mark >> - Updated the commit message as required >> >> Changes in V1: (https://patchwork.kernel.org/patch/11532945/) >> >> arch/arm64/include/asm/hwcap.h | 101 +++++++++++++++++++++++++++++++++ >> arch/arm64/kernel/cpuinfo.c | 90 ----------------------------- >> 2 files changed, 101 insertions(+), 90 deletions(-) >> >> diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h >> index 0f00265248b5..589ac02e1ddd 100644 >> --- a/arch/arm64/include/asm/hwcap.h >> +++ b/arch/arm64/include/asm/hwcap.h >> @@ -8,18 +8,27 @@ >> #include >> #include >> >> +#define COMPAT_HWCAP_SWP (1 << 0) >> #define COMPAT_HWCAP_HALF (1 << 1) >> #define COMPAT_HWCAP_THUMB (1 << 2) >> +#define COMPAT_HWCAP_26BIT (1 << 3) >> #define COMPAT_HWCAP_FAST_MULT (1 << 4) >> +#define COMPAT_HWCAP_FPA (1 << 5) >> #define COMPAT_HWCAP_VFP (1 << 6) >> #define COMPAT_HWCAP_EDSP (1 << 7) >> +#define COMPAT_HWCAP_JAVA (1 << 8) >> +#define COMPAT_HWCAP_IWMMXT (1 << 9) >> +#define COMPAT_HWCAP_CRUNCH (1 << 10) >> +#define COMPAT_HWCAP_THUMBEE (1 << 11) >> #define COMPAT_HWCAP_NEON (1 << 12) >> #define COMPAT_HWCAP_VFPv3 (1 << 13) >> +#define COMPAT_HWCAP_VFPV3D16 (1 << 14) >> #define COMPAT_HWCAP_TLS (1 << 15) >> #define COMPAT_HWCAP_VFPv4 (1 << 16) >> #define COMPAT_HWCAP_IDIVA (1 << 17) >> #define COMPAT_HWCAP_IDIVT (1 << 18) >> #define COMPAT_HWCAP_IDIV (COMPAT_HWCAP_IDIVA|COMPAT_HWCAP_IDIVT) >> +#define COMPAT_HWCAP_VFPD32 (1 << 19) >> #define COMPAT_HWCAP_LPAE (1 << 20) >> #define COMPAT_HWCAP_EVTSTRM (1 << 21) > > With the possible exception of SWP (does the swp emulation allow us to > report this as supported?), I think all these weren't mentioned because > they aren't included in ARMv8 and so can never be reported. > > If we find ourselves reporting them, there's a bug somewhere. > > So, can we just default all obsolete string entries to NULL? > > When generating the cpuinfo strings we could WARN and just emit an empty > string for that hwcap. All these above will be a change in the existing user visible behavior on the system and this patch never intended to create one. Hence, I will just defer this to maintainers on whether we should change existing /proc/cpuinfo output (including non-practically-possible ones on ARMv8) or even treat swap emulation as SWP. But IMHO, in case we decide to go for a /proc/cpuinfo change (which I would be happy implement), it should be applied over and above this patch which just preserved existing semantics and behavior. - Anshuman _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel