2024-05-09 01:37:39

by Samuel Holland

[permalink] [raw]
Subject: [PATCH] ARM: Do not select ARCH_HAS_KERNEL_FPU_SUPPORT

On 32-bit ARM, conversions between `double` and `long long` require
runtime library support. Since the kernel does not currently provide
this library support, the amdgpu driver fails to build:

ERROR: modpost: "__aeabi_l2d" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: modpost: "__aeabi_d2ulz" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!

As Arnd reports, there are likely no 32-bit ARM platforms which can use
the amdgpu driver anyway, due to lack of features like 64-bit
prefetchable BARs. Since amdgpu is currently the only real user of
ARCH_HAS_KERNEL_FPU_SUPPORT, drop support for this option instead of
bothering to implement the library functions.

Fixes: 12624fe2d707 ("ARM: implement ARCH_HAS_KERNEL_FPU_SUPPORT")
Reported-by: Thiago Jung Bauermann <[email protected]>
Closes: https://lore.kernel.org/lkml/[email protected]/
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Suggested-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Samuel Holland <[email protected]>
---

arch/arm/Kconfig | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b1751c2cab87..b14aed3a17ab 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -15,7 +15,6 @@ config ARM
select ARCH_HAS_FORTIFY_SOURCE
select ARCH_HAS_KEEPINITRD
select ARCH_HAS_KCOV
- select ARCH_HAS_KERNEL_FPU_SUPPORT if KERNEL_MODE_NEON
select ARCH_HAS_MEMBARRIER_SYNC_CORE
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
--
2.44.0



2024-05-09 07:40:28

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH] ARM: Do not select ARCH_HAS_KERNEL_FPU_SUPPORT

On Thu, 9 May 2024 at 03:37, Samuel Holland <[email protected]> wrote:
>
> On 32-bit ARM, conversions between `double` and `long long` require
> runtime library support. Since the kernel does not currently provide
> this library support, the amdgpu driver fails to build:
>
> ERROR: modpost: "__aeabi_l2d" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
> ERROR: modpost: "__aeabi_d2ulz" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
>
> As Arnd reports, there are likely no 32-bit ARM platforms which can use
> the amdgpu driver anyway, due to lack of features like 64-bit
> prefetchable BARs. Since amdgpu is currently the only real user of
> ARCH_HAS_KERNEL_FPU_SUPPORT, drop support for this option instead of
> bothering to implement the library functions.
>
> Fixes: 12624fe2d707 ("ARM: implement ARCH_HAS_KERNEL_FPU_SUPPORT")

This commit is not in mainline yet. Could we just drop the original
patch instead?

> Reported-by: Thiago Jung Bauermann <[email protected]>
> Closes: https://lore.kernel.org/lkml/[email protected]/
> Reported-by: kernel test robot <[email protected]>
> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> Suggested-by: Ard Biesheuvel <[email protected]>
> Signed-off-by: Samuel Holland <[email protected]>
> ---
>
> arch/arm/Kconfig | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index b1751c2cab87..b14aed3a17ab 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -15,7 +15,6 @@ config ARM
> select ARCH_HAS_FORTIFY_SOURCE
> select ARCH_HAS_KEEPINITRD
> select ARCH_HAS_KCOV
> - select ARCH_HAS_KERNEL_FPU_SUPPORT if KERNEL_MODE_NEON
> select ARCH_HAS_MEMBARRIER_SYNC_CORE
> select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
> select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
> --
> 2.44.0
>

2024-05-14 22:48:49

by Samuel Holland

[permalink] [raw]
Subject: Re: [PATCH] ARM: Do not select ARCH_HAS_KERNEL_FPU_SUPPORT

Hello Ard,

