Re: [PATCH v4 13/15] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-04-11 Thread Samuel Holland
Hi Thiago, On 2024-04-10 8:02 PM, Thiago Jung Bauermann wrote: > Samuel Holland writes: >> On 2024-04-10 5:21 PM, Thiago Jung Bauermann wrote: >>> >>> Unfortunately this patch causes build failures on arm with allyesconfig >>> and allmodconfig. Tested wit

Re: [PATCH v4 13/15] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-04-11 Thread Samuel Holland
Hi Thiago, On 2024-04-10 5:21 PM, Thiago Jung Bauermann wrote: > Samuel Holland writes: > >> Now that all previously-supported architectures select >> ARCH_HAS_KERNEL_FPU_SUPPORT, this code can depend on that symbol instead >> of the existing list of architectures. It ca

Re: [PATCH v4 10/15] x86: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-30 Thread Samuel Holland
On 2024-03-29 12:28 PM, Dave Hansen wrote: > On 3/29/24 00:18, Samuel Holland wrote: >> +# >> +# CFLAGS for compiling floating point code inside the kernel. >> +# >> +CC_FLAGS_FPU := -msse -msse2 >> +ifdef CONFIG_CC_IS_GCC >> +# Stack alignment mismatch

[PATCH v4 09/15] x86/fpu: Fix asm/fpu/types.h include guard

2024-03-29 Thread Samuel Holland
The include guard should match the filename, or it will conflict with the newly-added asm/fpu.h. Signed-off-by: Samuel Holland --- Changes in v4: - New patch for v4 arch/x86/include/asm/fpu/types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm

[PATCH v4 05/15] arm64: crypto: Use CC_FLAGS_FPU for NEON CFLAGS

2024-03-29 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New patch for v2 arch/arm64/lib/Makefile | 6 ++ 1 file

[PATCH v4 13/15] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-29 Thread Samuel Holland
: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Split altivec removal to a separate patch - Use linux/fpu.h instead of asm/fpu.h in consumers drivers/gpu/drm/amd/display/Kconfig | 2 +- .../gpu/drm/amd/display/amdgpu_dm/dc_fpu.c| 27

[PATCH v4 00/15] Unified cross-architecture kernel-mode FPU API

2024-03-29 Thread Samuel Holland
ec on powerpc Samuel Holland (14): arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT ARM: Implement ARCH_HAS_KERNEL_FPU_SUPPORT ARM: crypto: Use CC_FLAGS_FPU for NEON CFLAGS arm64: Implement ARCH_HAS_KERNEL_FPU_SUPPORT arm64: crypto: Use CC_FLAGS_FPU for NEON CFLAGS lib/raid6: Use CC_FLAGS_FPU for

[PATCH v4 12/15] drm/amd/display: Only use hard-float, not altivec on powerpc

2024-03-29 Thread Samuel Holland
Deucher Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New patch for v2 drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 12 ++-- drivers/gpu/drm/amd/display/dc/dml/Makefile| 2 +- drivers/gpu/drm/amd/display/dc/dml2/Makefile | 2 +- 3 files changed, 4

[PATCH v4 06/15] lib/raid6: Use CC_FLAGS_FPU for NEON CFLAGS

2024-03-29 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- Changes in v4: - Add missed CFLAGS changes for recov_neon_inner.c (fixes arm build failures) lib

[PATCH v4 11/15] riscv: Add support for kernel-mode FPU

2024-03-29 Thread Samuel Holland
convert between doubles and 64-bit integers. Acked-by: Palmer Dabbelt Reviewed-by: Palmer Dabbelt Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v3) Changes in v3: - Limit riscv ARCH_HAS_KERNEL_FPU_SUPPORT to 64BIT Changes in v2: - Remove RISC-V

[PATCH v4 07/15] LoongArch: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-29 Thread Samuel Holland
LoongArch already provides kernel_fpu_begin() and kernel_fpu_end() in asm/fpu.h, so it only needs to add kernel_fpu_available() and export the CFLAGS adjustments. Acked-by: WANG Xuerui Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v3) Changes in v3

[PATCH v4 10/15] x86: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-29 Thread Samuel Holland
x86 already provides kernel_fpu_begin() and kernel_fpu_end(), but in a different header. Add a wrapper header, and export the CFLAGS adjustments as found in lib/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/x86/Kconfig | 1

