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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F72EECAAA1 for ; Fri, 9 Sep 2022 13:34:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbiIINen (ORCPT ); Fri, 9 Sep 2022 09:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiIINek (ORCPT ); Fri, 9 Sep 2022 09:34:40 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86C3357D1 for ; Fri, 9 Sep 2022 06:34:38 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id b2so1112068qkh.12 for ; Fri, 09 Sep 2022 06:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=1B9mFN0cxvEq52ylC0j4yhvF/kkQxB2oC++4CzkQxbU=; b=LKM4cC3oid/qzGIma2gu52KanSNT+uU2jw5UQzVmsi4evxBnXM9pjKyluyCO4xes25 oaGX6Htcvm9pxufSOUNmt3u5CPq0ScF17dOyv5Zn5ZpGNq3eMlMDBw9/oNZta1NrFHNf IrztlEFWOVpr0y1p05Em25xOWlCADMx3Q7j5RbM/uAb/T8wzyBY1Y4EMJ260+w7ycRnK y8fuBUW5v6+N8Dlr+vvL0PIcs7Tc7UBalHOBgKdZzU1cktwSkpW3uB1zR9IptXLcvKjl 7nxq6v2lDV0YvF/r8iNR0fyY4vnLb8QIY+YkZh8fZvmQ419VYX1l13/kTBZ+qVBqp+A9 5Bpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=1B9mFN0cxvEq52ylC0j4yhvF/kkQxB2oC++4CzkQxbU=; b=0uL0XyVEgv8iSe0vwo7NjbmaAAF2ZEyRkO0WgYcxWE3na4SSaKJTncQkG28HpSfMdF YtVJXtkg7SofhW9Dvu7Y9EKzbM/fckhx2z7TEZiInZ4HobSCkBzOad97iNpGBYITYCvm 0kmio/uMXpYQXOabZ4Au5EJGhv/uD9ypiCwc9PDjUnJyaTdjSLKzUUhdLop5gGn5ivs1 3zKJl6C/KyhbLRcMwz6lJkZmb3Jg/dyhk+BtYiKx4XnO3P6AtpWlqdZdAF6EGnXdwbbm FZLWoEM485lpIjfKa4BRqN+bXiTQ4KUC1Vr8tD9ve0RTiwqhihwwL1RW3ywBekPdkp0F yCEg== X-Gm-Message-State: ACgBeo0hhtPQ2+9sAEZJFbrEXIqwv2q/3AfDUFVcdawwprkiaqOhnTuX Nv6Wq/SWXsimkjJ2bNiBYBHnugqS3cxJyFz+ZIL+A5S9oojyIA== X-Google-Smtp-Source: AA6agR4T18xG754Z+D5DqORCa8ZqC8rW6lRdaZoWxv7Zt6oFW+IqQH5lSbrlpWKdEKZ3m34rI1zWkCOevwBOALsg+Jw= X-Received: by 2002:a05:620a:29c4:b0:6bc:638d:cf30 with SMTP id s4-20020a05620a29c400b006bc638dcf30mr9688037qkp.443.1662730477718; Fri, 09 Sep 2022 06:34:37 -0700 (PDT) MIME-Version: 1.0 References: <20220901141307.2361752-1-georgepee@gmail.com> In-Reply-To: From: George Pee Date: Fri, 9 Sep 2022 08:34:26 -0500 Message-ID: Subject: Re: [PATCH] Report support for optional ARMv8.2 half-precision floating point extension To: Robin Murphy 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding the hwcap was part of the diagnosis process-- I added it just to make sure that the cpu in question supported the optional extension. It seems like it could be useful to be able to check for support in /proc/cpuinfo. On Fri, Sep 9, 2022 at 7:46 AM Robin Murphy wrote: > > 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 { 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B05A3ECAAD3 for ; Fri, 9 Sep 2022 13:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G8J119Sc6rWgQ4ZwPRmOfXoOowgTXHmlEnUhN5jX5JU=; b=H/5LWHOlusxl7w cH81mMnXkznIA8NmNei316WgjcV/dgiDaxujRfPykfeRDXdDGHoI7W/2BmUNRnwFn4O51T8faMsRX GcB4dynTC0ImDub6KAQe2wmaZE824tBDGZvBHpvegYRZ4XAEvO4BAv/1UqR4VtkmHJTjG2IYmTBe1 JMh4F4KWxk0+mRKcDf1v5TmJMfH0hrGD+rOmrw8X+ZvaOypuVdy0Zb71FymZIZg3PzjhXainvNpsN 1m5tqyuC2/ekDvfl8tf8t4xyJQhPEOSkatNaTwund6SbPmf/Xyk0Skpafa8yO/DFmWukdU9a8CA3O UKZAQlTWwXcfhGDMQj7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWe9Z-00GLZF-UF; Fri, 09 Sep 2022 13:34:42 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWe9X-00GLYc-Ac for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 13:34:40 +0000 Received: by mail-qk1-x72a.google.com with SMTP id k12so1120047qkj.8 for ; Fri, 09 Sep 2022 06:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=1B9mFN0cxvEq52ylC0j4yhvF/kkQxB2oC++4CzkQxbU=; b=LKM4cC3oid/qzGIma2gu52KanSNT+uU2jw5UQzVmsi4evxBnXM9pjKyluyCO4xes25 oaGX6Htcvm9pxufSOUNmt3u5CPq0ScF17dOyv5Zn5ZpGNq3eMlMDBw9/oNZta1NrFHNf IrztlEFWOVpr0y1p05Em25xOWlCADMx3Q7j5RbM/uAb/T8wzyBY1Y4EMJ260+w7ycRnK y8fuBUW5v6+N8Dlr+vvL0PIcs7Tc7UBalHOBgKdZzU1cktwSkpW3uB1zR9IptXLcvKjl 7nxq6v2lDV0YvF/r8iNR0fyY4vnLb8QIY+YkZh8fZvmQ419VYX1l13/kTBZ+qVBqp+A9 5Bpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=1B9mFN0cxvEq52ylC0j4yhvF/kkQxB2oC++4CzkQxbU=; b=vqsxYjLqmYem5uQDkGrKvwz7huoenQqCGJQMCmmzCn+2oXBfG8CnZNPWfjw3Gn5oGp EsQM6gePPT2bEtQr18Cn+az0OP4CXRcwq+eOKtPkT5Y7RmhB6oWIZxpZhYQRjHZkCXq0 otrM+oT4M67GKOlqH0fqS0G1JKoQB0rHIiGb3OSwBwxb/Tk102kFjYZsWjXLqy+hDnOl rlzvTU2FODkBpCvZOwUDmB0DdfQQhmZOoZJrGabfF0x8MrkfJk+Wk6fykOPRXrBzYIv5 TM7RexP3KsZEiXZYnKSgfauOeD452A7mUVU47uX44tWojTjTFadADoBVSmYTJC151pSk rmwA== X-Gm-Message-State: ACgBeo2dfTZNMEp7pbis5Tqv3ExNX/l4myU54/umRm7bTMbIAHlWP7BU NqVzg0xgPhshxznmIU6yKj6XzDoHuLr/pPS4UTg= X-Google-Smtp-Source: AA6agR4T18xG754Z+D5DqORCa8ZqC8rW6lRdaZoWxv7Zt6oFW+IqQH5lSbrlpWKdEKZ3m34rI1zWkCOevwBOALsg+Jw= X-Received: by 2002:a05:620a:29c4:b0:6bc:638d:cf30 with SMTP id s4-20020a05620a29c400b006bc638dcf30mr9688037qkp.443.1662730477718; Fri, 09 Sep 2022 06:34:37 -0700 (PDT) MIME-Version: 1.0 References: <20220901141307.2361752-1-georgepee@gmail.com> In-Reply-To: From: George Pee Date: Fri, 9 Sep 2022 08:34:26 -0500 Message-ID: Subject: Re: [PATCH] Report support for optional ARMv8.2 half-precision floating point extension To: Robin Murphy 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220909_063439_385853_616FCA3D X-CRM114-Status: GOOD ( 25.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Adding the hwcap was part of the diagnosis process-- I added it just to make sure that the cpu in question supported the optional extension. It seems like it could be useful to be able to check for support in /proc/cpuinfo. On Fri, Sep 9, 2022 at 7:46 AM Robin Murphy wrote: > > 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 { _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel