All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
@ 2022-09-12 13:24 ` george pee
  0 siblings, 0 replies; 8+ messages in thread
From: george pee @ 2022-09-12 13:24 UTC (permalink / raw)
  Cc: george pee, Russell King, Ard Biesheuvel, Russell King (Oracle),
	Linus Walleij, Nicolas Pitre, Keith Packard, Austin Kim,
	linux-arm-kernel, linux-kernel

Report feature /proc/cpuinfo as fphp to be consistent with arm64

Signed-off-by: george pee <georgepee@gmail.com>
---
 arch/arm/include/uapi/asm/hwcap.h | 1 +
 arch/arm/kernel/entry-armv.S      | 3 ++-
 arch/arm/kernel/setup.c           | 1 +
 arch/arm/vfp/vfpmodule.c          | 2 ++
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
index 990199d8b7c6..5d635dce8853 100644
--- a/arch/arm/include/uapi/asm/hwcap.h
+++ b/arch/arm/include/uapi/asm/hwcap.h
@@ -37,5 +37,6 @@
 #define HWCAP2_SHA1	(1 << 2)
 #define HWCAP2_SHA2	(1 << 3)
 #define HWCAP2_CRC32	(1 << 4)
+#define HWCAP2_FPHP	(1 << 5)
 
 #endif /* _UAPI__ASMARM_HWCAP_H */
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index c39303e5c234..161f8df852e1 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -625,11 +625,12 @@ call_fpe:
 	ret.w	lr				@ CP#6
 	ret.w	lr				@ CP#7
 	ret.w	lr				@ CP#8
-	ret.w	lr				@ CP#9
 #ifdef CONFIG_VFP
+	W(b)	do_vfp				@ CP#9  (VFP/FP16)
 	W(b)	do_vfp				@ CP#10 (VFP)
 	W(b)	do_vfp				@ CP#11 (VFP)
 #else
+	ret.w	lr				@ CP#9
 	ret.w	lr				@ CP#10 (VFP)
 	ret.w	lr				@ CP#11 (VFP)
 #endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1e8a50a97edf..8887d0f447d6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1258,6 +1258,7 @@ static const char *hwcap2_str[] = {
 	"sha1",
 	"sha2",
 	"crc32",
+	"fphp",
 	NULL
 };
 
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 2cb355c1b5b7..0806b0b1f2c7 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_hwcap2 |= HWCAP2_FPHP;
 		}
 	/* Extract the architecture version on pre-cpuid scheme */
 	} else {
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
@ 2022-09-12 13:24 ` george pee
  0 siblings, 0 replies; 8+ messages in thread
From: george pee @ 2022-09-12 13:24 UTC (permalink / raw)
  Cc: george pee, Russell King, Ard Biesheuvel, Russell King (Oracle),
	Linus Walleij, Nicolas Pitre, Keith Packard, Austin Kim,
	linux-arm-kernel, linux-kernel

Report feature /proc/cpuinfo as fphp to be consistent with arm64

Signed-off-by: george pee <georgepee@gmail.com>
---
 arch/arm/include/uapi/asm/hwcap.h | 1 +
 arch/arm/kernel/entry-armv.S      | 3 ++-
 arch/arm/kernel/setup.c           | 1 +
 arch/arm/vfp/vfpmodule.c          | 2 ++
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
index 990199d8b7c6..5d635dce8853 100644
--- a/arch/arm/include/uapi/asm/hwcap.h
+++ b/arch/arm/include/uapi/asm/hwcap.h
@@ -37,5 +37,6 @@
 #define HWCAP2_SHA1	(1 << 2)
 #define HWCAP2_SHA2	(1 << 3)
 #define HWCAP2_CRC32	(1 << 4)
+#define HWCAP2_FPHP	(1 << 5)
 
 #endif /* _UAPI__ASMARM_HWCAP_H */
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index c39303e5c234..161f8df852e1 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -625,11 +625,12 @@ call_fpe:
 	ret.w	lr				@ CP#6
 	ret.w	lr				@ CP#7
 	ret.w	lr				@ CP#8
-	ret.w	lr				@ CP#9
 #ifdef CONFIG_VFP
+	W(b)	do_vfp				@ CP#9  (VFP/FP16)
 	W(b)	do_vfp				@ CP#10 (VFP)
 	W(b)	do_vfp				@ CP#11 (VFP)
 #else