[PATCH v4 15/15] selftests/fpu: Allow building on other architectures

2024-03-29 Thread Samuel Holland
Now that ARCH_HAS_KERNEL_FPU_SUPPORT provides a common way to compile and run floating-point code, this test is no longer x86-specific. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) lib/Kconfig.debug | 2 +- lib/Makefile| 25

[PATCH v4 02/15] ARM: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-29 Thread Samuel Holland
ARM provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2

[PATCH v4 14/15] selftests/fpu: Move FP code to a separate translation unit

2024-03-29 Thread Samuel Holland
This ensures no compiler-generated floating-point code can appear outside kernel_fpu_{begin,end}() sections, and some architectures enforce this separation. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Declare test_fpu() in a header

[PATCH v4 01/15] arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-29 Thread Samuel Holland
-point C code. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Add documentation explaining the built-time and runtime APIs - Add a linux/fpu.h header for generic isolation enforcement Documentation/core-api

[PATCH v4 03/15] ARM: crypto: Use CC_FLAGS_FPU for NEON CFLAGS

2024-03-29 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/lib/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[PATCH v4 08/15] powerpc: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-29 Thread Samuel Holland
: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 5 - arch/powerpc/include/asm/fpu.h | 28 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 arch

[PATCH v4 04/15] arm64: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-29 Thread Samuel Holland
arm64 provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since

[PATCH v3 02/14] ARM: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
ARM provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2

[PATCH v3 01/14] arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
-point C code. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Add documentation explaining the built-time and runtime APIs - Add a linux/fpu.h header for generic isolation enforcement Documentation/core-api

[PATCH v3 08/14] powerpc: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 5 - arch/powerpc/include/asm/fpu.h | 28 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 arch

[PATCH v3 00/14] Unified cross-architecture kernel-mode FPU API

2024-03-28 Thread Samuel Holland
m/amd/display: Only use hard-float, not altivec on powerpc Samuel Holland (13): arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT ARM: Implement ARCH_HAS_KERNEL_FPU_SUPPORT ARM: crypto: Use CC_FLAGS_FPU for NEON CFLAGS arm64: Implement ARCH_HAS_KERNEL_FPU_SUPPORT arm64: crypto: Use CC_FLAGS_FPU for

[PATCH v3 06/14] lib/raid6: Use CC_FLAGS_FPU for NEON CFLAGS

2024-03-28 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) lib/raid6/Makefile | 31 --- 1 file changed, 8

[PATCH v3 10/14] riscv: Add support for kernel-mode FPU

2024-03-28 Thread Samuel Holland
convert between doubles and 64-bit integers. Acked-by: Palmer Dabbelt Reviewed-by: Palmer Dabbelt Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- Changes in v3: - Rebase on v6.9-rc1 - Limit ARCH_HAS_KERNEL_FPU_SUPPORT to 64BIT Changes in v2: - Remove RISC-V architecture

[PATCH v3 09/14] x86: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
x86 already provides kernel_fpu_begin() and kernel_fpu_end(), but in a different header. Add a wrapper header, and export the CFLAGS adjustments as found in lib/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/x86/Kconfig | 1

[PATCH v3 07/14] LoongArch: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
LoongArch already provides kernel_fpu_begin() and kernel_fpu_end() in asm/fpu.h, so it only needs to add kernel_fpu_available() and export the CFLAGS adjustments. Acked-by: WANG Xuerui Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- Changes in v3: - Rebase on v6.9-rc1 arch

[PATCH v3 11/14] drm/amd/display: Only use hard-float, not altivec on powerpc

2024-03-28 Thread Samuel Holland
Deucher Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New patch for v2 drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 12 ++-- drivers/gpu/drm/amd/display/dc/dml/Makefile| 2 +- drivers/gpu/drm/amd/display/dc/dml2/Makefile | 2 +- 3 files changed, 4

[PATCH v3 03/14] ARM: crypto: Use CC_FLAGS_FPU for NEON CFLAGS

2024-03-28 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/lib/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

Re: [PATCH v3 12/14] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
On 2024-03-27 4:25 PM, Andrew Morton wrote: > On Wed, 27 Mar 2024 13:00:43 -0700 Samuel Holland > wrote: > >> Now that all previously-supported architectures select >> ARCH_HAS_KERNEL_FPU_SUPPORT, this code can depend on that symbol instead >> of the existing list of