On 2024-05-09 2:39 AM, Ard Biesheuvel wrote:
> On Thu, 9 May 2024 at 03:37, Samuel Holland <[email protected]> wrote:
>>
>> On 32-bit ARM, conversions between `double` and `long long` require
>> runtime library support. Since the kernel does not currently provide
>> this library support, the amdgpu driver fails to build:
>>
>> ERROR: modpost: "__aeabi_l2d" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
>> ERROR: modpost: "__aeabi_d2ulz" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
>>
>> As Arnd reports, there are likely no 32-bit ARM platforms which can use
>> the amdgpu driver anyway, due to lack of features like 64-bit
>> prefetchable BARs. Since amdgpu is currently the only real user of
>> ARCH_HAS_KERNEL_FPU_SUPPORT, drop support for this option instead of
>> bothering to implement the library functions.
>>
>> Fixes: 12624fe2d707 ("ARM: implement ARCH_HAS_KERNEL_FPU_SUPPORT")
>
> This commit is not in mainline yet. Could we just drop the original
> patch instead?

No, like I mentioned in the original thread, later patches in the series (for
example bbce5cac4f5a ("lib/raid6: use CC_FLAGS_FPU for NEON CFLAGS")) depend on
CC_FLAGS_FPU being defined for both arm and arm64.

arm can't select ARCH_HAS_KERNEL_FPU_SUPPORT because the contract of that option
is not fully implemented, but in my opinion it doesn't hurt to keep the part
that is implemented.

Regards,
Samuel

>> Reported-by: Thiago Jung Bauermann <[email protected]>
>> Closes: https://lore.kernel.org/lkml/[email protected]/
>> Reported-by: kernel test robot <[email protected]>
>> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
>> Suggested-by: Ard Biesheuvel <[email protected]>
>> Signed-off-by: Samuel Holland <[email protected]>
>> ---
>>
>> arch/arm/Kconfig | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index b1751c2cab87..b14aed3a17ab 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -15,7 +15,6 @@ config ARM
>> select ARCH_HAS_FORTIFY_SOURCE
>> select ARCH_HAS_KEEPINITRD
>> select ARCH_HAS_KCOV
>> - select ARCH_HAS_KERNEL_FPU_SUPPORT if KERNEL_MODE_NEON
>> select ARCH_HAS_MEMBARRIER_SYNC_CORE
>> select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
>> select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
>> --
>> 2.44.0
>>


2024-05-15 07:24:05

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH] ARM: Do not select ARCH_HAS_KERNEL_FPU_SUPPORT

On Wed, 15 May 2024 at 00:48, Samuel Holland <[email protected]> wrote:
>
> Hello Ard,
>
> On 2024-05-09 2:39 AM, Ard Biesheuvel wrote:
> > On Thu, 9 May 2024 at 03:37, Samuel Holland <[email protected]> wrote:
> >>
> >> On 32-bit ARM, conversions between `double` and `long long` require
> >> runtime library support. Since the kernel does not currently provide
> >> this library support, the amdgpu driver fails to build:
> >>
> >> ERROR: modpost: "__aeabi_l2d" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
> >> ERROR: modpost: "__aeabi_d2ulz" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
> >>
> >> As Arnd reports, there are likely no 32-bit ARM platforms which can use
> >> the amdgpu driver anyway, due to lack of features like 64-bit
> >> prefetchable BARs. Since amdgpu is currently the only real user of
> >> ARCH_HAS_KERNEL_FPU_SUPPORT, drop support for this option instead of
> >> bothering to implement the library functions.
> >>
> >> Fixes: 12624fe2d707 ("ARM: implement ARCH_HAS_KERNEL_FPU_SUPPORT")
> >
> > This commit is not in mainline yet. Could we just drop the original
> > patch instead?
>
> No, like I mentioned in the original thread, later patches in the series (for
> example bbce5cac4f5a ("lib/raid6: use CC_FLAGS_FPU for NEON CFLAGS")) depend on
> CC_FLAGS_FPU being defined for both arm and arm64.
>
> arm can't select ARCH_HAS_KERNEL_FPU_SUPPORT because the contract of that option
> is not fully implemented, but in my opinion it doesn't hurt to keep the part
> that is implemented.
>

Fair enough. But that still doesn't mean we have to add the 'select
ARCH_HAS_KERNEL_FPU_SUPPORT' only to back it out again.