+	ret.w	lr				@ CP#9
 	ret.w	lr				@ CP#10 (VFP)
 	ret.w	lr				@ CP#11 (VFP)
 #endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1e8a50a97edf..8887d0f447d6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1258,6 +1258,7 @@ static const char *hwcap2_str[] = {
 	"sha1",
 	"sha2",
 	"crc32",
+	"fphp",
 	NULL
 };
 
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 2cb355c1b5b7..0806b0b1f2c7 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_hwcap2 |= HWCAP2_FPHP;
 		}
 	/* Extract the architecture version on pre-cpuid scheme */
 	} else {
-- 
2.37.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
  2022-09-12 13:24 ` george pee
@ 2022-11-03 13:40   ` George Pee
  -1 siblings, 0 replies; 8+ messages in thread
From: George Pee @ 2022-11-03 13:40 UTC (permalink / raw)
  Cc: Russell King, Ard Biesheuvel, Russell King (Oracle),
	Linus Walleij, Nicolas Pitre, Keith Packard, Austin Kim,
	linux-arm-kernel, linux-kernel

On Mon, Sep 12, 2022 at 8:25 AM george pee <georgepee@gmail.com> wrote:
>
> Report feature /proc/cpuinfo as fphp to be consistent with arm64
>
> Signed-off-by: george pee <georgepee@gmail.com>
> ---
>  arch/arm/include/uapi/asm/hwcap.h | 1 +
>  arch/arm/kernel/entry-armv.S      | 3 ++-
>  arch/arm/kernel/setup.c           | 1 +
>  arch/arm/vfp/vfpmodule.c          | 2 ++
>  4 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
> index 990199d8b7c6..5d635dce8853 100644
> --- a/arch/arm/include/uapi/asm/hwcap.h
> +++ b/arch/arm/include/uapi/asm/hwcap.h
> @@ -37,5 +37,6 @@
>  #define HWCAP2_SHA1    (1 << 2)
>  #define HWCAP2_SHA2    (1 << 3)
>  #define HWCAP2_CRC32   (1 << 4)
> +#define HWCAP2_FPHP    (1 << 5)
>
>  #endif /* _UAPI__ASMARM_HWCAP_H */
> diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> index c39303e5c234..161f8df852e1 100644
> --- a/arch/arm/kernel/entry-armv.S
> +++ b/arch/arm/kernel/entry-armv.S
> @@ -625,11 +625,12 @@ call_fpe:
>         ret.w   lr                              @ CP#6
>         ret.w   lr                              @ CP#7
>         ret.w   lr                              @ CP#8
> -       ret.w   lr                              @ CP#9
>  #ifdef CONFIG_VFP
> +       W(b)    do_vfp                          @ CP#9  (VFP/FP16)
>         W(b)    do_vfp                          @ CP#10 (VFP)
>         W(b)    do_vfp                          @ CP#11 (VFP)
>  #else
> +       ret.w   lr                              @ CP#9
>         ret.w   lr                              @ CP#10 (VFP)
>         ret.w   lr                              @ CP#11 (VFP)
>  #endif
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 1e8a50a97edf..8887d0f447d6 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -1258,6 +1258,7 @@ static const char *hwcap2_str[] = {
>         "sha1",
>         "sha2",
>         "crc32",
> +       "fphp",
>         NULL
>  };
>
> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> index 2cb355c1b5b7..0806b0b1f2c7 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_hwcap2 |= HWCAP2_FPHP;
>                 }
>         /* Extract the architecture version on pre-cpuid scheme */
>         } else {
> --
> 2.37.3
>

Any concerns with this?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
@ 2022-11-03 13:40   ` George Pee
  0 siblings, 0 replies; 8+ messages in thread
From: George Pee @ 2022-11-03 13:40 UTC (permalink / raw)
  Cc: Russell King, Ard Biesheuvel, Russell King (Oracle),
	Linus Walleij, Nicolas Pitre, Keith Packard, Austin Kim,
	linux-arm-kernel, linux-kernel

On Mon, Sep 12, 2022 at 8:25 AM george pee <georgepee@gmail.com> wrote:
>
> Report feature /proc/cpuinfo as fphp to be consistent with arm64
>
> Signed-off-by: george pee <georgepee@gmail.com>
> ---
>  arch/arm/include/uapi/asm/hwcap.h | 1 +
>  arch/arm/kernel/entry-armv.S      | 3 ++-
>  arch/arm/kernel/setup.c           | 1 +
>  arch/arm/vfp/vfpmodule.c          | 2 ++
>  4 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
> index 990199d8b7c6..5d635dce8853 100644
> --- a/arch/arm/include/uapi/asm/hwcap.h
> +++ b/arch/arm/include/uapi/asm/hwcap.h
> @@ -37,5 +37,6 @@
>  #define HWCAP2_SHA1    (1 << 2)
>  #define HWCAP2_SHA2    (1 << 3)
>  #define HWCAP2_CRC32   (1 << 4)
> +#define HWCAP2_FPHP    (1 << 5)
>
>  #endif /* _UAPI__ASMARM_HWCAP_H */
> diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> index c39303e5c234..161f8df852e1 100644
> --- a/arch/arm/kernel/entry-armv.S
> +++ b/arch/arm/kernel/entry-armv.S
> @@ -625,11 +625,12 @@ call_fpe:
>         ret.w   lr                              @ CP#6
>         ret.w   lr                              @ CP#7
>         ret.w   lr                              @ CP#8
> -       ret.w   lr                              @ CP#9
>  #ifdef CONFIG_VFP
> +       W(b)    do_vfp                          @ CP#9  (VFP/FP16)
>         W(b)    do_vfp                          @ CP#10 (VFP)
>         W(b)    do_vfp                          @ CP#11 (VFP)
>  #else
> +       ret.w   lr                              @ CP#9
>         ret.w   lr                              @ CP#10 (VFP)
>         ret.w   lr                              @ CP#11 (VFP)
>  #endif
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 1e8a50a97edf..8887d0f447d6 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -1258,6 +1258,7 @@ static const char *hwcap2_str[] = {
>         "sha1",
>         "sha2",
>         "crc32",
> +       "fphp",
>         NULL
>  };
>
> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> index 2cb355c1b5b7..0806b0b1f2c7 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_hwcap2 |= HWCAP2_FPHP;
>                 }
>         /* Extract the architecture version on pre-cpuid scheme */
>         } else {
> --
> 2.37.3
>

Any concerns with this?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
  2022-09-12 13:24 ` george pee
@ 2022-11-03 16:18   ` Linus Walleij
  -1 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2022-11-03 16:18 UTC (permalink / raw)
  To: george pee, Mark Brown
  Cc: Russell King, Ard Biesheuvel, Russell King (Oracle),
	Nicolas Pitre, Keith Packard, Austin Kim, linux-arm-kernel,
	linux-kernel

Sorry for top-posting but provding context.

Please CC Mark Brown om FP extensions, he is looking after these.
Now add on To:

Yours,
Linus Walleij

On Mon, Sep 12, 2022 at 3:25 PM george pee <georgepee@gmail.com> wrote:

> Report feature /proc/cpuinfo as fphp to be consistent with arm64
>
> Signed-off-by: george pee <georgepee@gmail.com>
> ---
>  arch/arm/include/uapi/asm/hwcap.h | 1 +
>  arch/arm/kernel/entry-armv.S      | 3 ++-
>  arch/arm/kernel/setup.c           | 1 +
>  arch/arm/vfp/vfpmodule.c          | 2 ++
>  4 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
> index 990199d8b7c6..5d635dce8853 100644
> --- a/arch/arm/include/uapi/asm/hwcap.h
> +++ b/arch/arm/include/uapi/asm/hwcap.h
> @@ -37,5 +37,6 @@
>  #define HWCAP2_SHA1    (1 << 2)
>  #define HWCAP2_SHA2    (1 << 3)
>  #define HWCAP2_CRC32   (1 << 4)
> +#define HWCAP2_FPHP    (1 << 5)
>
>  #endif /* _UAPI__ASMARM_HWCAP_H */
> diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> index c39303e5c234..161f8df852e1 100644
> --- a/arch/arm/kernel/entry-armv.S
> +++ b/arch/arm/kernel/entry-armv.S
> @@ -625,11 +625,12 @@ call_fpe:
>         ret.w   lr                              @ CP#6
>         ret.w   lr                              @ CP#7
>         ret.w   lr                              @ CP#8
> -       ret.w   lr                              @ CP#9
>  #ifdef CONFIG_VFP
> +       W(b)    do_vfp                          @ CP#9  (VFP/FP16)
>         W(b)    do_vfp                          @ CP#10 (VFP)
>         W(b)    do_vfp                          @ CP#11 (VFP)
>  #else
> +       ret.w   lr                              @ CP#9
>         ret.w   lr                              @ CP#10 (VFP)
>         ret.w   lr                              @ CP#11 (VFP)
>  #endif
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 1e8a50a97edf..8887d0f447d6 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -1258,6 +1258,7 @@ static const char *hwcap2_str[] = {
>         "sha1",
>         "sha2",
>         "crc32",
> +       "fphp",
>         NULL
>  };
>
> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> index 2cb355c1b5b7..0806b0b1f2c7 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_hwcap2 |= HWCAP2_FPHP;
>                 }
>         /* Extract the architecture version on pre-cpuid scheme */
>         } else {
> --
> 2.37.3
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
@ 2022-11-03 16:18   ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2022-11-03 16:18 UTC (permalink / raw)
  To: george pee, Mark Brown
  Cc: Russell King, Ard Biesheuvel, Russell King (Oracle),
	Nicolas Pitre, Keith Packard, Austin Kim, linux-arm-kernel,
	linux-kernel

Sorry for top-posting but provding context.

Please CC Mark Brown om FP extensions, he is looking after these.
Now add on To:

Yours,
Linus Walleij

On Mon, Sep 12, 2022 at 3:25 PM george pee <georgepee@gmail.com> wrote:

> Report feature /proc/cpuinfo as fphp to be consistent with arm64
>
> Signed-off-by: george pee <georgepee@gmail.com>
> ---
>  arch/arm/include/uapi/asm/hwcap.h | 1 +
>  arch/arm/kernel/entry-armv.S      | 3 ++-
>  arch/arm/kernel/setup.c           | 1 +
>  arch/arm/vfp/vfpmodule.c          | 2 ++
>  4 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
> index 990199d8b7c6..5d635dce8853 100644
> --- a/arch/arm/include/uapi/asm/hwcap.h
> +++ b/arch/arm/include/uapi/asm/hwcap.h
> @@ -37,5 +37,6 @@
>  #define HWCAP2_SHA1    (1 << 2)
>  #define HWCAP2_SHA2    (1 << 3)
>  #define HWCAP2_CRC32   (1 << 4)
> +#define HWCAP2_FPHP    (1 << 5)
>
>  #endif /* _UAPI__ASMARM_HWCAP_H */
> diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
> index c39303e5c234..161f8df852e1 100644
> --- a/arch/arm/kernel/entry-armv.S
> +++ b/arch/arm/kernel/entry-armv.S
> @@ -625,11 +625,12 @@ call_fpe:
>         ret.w   lr                              @ CP#6
>         ret.w   lr                              @ CP#7
>         ret.w   lr                              @ CP#8
> -       ret.w   lr                              @ CP#9
>  #ifdef CONFIG_VFP
> +       W(b)    do_vfp                          @ CP#9  (VFP/FP16)
>         W(b)    do_vfp                          @ CP#10 (VFP)
>         W(b)    do_vfp                          @ CP#11 (VFP)
>  #else
> +       ret.w   lr                              @ CP#9
>         ret.w   lr                              @ CP#10 (VFP)
>         ret.w   lr                              @ CP#11 (VFP)
>  #endif
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 1e8a50a97edf..8887d0f447d6 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -1258,6 +1258,7 @@ static const char *hwcap2_str[] = {
>         "sha1",
>         "sha2",
>         "crc32",
> +       "fphp",
>         NULL
>  };
>
> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> index 2cb355c1b5b7..0806b0b1f2c7 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_hwcap2 |= HWCAP2_FPHP;
>                 }
>         /* Extract the architecture version on pre-cpuid scheme */
>         } else {
> --
> 2.37.3
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
  2022-11-03 16:18   ` Linus Walleij
@ 2022-11-03 16:59     ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2022-11-03 16:59 UTC (permalink / raw)
  To: Linus Walleij
  Cc: george pee, Russell King, Ard Biesheuvel, Russell King (Oracle),
	Nicolas Pitre, Keith Packard, Austin Kim, linux-arm-kernel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1618 bytes --]