[PATCH v3 04/14] arm64: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
arm64 provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since

[PATCH v3 12/14] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2024-03-28 Thread Samuel Holland
: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Split altivec removal to a separate patch - Use linux/fpu.h instead of asm/fpu.h in consumers drivers/gpu/drm/amd/display/Kconfig | 2 +- .../gpu/drm/amd/display/amdgpu_dm/dc_fpu.c| 27

[PATCH v3 13/14] selftests/fpu: Move FP code to a separate translation unit

2024-03-28 Thread Samuel Holland
This ensures no compiler-generated floating-point code can appear outside kernel_fpu_{begin,end}() sections, and some architectures enforce this separation. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - Declare test_fpu() in a header

[PATCH v3 05/14] arm64: crypto: Use CC_FLAGS_FPU for NEON CFLAGS

2024-03-28 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v2) Changes in v2: - New patch for v2 arch/arm64/lib/Makefile | 6 ++ 1 file

[PATCH v3 14/14] selftests/fpu: Allow building on other architectures

2024-03-28 Thread Samuel Holland
Now that ARCH_HAS_KERNEL_FPU_SUPPORT provides a common way to compile and run floating-point code, this test is no longer x86-specific. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) lib/Kconfig.debug | 2 +- lib/Makefile| 25

Re: [PATCH v2 07/14] LoongArch: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-01-04 Thread Samuel Holland
Hi Huacai, On 2024-01-04 3:55 AM, Huacai Chen wrote: > Hi, Samuel, > > On Thu, Dec 28, 2023 at 9:42 AM Samuel Holland > wrote: >> >> LoongArch already provides kernel_fpu_begin() and kernel_fpu_end() in >> asm/fpu.h, so it only needs to add kernel_fpu_availa

[PATCH v2 06/14] lib/raid6: Use CC_FLAGS_FPU for NEON CFLAGS

2023-12-28 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) lib/raid6/Makefile | 31 --- 1 file changed, 8

[PATCH v2 13/14] selftests/fpu: Move FP code to a separate translation unit

2023-12-28 Thread Samuel Holland
This ensures no compiler-generated floating-point code can appear outside kernel_fpu_{begin,end}() sections, and some architectures enforce this separation. Signed-off-by: Samuel Holland --- Changes in v2: - Declare test_fpu() in a header lib/Makefile| 3 ++- lib

[PATCH v2 12/14] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-28 Thread Samuel Holland
Now that all previously-supported architectures select ARCH_HAS_KERNEL_FPU_SUPPORT, this code can depend on that symbol instead of the existing list of architectures. It can also take advantage of the common kernel-mode FPU API and method of adjusting CFLAGS. Signed-off-by: Samuel Holland

[PATCH v2 03/14] ARM: crypto: Use CC_FLAGS_FPU for NEON CFLAGS

2023-12-28 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/arm/lib/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[PATCH v2 07/14] LoongArch: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-28 Thread Samuel Holland
LoongArch already provides kernel_fpu_begin() and kernel_fpu_end() in asm/fpu.h, so it only needs to add kernel_fpu_available() and export the CFLAGS adjustments. Acked-by: WANG Xuerui Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/loongarch

[PATCH v2 01/14] arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-28 Thread Samuel Holland
-point C code. Suggested-by: Christoph Hellwig Signed-off-by: Samuel Holland --- Changes in v2: - Add documentation explaining the built-time and runtime APIs - Add a linux/fpu.h header for generic isolation enforcement Documentation/core-api/floating-point.rst | 78

[PATCH v2 10/14] riscv: Add support for kernel-mode FPU

2023-12-28 Thread Samuel Holland
This is motivated by the amdgpu DRM driver, which needs floating-point code to support recent hardware. That code is not performance-critical, so only provide a minimal non-preemptible implementation for now. Signed-off-by: Samuel Holland --- Changes in v2: - Remove RISC-V architecture

[PATCH v2 02/14] ARM: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-28 Thread Samuel Holland
ARM provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- Changes in v2

[PATCH v2 14/14] selftests/fpu: Allow building on other architectures

