Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1910667rwn; Fri, 9 Sep 2022 06:04:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR4B5M7gqvH/gDanc/oX2U5nqUuee6pZ0Xy501yFKxCjf5hIIUOWGaUcuQzRzbw4xm76O/Kq X-Received: by 2002:aa7:9532:0:b0:53e:7875:39e1 with SMTP id c18-20020aa79532000000b0053e787539e1mr12959985pfp.82.1662728676871; Fri, 09 Sep 2022 06:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662728676; cv=none; d=google.com; s=arc-20160816; b=ojIFvDoWiSx0x0SZjzorhrJ4T5t1o1HqILQjn2Aw18b6Cetbt9TrUnUF+9iaGvb8SN PubGFDO43CjzEABPvf7N5QWDmQaVufE1VJ54mnk+L4U0eeDYISxPDl2fXqcQzodza3AF kAQIpyJgUAHbjLEofdyRcIs1wZe5OsUYN4ny7Wm/UeOwTEk4dbVPVWyxDPXmSU+AnNgI WcJiWJEEj+9Hf4+De0LRp3N7L7ltIJOYyNb3CCd6wfbcJfNIlfRurQTkI1FeIJJK2LwT w0MYGfBRJP0VngyJYxcvKCuG0qPB89jSzRf3mPizUy+DD3yTc+iCfGfezwM9m+iyd4yy UwcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=0KJlpgBFCwhV8GOxWp1iqkjHrxoDtQr1nj7Yo6Z85Ew=; b=LBVWBqa0Rq1rUy5p97dE/DaFIWogpOk2GbzilHMW/3xrwSJMRNKIjLERM0cpub+w2u xHnluPWvNsmC4z3KmViSKCALCtRhLetG4N3E3JxcdGzrQC67SN9nH+RiP23454HJG/wO POnbACHfNmIqSzNIKjq2FBKfTijr8nCKNbFJv3YQLEu1EM5Z5BBL4bC7lm8IWm80Ycs9 +0KH5n7uR3WkETNoWVgKt5SjQNGmj1tbJfaFIdrhFQfnA8mOCvXBOXBjFmASIwJwu682 Lg0uFCiE3psrWySBQjBiajK/I1aCNQNq8BegMb+YhiBNgc/8+PjQRWFvTC7xBw1ENou3 ZtwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p29-20020a634f5d000000b00434dd1885d6si460548pgl.847.2022.09.09.06.04.22; Fri, 09 Sep 2022 06:04:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229973AbiIIMqw (ORCPT + 99 others); Fri, 9 Sep 2022 08:46:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiIIMqu (ORCPT ); Fri, 9 Sep 2022 08:46:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E01D056B91 for ; Fri, 9 Sep 2022 05:46:49 -0700 (PDT) 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 02B0A165C; Fri, 9 Sep 2022 05:46:56 -0700 (PDT) Received: from [10.57.15.197] (unknown [10.57.15.197]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2F0433F9AB; Fri, 9 Sep 2022 05:46:48 -0700 (PDT) Message-ID: Date: Fri, 9 Sep 2022 13:46:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] Report support for optional ARMv8.2 half-precision floating point extension Content-Language: en-GB To: george pee Cc: Russell King , "Russell King (Oracle)" , Catalin Marinas , "Kirill A. Shutemov" , Austin Kim , Ard Biesheuvel , Mike Rapoport , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220901141307.2361752-1-georgepee@gmail.com> From: Robin Murphy In-Reply-To: <20220901141307.2361752-1-georgepee@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-09-01 15:13, george pee wrote: > Report as fphp to be consistent with arm64 Wasn't the original problem that the VFP support code doesn't understand the new FP16 instruction encodings, so in practice they don't actually work reliably? Exposing a hwcap to say they're functional doesn't inherently make them functional - if there is already another patch somewhere for that, it should be made clear that this depends on it. Robin. > Signed-off-by: george pee > --- > arch/arm/include/uapi/asm/hwcap.h | 1 + > arch/arm/kernel/setup.c | 1 + > arch/arm/vfp/vfpmodule.c | 2 ++ > 3 files changed, 4 insertions(+) > > diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h > index 990199d8b7c6..f975845ce5d3 100644 > --- a/arch/arm/include/uapi/asm/hwcap.h > +++ b/arch/arm/include/uapi/asm/hwcap.h > @@ -28,6 +28,7 @@ > #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) > #define HWCAP_LPAE (1 << 20) > #define HWCAP_EVTSTRM (1 << 21) > +#define HWCAP_FPHP (1 << 22) > > /* > * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2 > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > index 1e8a50a97edf..6694ced0552a 100644 > --- a/arch/arm/kernel/setup.c > +++ b/arch/arm/kernel/setup.c > @@ -1249,6 +1249,7 @@ static const char *hwcap_str[] = { > "vfpd32", > "lpae", > "evtstrm", > + "fphp", > NULL > }; > > diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c > index 2cb355c1b5b7..cef8c64ce8bd 100644 > --- a/arch/arm/vfp/vfpmodule.c > +++ b/arch/arm/vfp/vfpmodule.c > @@ -831,6 +831,8 @@ static int __init vfp_init(void) > > if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000) > elf_hwcap |= HWCAP_VFPv4; > + if ((fmrx(MVFR1) & 0x0f000000) == 0x03000000) > + elf_hwcap |= HWCAP_FPHP; > } > /* Extract the architecture version on pre-cpuid scheme */ > } else {