On Thu, Nov 03, 2022 at 05:18:21PM +0100, Linus Walleij wrote:

> Please CC Mark Brown om FP extensions, he is looking after these.

For arm64 anyway, though this is targetted at 32 bit kernels running on
v8 hardware so still somewhere around my wheelhouse.

> On Mon, Sep 12, 2022 at 3:25 PM george pee <georgepee@gmail.com> wrote:

> > Report feature /proc/cpuinfo as fphp to be consistent with arm64

Well, more so that applications can discover and use this feature when
running on a system that has it in a way that's consistent with how they
might do this when running on arm64 kernels.  It's also adding a hwcap
as well as updating /proc/cpuinfo.

> > index 990199d8b7c6..5d635dce8853 100644
> > --- a/arch/arm/include/uapi/asm/hwcap.h
> > +++ b/arch/arm/include/uapi/asm/hwcap.h
> > @@ -37,5 +37,6 @@
> >  #define HWCAP2_SHA1    (1 << 2)
> >  #define HWCAP2_SHA2    (1 << 3)
> >  #define HWCAP2_CRC32   (1 << 4)
> > +#define HWCAP2_FPHP    (1 << 5)

This is adding a hwcap for the feature in arm, if we're addding this we
should also do so for compat mode for arm64 (as a second patch in the
series probably).  That will ensure that everything is consistent no
matter if the kernel is 32 or 64 bit.