2023-12-28 Thread Samuel Holland
Now that ARCH_HAS_KERNEL_FPU_SUPPORT provides a common way to compile and run floating-point code, this test is no longer x86-specific. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) lib/Kconfig.debug | 2 +- lib/Makefile| 25

[PATCH v2 05/14] arm64: crypto: Use CC_FLAGS_FPU for NEON CFLAGS

2023-12-28 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Signed-off-by: Samuel Holland --- Changes in v2: - New patch for v2 arch/arm64/lib/Makefile | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a

[PATCH v2 09/14] x86: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-28 Thread Samuel Holland
x86 already provides kernel_fpu_begin() and kernel_fpu_end(), but in a different header. Add a wrapper header, and export the CFLAGS adjustments as found in lib/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- (no changes since v1) arch/x86/Kconfig | 1

[PATCH v2 00/14] Unified cross-architecture kernel-mode FPU API

2023-12-28 Thread Samuel Holland
arate patch - Use linux/fpu.h instead of asm/fpu.h in consumers - Declare test_fpu() in a header Michael Ellerman (1): drm/amd/display: Only use hard-float, not altivec on powerpc Samuel Holland (13): arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT ARM: Implement ARCH_HAS_KERNEL_FPU_SUPPORT ARM: crypto

[PATCH v2 08/14] powerpc: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-28 Thread Samuel Holland
PowerPC provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. The PowerPC API also requires a non-preemptible context. Add a wrapper header, and export the CFLAGS adjustments. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel

[PATCH v2 11/14] drm/amd/display: Only use hard-float, not altivec on powerpc

2023-12-28 Thread Samuel Holland
: Samuel Holland --- Changes in v2: - New patch for v2 drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 12 ++-- drivers/gpu/drm/amd/display/dc/dml/Makefile| 2 +- drivers/gpu/drm/amd/display/dc/dml2/Makefile | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a

[PATCH v2 04/14] arm64: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-28 Thread Samuel Holland
arm64 provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Reviewed-by: Christoph Hellwig Signed-off-by: Samuel Holland --- Changes in v2

Re: [RFC PATCH 10/12] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-14 Thread Samuel Holland
On 2023-12-11 6:23 AM, Michael Ellerman wrote: > Hi Samuel, > > Thanks for trying to clean all this up. > > One problem below. > > Samuel Holland writes: >> Now that all previously-supported architectures select >> ARCH_HAS_KERNEL_FPU_SUPPORT, this code can de

Re: [RFC PATCH 09/12] riscv: Add support for kernel-mode FPU

2023-12-11 Thread Samuel Holland
On 2023-12-11 10:11 AM, Christoph Hellwig wrote: >> +#ifdef __riscv_f >> + >> +#define kernel_fpu_begin() \ >> +static_assert(false, "floating-point code must use a separate >> translation unit") >> +#define kernel_fpu_end() kernel_fpu_begin() >> + >> +#else >> + >> +void kernel_fpu_begin(void

Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-12-11 Thread Samuel Holland
Hi Alex, On 2023-12-11 9:17 AM, Alex Deucher wrote: > On Sun, Dec 10, 2023 at 5:10 AM Samuel Holland > wrote: >> >> Hi Arnd, >> >> On 2023-12-09 2:38 PM, Arnd Bergmann wrote: >>> On Fri, Dec 8, 2023, at 06:04, Samuel Holland wrote: >>>> On 20

Re: [RFC PATCH 05/12] lib/raid6: Use CC_FLAGS_FPU for NEON CFLAGS

2023-12-11 Thread Samuel Holland
On 2023-12-11 10:07 AM, Christoph Hellwig wrote: >> +CFLAGS_REMOVE_neon1.o += $(CC_FLAGS_NO_FPU) >> +CFLAGS_REMOVE_neon2.o += $(CC_FLAGS_NO_FPU) >> +CFLAGS_REMOVE_neon4.o += $(CC_FLAGS_NO_FPU) >> +CFLAGS_REMOVE_neon8.o += $(CC_FLAGS_NO_FPU) > > Btw, do we even really need the extra variables for c

Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-12-11 Thread Samuel Holland
Hi Arnd, On 2023-12-09 2:38 PM, Arnd Bergmann wrote: > On Fri, Dec 8, 2023, at 06:04, Samuel Holland wrote: >> On 2023-11-29 6:42 PM, Nathan Chancellor wrote: >>> On Thu, Nov 23, 2023 at 02:23:01PM +, Conor Dooley wrote: >>>> On Tue, Nov 21, 2023 at 07:05:15