> > +                       if ((fmrx(MVFR1) & 0x0f000000) == 0x03000000)
> > +                               elf_hwcap2 |= HWCAP2_FPHP;

I'm not super familiar with the 32 bit code here but the change looks
reasonable and seems to match up with how DDI0487I.a describes things,
arm64 checks ID_AA64PFR0_EL1.FPHP but there's also requirements which
mean that the 32 bit ID register MVFR1 be in sync with that.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension
@ 2022-11-03 16:59     ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2022-11-03 16:59 UTC (permalink / raw)
  To: Linus Walleij
  Cc: george pee, Russell King, Ard Biesheuvel, Russell King (Oracle),
	Nicolas Pitre, Keith Packard, Austin Kim, linux-arm-kernel,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1618 bytes --]

On Thu, Nov 03, 2022 at 05:18:21PM +0100, Linus Walleij wrote:

> Please CC Mark Brown om FP extensions, he is looking after these.

For arm64 anyway, though this is targetted at 32 bit kernels running on
v8 hardware so still somewhere around my wheelhouse.

> On Mon, Sep 12, 2022 at 3:25 PM george pee <georgepee@gmail.com> wrote:

> > Report feature /proc/cpuinfo as fphp to be consistent with arm64

Well, more so that applications can discover and use this feature when
running on a system that has it in a way that's consistent with how they
might do this when running on arm64 kernels.  It's also adding a hwcap
as well as updating /proc/cpuinfo.

> > index 990199d8b7c6..5d635dce8853 100644
> > --- a/arch/arm/include/uapi/asm/hwcap.h
> > +++ b/arch/arm/include/uapi/asm/hwcap.h
> > @@ -37,5 +37,6 @@
> >  #define HWCAP2_SHA1    (1 << 2)
> >  #define HWCAP2_SHA2    (1 << 3)
> >  #define HWCAP2_CRC32   (1 << 4)
> > +#define HWCAP2_FPHP    (1 << 5)

This is adding a hwcap for the feature in arm, if we're addding this we
should also do so for compat mode for arm64 (as a second patch in the
series probably).  That will ensure that everything is consistent no
matter if the kernel is 32 or 64 bit.

> > +                       if ((fmrx(MVFR1) & 0x0f000000) == 0x03000000)
> > +                               elf_hwcap2 |= HWCAP2_FPHP;

I'm not super familiar with the 32 bit code here but the change looks
reasonable and seems to match up with how DDI0487I.a describes things,
arm64 checks ID_AA64PFR0_EL1.FPHP but there's also requirements which
mean that the 32 bit ID register MVFR1 be in sync with that.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-03 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 13:24 [PATCH v2] ARM : Support for optional ARMv8.2 half-precision floating point extension george pee
2022-09-12 13:24 ` george pee
2022-11-03 13:40 ` George Pee
2022-11-03 13:40   ` George Pee
2022-11-03 16:18 ` Linus Walleij
2022-11-03 16:18   ` Linus Walleij
2022-11-03 16:59   ` Mark Brown
2022-11-03 16:59     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.