[RFC PATCH 01/12] arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-08 Thread Samuel Holland
-point C code. Suggested-by: Christoph Hellwig Signed-off-by: Samuel Holland --- Makefile | 4 arch/Kconfig | 9 + 2 files changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 511b5616aa41..e65c186cf2c9 100644 --- a/Makefile +++ b/Makefile @@ -969,6 +969,10

Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-12-08 Thread Samuel Holland
Hi Nathan, On 2023-11-29 6:42 PM, Nathan Chancellor wrote: > On Thu, Nov 23, 2023 at 02:23:01PM +, Conor Dooley wrote: >> On Tue, Nov 21, 2023 at 07:05:15PM -0800, Samuel Holland wrote: >>> RISC-V uses kernel_fpu_begin()/kernel_fpu_end() like several other >>> archi

[RFC PATCH 12/12] selftests/fpu: Allow building on other architectures

2023-12-08 Thread Samuel Holland
Now that ARCH_HAS_KERNEL_FPU_SUPPORT provides a common way to compile and run floating-point code, this test is no longer x86-specific. Signed-off-by: Samuel Holland --- lib/Kconfig.debug | 2 +- lib/Makefile| 25 ++--- lib/test_fpu_glue.c | 5 - 3 files

[RFC PATCH 06/12] LoongArch: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-08 Thread Samuel Holland
LoongArch already provides kernel_fpu_begin() and kernel_fpu_end() in asm/fpu.h, so it only needs to add kernel_fpu_available() and export the CFLAGS adjustments. Signed-off-by: Samuel Holland --- arch/loongarch/Kconfig | 1 + arch/loongarch/Makefile | 5 - arch

[RFC PATCH 07/12] powerpc: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-08 Thread Samuel Holland
PowerPC provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. The PowerPC API also requires a non-preemptible context. Add a wrapper header, and export the CFLAGS adjustments. Signed-off-by: Samuel Holland --- arch/powerpc

[RFC PATCH 04/12] arm64: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-08 Thread Samuel Holland
arm64 provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Signed-off-by: Samuel Holland --- arch/arm64/Kconfig | 1 + arch/arm64

[RFC PATCH 11/12] selftests/fpu: Move FP code to a separate translation unit

2023-12-08 Thread Samuel Holland
This ensures no compiler-generated floating-point code can appear outside kernel_fpu_{begin,end}() sections, and some architectures enforce this separation. Signed-off-by: Samuel Holland --- lib/Makefile| 3 ++- lib/{test_fpu.c => test_fpu_glue.c} |

[RFC PATCH 05/12] lib/raid6: Use CC_FLAGS_FPU for NEON CFLAGS

2023-12-08 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Signed-off-by: Samuel Holland --- lib/raid6/Makefile | 31 --- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/lib/raid6

[RFC PATCH 00/12] Unified cross-architecture kernel-mode FPU API

2023-12-08 Thread Samuel Holland
SiFive's HiFive Unmatched. Those GPUs need CONFIG_DRM_AMD_DC_FP to initialize, which requires kernel-mode FPU support. [1]: https://lore.kernel.org/linux-riscv/20231122030621.3759313-1-samuel.holl...@sifive.com/ Samuel Holland (12): arch: Add ARCH_HAS_KERNEL_FPU_SUPPORT ARM: Impl

[RFC PATCH 02/12] ARM: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-08 Thread Samuel Holland
ARM provides an equivalent to the common kernel-mode FPU API, but in a different header and using different function names. Add a wrapper header, and export CFLAGS adjustments as found in lib/raid6/Makefile. Signed-off-by: Samuel Holland --- arch/arm/Kconfig | 1 + arch/arm/Makefile

Re: [PATCH 1/3] riscv: Add support for kernel-mode FPU

2023-12-08 Thread Samuel Holland
Hi Christoph, On 2023-11-22 2:33 AM, Christoph Hellwig wrote: > On Tue, Nov 21, 2023 at 07:05:13PM -0800, Samuel Holland wrote: >> +static inline void kernel_fpu_begin(void) >> +{ >> +preempt_disable(); >> +fstate_save(current, task_pt_regs(current)); >>

[RFC PATCH 10/12] drm/amd/display: Use ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-08 Thread Samuel Holland
Now that all previously-supported architectures select ARCH_HAS_KERNEL_FPU_SUPPORT, this code can depend on that symbol instead of the existing list of architectures. It can also take advantage of the common kernel-mode FPU API and method of adjusting CFLAGS. Signed-off-by: Samuel Holland

[RFC PATCH 08/12] x86: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2023-12-08 Thread Samuel Holland
x86 already provides kernel_fpu_begin() and kernel_fpu_end(), but in a different header. Add a wrapper header, and export the CFLAGS adjustments as found in lib/Makefile. Signed-off-by: Samuel Holland --- arch/x86/Kconfig | 1 + arch/x86/Makefile | 20

[RFC PATCH 03/12] ARM: crypto: Use CC_FLAGS_FPU for NEON CFLAGS

2023-12-08 Thread Samuel Holland
Now that CC_FLAGS_FPU is exported and can be used anywhere in the source tree, use it instead of duplicating the flags here. Signed-off-by: Samuel Holland --- arch/arm/lib/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib

Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-12-08 Thread Samuel Holland
Hi Christoph, On 2023-11-22 2:40 AM, Christoph Hellwig wrote: >> -select DRM_AMD_DC_FP if (X86 || LOONGARCH || (PPC64 && ALTIVEC) || >> (ARM64 && KERNEL_MODE_NEON && !CC_IS_CLANG)) >> +select DRM_AMD_DC_FP if ARM64 && KERNEL_MODE_NEON && !CC_IS_CLANG >> +select DRM_AMD_DC_FP if PPC64

[RFC PATCH 09/12] riscv: Add support for kernel-mode FPU

2023-12-08 Thread Samuel Holland
translation unit, so it is not possible for compiler-generated floating-point code to appear outside kernel_fpu_{begin,end}(). Signed-off-by: Samuel Holland --- arch/riscv/Kconfig | 1 + arch/riscv/Makefile | 3 +++ arch/riscv/include/asm/fpu.h| 26

[PATCH 1/3] riscv: Add support for kernel-mode FPU

2023-11-22 Thread Samuel Holland
This is needed to support recent hardware in the amdgpu DRM driver. The FPU code in that driver is not performance-critical, so only provide the minimal support. Signed-off-by: Samuel Holland --- arch/riscv/include/asm/switch_to.h | 14 ++ arch/riscv/kernel/process.c| 3

[PATCH 2/3] riscv: Factor out riscv-march-y to a separate Makefile

2023-11-22 Thread Samuel Holland
where needed. Signed-off-by: Samuel Holland --- arch/riscv/Makefile | 12 +--- arch/riscv/Makefile.isa | 15 +++ 2 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 arch/riscv/Makefile.isa diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index a74be78

[PATCH 0/3] riscv: Add kernel-mode FPU support for amdgpu

2023-11-22 Thread Samuel Holland
eing added. I assume patch 3 would be merged separately, after patches 1-2 are merged. Samuel Holland (3): riscv: Add support for kernel-mode FPU riscv: Factor out riscv-march-y to a separate Makefile drm/amd/display: Support DRM_AMD_DC_FP on RISC-V arch/riscv/Makefile

[PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-11-22 Thread Samuel Holland
RISC-V uses kernel_fpu_begin()/kernel_fpu_end() like several other architectures. Enabling hardware FP requires overriding the ISA string for the relevant compilation units. Signed-off-by: Samuel Holland --- drivers/gpu/drm/amd/display/Kconfig| 5 - drivers/gpu/drm/amd/display

[PATCH] drm/amd/pm: Replace 1-element arrays with flexible array members

2023-08-30 Thread Samuel Holland
efinitions in this file. Signed-off-by: Samuel Holland --- .../drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h | 20 +-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pptable_v1_0.h b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppta

[PATCH] drm/amd/display: Allow building DC with clang on RISC-V

2023-07-18 Thread Samuel Holland
clang on RISC-V appears to be unaffected by the bug causing excessive stack usage in calculate_bandwidth(). clang 16 with -fstack-usage reports a 304 byte stack frame size with CONFIG_ARCH_RV32I, and 512 bytes with CONFIG_ARCH_RV64I. Signed-off-by: Samuel Holland --- drivers/gpu/drm/amd