diff mbox series

drm/amd/display: Add missing hard-float compile flags for PPC64 builds

Message ID 20220618232737.2036722-1-linux@roeck-us.net (mailing list archive)
State New, archived
Headers show
Series drm/amd/display: Add missing hard-float compile flags for PPC64 builds | expand

Commit Message

Guenter Roeck June 18, 2022, 11:27 p.m. UTC
ppc:allmodconfig builds fail with the following error.

powerpc64-linux-ld:
	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
		uses hard float,
	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
		uses soft float
powerpc64-linux-ld:
	failed to merge target specific data of file
	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
powerpc64-linux-ld:
	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
		uses hard float,
	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
		uses soft float
powerpc64-linux-ld:
	failed to merge target specific data of
	file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
powerpc64-linux-ld:
	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
		uses hard float,
	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
		uses soft float
powerpc64-linux-ld:
	failed to merge target specific data of file
	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o

The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
64-bit outline-only KASAN support") which adds support for KASAN. This
commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
compiled which lack the selection of hard-float.

Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Daniel Axtens <dja@axtens.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
 drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
 drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
 3 files changed, 12 insertions(+)

Comments

Alex Deucher June 20, 2022, 9:51 p.m. UTC | #1
On Sat, Jun 18, 2022 at 7:27 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> ppc:allmodconfig builds fail with the following error.
>
> powerpc64-linux-ld:
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>                 uses hard float,
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
>                 uses soft float
> powerpc64-linux-ld:
>         failed to merge target specific data of file
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> powerpc64-linux-ld:
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>                 uses hard float,
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
>                 uses soft float
> powerpc64-linux-ld:
>         failed to merge target specific data of
>         file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> powerpc64-linux-ld:
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>                 uses hard float,
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
>                 uses soft float
> powerpc64-linux-ld:
>         failed to merge target specific data of file
>         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
>
> The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
> 64-bit outline-only KASAN support") which adds support for KASAN. This
> commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
> KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
> compiled which lack the selection of hard-float.
>
> Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Daniel Axtens <dja@axtens.net>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
>  drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
>  drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
>  3 files changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> index ec041e3cda30..74be02114ae4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
>         dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
>         dcn31_afmt.o dcn31_vpg.o
>
> +ifdef CONFIG_PPC64
> +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
> +endif

This stuff was all moved as part of the FP rework in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=26f4712aedbdf4b9f5e3888a50a2a4b130ee4a9b
@Siqueira, Rodrigo
, @Melissa Wen, @Dhillon, Jasdeep  can you take a look to understand
why this is necessary?  If we add back the PPC flags, I think we need
to add back the x86 ones as well.

Alex

> +
>  AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
>
>  AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> index 59381d24800b..1395c1ced8c5 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> @@ -25,6 +25,10 @@
>
>  DCN315 = dcn315_resource.o
>
> +ifdef CONFIG_PPC64
> +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
> +endif
> +
>  AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
>
>  AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> index 819d44a9439b..c3d2dd78f1e2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> @@ -25,6 +25,10 @@
>
>  DCN316 = dcn316_resource.o
>
> +ifdef CONFIG_PPC64
> +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
> +endif
> +
>  AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
>
>  AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
> --
> 2.35.1
>
Guenter Roeck June 22, 2022, 12:26 a.m. UTC | #2
On Mon, Jun 20, 2022 at 05:51:04PM -0400, Alex Deucher wrote:
> On Sat, Jun 18, 2022 at 7:27 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > ppc:allmodconfig builds fail with the following error.
> >
> > powerpc64-linux-ld:
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >                 uses hard float,
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> >                 uses soft float
> > powerpc64-linux-ld:
> >         failed to merge target specific data of file
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> > powerpc64-linux-ld:
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >                 uses hard float,
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> >                 uses soft float
> > powerpc64-linux-ld:
> >         failed to merge target specific data of
> >         file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> > powerpc64-linux-ld:
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >                 uses hard float,
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> >                 uses soft float
> > powerpc64-linux-ld:
> >         failed to merge target specific data of file
> >         drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> >
> > The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
> > 64-bit outline-only KASAN support") which adds support for KASAN. This
> > commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
> > KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
> > compiled which lack the selection of hard-float.
> >
> > Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: Daniel Axtens <dja@axtens.net>
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> >  drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
> >  drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
> >  drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
> >  3 files changed, 12 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > index ec041e3cda30..74be02114ae4 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
> >         dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
> >         dcn31_afmt.o dcn31_vpg.o
> >
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
> > +endif
> 
> This stuff was all moved as part of the FP rework in:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=26f4712aedbdf4b9f5e3888a50a2a4b130ee4a9b
> @Siqueira, Rodrigo
> , @Melissa Wen, @Dhillon, Jasdeep  can you take a look to understand
> why this is necessary?  If we add back the PPC flags, I think we need
> to add back the x86 ones as well.
> 

For my part I have no idea. All I can see is that powerpc:allmodconfig
builds fail with the above errors. I have not seen any build errors with
other architectures.

Guenter

> Alex
> 
> > +
> >  AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
> >
> >  AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > index 59381d24800b..1395c1ced8c5 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > @@ -25,6 +25,10 @@
> >
> >  DCN315 = dcn315_resource.o
> >
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >  AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
> >
> >  AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > index 819d44a9439b..c3d2dd78f1e2 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > @@ -25,6 +25,10 @@
> >
> >  DCN316 = dcn316_resource.o
> >
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >  AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
> >
> >  AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
> > --
> > 2.35.1
> >
Rodrigo Siqueira Jordao June 30, 2022, 9:01 p.m. UTC | #3
On 2022-06-18 19:27, Guenter Roeck wrote:
> ppc:allmodconfig builds fail with the following error.
> 
> powerpc64-linux-ld:
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> 		uses hard float,
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> 		uses soft float
> powerpc64-linux-ld:
> 	failed to merge target specific data of file
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> powerpc64-linux-ld:
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> 		uses hard float,
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> 		uses soft float
> powerpc64-linux-ld:
> 	failed to merge target specific data of
> 	file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> powerpc64-linux-ld:
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> 		uses hard float,
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> 		uses soft float
> powerpc64-linux-ld:
> 	failed to merge target specific data of file
> 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> 
> The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
> 64-bit outline-only KASAN support") which adds support for KASAN. This
> commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
> KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
> compiled which lack the selection of hard-float.
> 
> Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Daniel Axtens <dja@axtens.net>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>   drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
>   drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
>   drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
>   3 files changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> index ec041e3cda30..74be02114ae4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
>   	dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
>   	dcn31_afmt.o dcn31_vpg.o
>   
> +ifdef CONFIG_PPC64
> +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
> +endif
> +
>   AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
>   
>   AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> index 59381d24800b..1395c1ced8c5 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> @@ -25,6 +25,10 @@
>   
>   DCN315 = dcn315_resource.o
>   
> +ifdef CONFIG_PPC64
> +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
> +endif
> +
>   AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
>   
>   AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> index 819d44a9439b..c3d2dd78f1e2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> @@ -25,6 +25,10 @@
>   
>   DCN316 = dcn316_resource.o
>   
> +ifdef CONFIG_PPC64
> +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
> +endif
> +
>   AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
>   
>   AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)

Hi,

I don't want to re-introduce those FPU flags for DCN31/DCN314/DCN316 
since we fully isolate FPU operations for those ASICs inside the DML 
folder. Notice that we have the PPC64 in the DML Makefile:

https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/dc/dml/Makefile

Could you share what you see without your patch in the 
amd-staging-drm-next? Also:
* Are you using cross-compilation? If so, could you share your setup?
* Which GCC/Clang version are you using?

Thanks
Siqueira
Guenter Roeck June 30, 2022, 9:34 p.m. UTC | #4
On 6/30/22 14:01, Rodrigo Siqueira Jordao wrote:
> 
> 
> On 2022-06-18 19:27, Guenter Roeck wrote:
>> ppc:allmodconfig builds fail with the following error.
>>
>> powerpc64-linux-ld:
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>>         uses hard float,
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
>>         uses soft float
>> powerpc64-linux-ld:
>>     failed to merge target specific data of file
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
>> powerpc64-linux-ld:
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>>         uses hard float,
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
>>         uses soft float
>> powerpc64-linux-ld:
>>     failed to merge target specific data of
>>     file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
>> powerpc64-linux-ld:
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>>         uses hard float,
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
>>         uses soft float
>> powerpc64-linux-ld:
>>     failed to merge target specific data of file
>>     drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
>>
>> The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
>> 64-bit outline-only KASAN support") which adds support for KASAN. This
>> commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
>> KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
>> compiled which lack the selection of hard-float.
>>
>> Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Daniel Axtens <dja@axtens.net>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>>   drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
>>   drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
>>   drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
>>   3 files changed, 12 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
>> index ec041e3cda30..74be02114ae4 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
>> +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
>> @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
>>       dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
>>       dcn31_afmt.o dcn31_vpg.o
>> +ifdef CONFIG_PPC64
>> +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
>> +endif
>> +
>>   AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
>>   AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
>> index 59381d24800b..1395c1ced8c5 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
>> +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
>> @@ -25,6 +25,10 @@
>>   DCN315 = dcn315_resource.o
>> +ifdef CONFIG_PPC64
>> +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
>> +endif
>> +
>>   AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
>>   AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
>> index 819d44a9439b..c3d2dd78f1e2 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
>> +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
>> @@ -25,6 +25,10 @@
>>   DCN316 = dcn316_resource.o
>> +ifdef CONFIG_PPC64
>> +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
>> +endif
>> +
>>   AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
>>   AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
> 
> Hi,
> 
> I don't want to re-introduce those FPU flags for DCN31/DCN314/DCN316 since we fully isolate FPU operations for those ASICs inside the DML folder. Notice that we have the PPC64 in the DML Makefile:
> 
> https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/dc/dml/Makefile
> 

Yes, sure, ppc64 is in dc/dml/Makefile. The problem is that it selects hard-float

ifdef CONFIG_PPC64
dml_ccflags := -mhard-float -maltivec
endif

and dc/{dcn31,dcn315,dcn316} don't.


> Could you share what you see without your patch in the amd-staging-drm-next?

You mean linux-next ? Same error.

Building powerpc:allmodconfig ... failed
--------------
Error log:
powerpc64-linux-ld: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o uses hard float, drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o uses soft float
powerpc64-linux-ld: failed to merge target specific data of file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
powerpc64-linux-ld: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o uses hard float, drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o uses soft float
powerpc64-linux-ld: failed to merge target specific data of file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
powerpc64-linux-ld: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o uses hard float, drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o uses soft float
powerpc64-linux-ld: failed to merge target specific data of file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o

This isn't really surprising since dc/dml/ does build with hard float, and
dc/{dcn31,dcn315,dcn316} build with soft float. As mentioned above,
the problem is now seen because DRM_AMD_DC_DCN is now enabled which was
previously not the case.

select DRM_AMD_DC_DCN if (X86 || PPC64) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Up to v5.18, both KCOV_INSTRUMENT_ALL and KCOV_ENABLE_COMPARISONS were enabled
and DRM_AMD_DC_DCN was therefore disabled. Now KCOV_INSTRUMENT_ALL and
KCOV_ENABLE_COMPARISONS are disabled, which results in DRM_AMD_DC_DCN=y.
This in turn results in the hard/soft float inconsistencies and the compile
failure.

  Also:
> * Are you using cross-compilation? If so, could you share your setup?
> * Which GCC/Clang version are you using?

gcc 11.2.0 with binutils 2.36.1, but that really does not make a difference.

Guenter
Guenter Roeck July 1, 2022, 1 a.m. UTC | #5
On Thu, Jun 30, 2022 at 05:01:01PM -0400, Rodrigo Siqueira Jordao wrote:
> 
> 
> On 2022-06-18 19:27, Guenter Roeck wrote:
> > ppc:allmodconfig builds fail with the following error.
> > 
> > powerpc64-linux-ld:
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> > 		uses hard float,
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> > 		uses soft float
> > powerpc64-linux-ld:
> > 	failed to merge target specific data of file
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> > powerpc64-linux-ld:
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> > 		uses hard float,
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> > 		uses soft float
> > powerpc64-linux-ld:
> > 	failed to merge target specific data of
> > 	file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> > powerpc64-linux-ld:
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> > 		uses hard float,
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> > 		uses soft float
> > powerpc64-linux-ld:
> > 	failed to merge target specific data of file
> > 	drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> > 
> > The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
> > 64-bit outline-only KASAN support") which adds support for KASAN. This
> > commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
> > KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
> > compiled which lack the selection of hard-float.
> > 
> > Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: Daniel Axtens <dja@axtens.net>
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> >   drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
> >   drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
> >   drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
> >   3 files changed, 12 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > index ec041e3cda30..74be02114ae4 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
> >   	dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
> >   	dcn31_afmt.o dcn31_vpg.o
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >   AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
> >   AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > index 59381d24800b..1395c1ced8c5 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > @@ -25,6 +25,10 @@
> >   DCN315 = dcn315_resource.o
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >   AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
> >   AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > index 819d44a9439b..c3d2dd78f1e2 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > @@ -25,6 +25,10 @@
> >   DCN316 = dcn316_resource.o
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >   AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
> >   AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
> 
> Hi,
> 
> I don't want to re-introduce those FPU flags for DCN31/DCN314/DCN316 since
> we fully isolate FPU operations for those ASICs inside the DML folder.

FWIW, I don't think that matters from a linking perspective since the hard-float
and the soft-float objects are linked together, and the linker bails out on
that because the ABIs are not compatible. You only get a warning on that unless
you build with -Werror, which is the case for allmodconfig builds.

Guenter
Alex Deucher July 13, 2022, 8:57 p.m. UTC | #6
On Thu, Jun 30, 2022 at 5:01 PM Rodrigo Siqueira Jordao
<Rodrigo.Siqueira@amd.com> wrote:
>
>
>
> On 2022-06-18 19:27, Guenter Roeck wrote:
> > ppc:allmodconfig builds fail with the following error.
> >
> > powerpc64-linux-ld:
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >               uses hard float,
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> >               uses soft float
> > powerpc64-linux-ld:
> >       failed to merge target specific data of file
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> > powerpc64-linux-ld:
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >               uses hard float,
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> >               uses soft float
> > powerpc64-linux-ld:
> >       failed to merge target specific data of
> >       file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> > powerpc64-linux-ld:
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >               uses hard float,
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> >               uses soft float
> > powerpc64-linux-ld:
> >       failed to merge target specific data of file
> >       drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> >
> > The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
> > 64-bit outline-only KASAN support") which adds support for KASAN. This
> > commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
> > KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
> > compiled which lack the selection of hard-float.
> >
> > Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: Daniel Axtens <dja@axtens.net>
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> >   drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
> >   drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
> >   drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
> >   3 files changed, 12 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > index ec041e3cda30..74be02114ae4 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> > @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
> >       dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
> >       dcn31_afmt.o dcn31_vpg.o
> >
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >   AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
> >
> >   AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > index 59381d24800b..1395c1ced8c5 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> > @@ -25,6 +25,10 @@
> >
> >   DCN315 = dcn315_resource.o
> >
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >   AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
> >
> >   AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > index 819d44a9439b..c3d2dd78f1e2 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> > @@ -25,6 +25,10 @@
> >
> >   DCN316 = dcn316_resource.o
> >
> > +ifdef CONFIG_PPC64
> > +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
> > +endif
> > +
> >   AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
> >
> >   AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
>
> Hi,
>
> I don't want to re-introduce those FPU flags for DCN31/DCN314/DCN316
> since we fully isolate FPU operations for those ASICs inside the DML

I don't understand why we don't need to add the hard-float flags back
on the other DCN blocks.  Did we miss something in the DML cleanup for
DCN 3.1.x?  Anyway, at this point, the patch is:
Acked-by: Alex Deucher <alexander.deucher@amd.com>
We can sort the rest out for 5.20.

Alex

> folder. Notice that we have the PPC64 in the DML Makefile:
>
> https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/dc/dml/Makefile
>
> Could you share what you see without your patch in the
> amd-staging-drm-next? Also:
> * Are you using cross-compilation? If so, could you share your setup?
> * Which GCC/Clang version are you using?
>
> Thanks
> Siqueira
>
Guenter Roeck July 13, 2022, 9:18 p.m. UTC | #7
On 7/13/22 13:57, Alex Deucher wrote:
> On Thu, Jun 30, 2022 at 5:01 PM Rodrigo Siqueira Jordao
> <Rodrigo.Siqueira@amd.com> wrote:
>>
>>
>>
>> On 2022-06-18 19:27, Guenter Roeck wrote:
>>> ppc:allmodconfig builds fail with the following error.
>>>
>>> powerpc64-linux-ld:
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>>>                uses hard float,
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
>>>                uses soft float
>>> powerpc64-linux-ld:
>>>        failed to merge target specific data of file
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
>>> powerpc64-linux-ld:
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>>>                uses hard float,
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
>>>                uses soft float
>>> powerpc64-linux-ld:
>>>        failed to merge target specific data of
>>>        file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
>>> powerpc64-linux-ld:
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
>>>                uses hard float,
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
>>>                uses soft float
>>> powerpc64-linux-ld:
>>>        failed to merge target specific data of file
>>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
>>>
>>> The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
>>> 64-bit outline-only KASAN support") which adds support for KASAN. This
>>> commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
>>> KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
>>> compiled which lack the selection of hard-float.
>>>
>>> Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>> Cc: Daniel Axtens <dja@axtens.net>
>>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>>> ---
>>>    drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
>>>    drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
>>>    drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
>>>    3 files changed, 12 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
>>> index ec041e3cda30..74be02114ae4 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
>>> +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
>>> @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
>>>        dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
>>>        dcn31_afmt.o dcn31_vpg.o
>>>
>>> +ifdef CONFIG_PPC64
>>> +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
>>> +endif
>>> +
>>>    AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
>>>
>>>    AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
>>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
>>> index 59381d24800b..1395c1ced8c5 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
>>> +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
>>> @@ -25,6 +25,10 @@
>>>
>>>    DCN315 = dcn315_resource.o
>>>
>>> +ifdef CONFIG_PPC64
>>> +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
>>> +endif
>>> +
>>>    AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
>>>
>>>    AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
>>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
>>> index 819d44a9439b..c3d2dd78f1e2 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
>>> +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
>>> @@ -25,6 +25,10 @@
>>>
>>>    DCN316 = dcn316_resource.o
>>>
>>> +ifdef CONFIG_PPC64
>>> +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
>>> +endif
>>> +
>>>    AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
>>>
>>>    AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
>>
>> Hi,
>>
>> I don't want to re-introduce those FPU flags for DCN31/DCN314/DCN316
>> since we fully isolate FPU operations for those ASICs inside the DML
> 
> I don't understand why we don't need to add the hard-float flags back
> on the other DCN blocks.  Did we miss something in the DML cleanup for
> DCN 3.1.x?  Anyway, at this point, the patch is:
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> We can sort the rest out for 5.20.
> 

The problem is not the FPU operations, but the fact that soft-float
and hard-float compiled code is linked together. The soft-float and
hard-float ABIs on powerpc are not compatible, so one ends up with
an object file which is partially soft-float and partially hard-float
compiled and thus uses different ABIs. That can only create chaos,
so the linker complains about it.

Guenter
Alex Deucher July 13, 2022, 9:20 p.m. UTC | #8
On Wed, Jul 13, 2022 at 5:18 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 7/13/22 13:57, Alex Deucher wrote:
> > On Thu, Jun 30, 2022 at 5:01 PM Rodrigo Siqueira Jordao
> > <Rodrigo.Siqueira@amd.com> wrote:
> >>
> >>
> >>
> >> On 2022-06-18 19:27, Guenter Roeck wrote:
> >>> ppc:allmodconfig builds fail with the following error.
> >>>
> >>> powerpc64-linux-ld:
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >>>                uses hard float,
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> >>>                uses soft float
> >>> powerpc64-linux-ld:
> >>>        failed to merge target specific data of file
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o
> >>> powerpc64-linux-ld:
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >>>                uses hard float,
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> >>>                uses soft float
> >>> powerpc64-linux-ld:
> >>>        failed to merge target specific data of
> >>>        file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn315/dcn315_resource.o
> >>> powerpc64-linux-ld:
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o
> >>>                uses hard float,
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> >>>                uses soft float
> >>> powerpc64-linux-ld:
> >>>        failed to merge target specific data of file
> >>>        drivers/gpu/drm/amd/amdgpu/../display/dc/dcn316/dcn316_resource.o
> >>>
> >>> The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S
> >>> 64-bit outline-only KASAN support") which adds support for KASAN. This
> >>> commit in turn enables DRM_AMD_DC_DCN because KCOV_INSTRUMENT_ALL and
> >>> KCOV_ENABLE_COMPARISONS are no longer enabled. As result, new files are
> >>> compiled which lack the selection of hard-float.
> >>>
> >>> Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")
> >>> Cc: Michael Ellerman <mpe@ellerman.id.au>
> >>> Cc: Daniel Axtens <dja@axtens.net>
> >>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> >>> ---
> >>>    drivers/gpu/drm/amd/display/dc/dcn31/Makefile  | 4 ++++
> >>>    drivers/gpu/drm/amd/display/dc/dcn315/Makefile | 4 ++++
> >>>    drivers/gpu/drm/amd/display/dc/dcn316/Makefile | 4 ++++
> >>>    3 files changed, 12 insertions(+)
> >>>
> >>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> >>> index ec041e3cda30..74be02114ae4 100644
> >>> --- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> >>> +++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
> >>> @@ -15,6 +15,10 @@ DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
> >>>        dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
> >>>        dcn31_afmt.o dcn31_vpg.o
> >>>
> >>> +ifdef CONFIG_PPC64
> >>> +CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
> >>> +endif
> >>> +
> >>>    AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
> >>>
> >>>    AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
> >>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> >>> index 59381d24800b..1395c1ced8c5 100644
> >>> --- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> >>> +++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
> >>> @@ -25,6 +25,10 @@
> >>>
> >>>    DCN315 = dcn315_resource.o
> >>>
> >>> +ifdef CONFIG_PPC64
> >>> +CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
> >>> +endif
> >>> +
> >>>    AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
> >>>
> >>>    AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
> >>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> >>> index 819d44a9439b..c3d2dd78f1e2 100644
> >>> --- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> >>> +++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
> >>> @@ -25,6 +25,10 @@
> >>>
> >>>    DCN316 = dcn316_resource.o
> >>>
> >>> +ifdef CONFIG_PPC64
> >>> +CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
> >>> +endif
> >>> +
> >>>    AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
> >>>
> >>>    AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
> >>
> >> Hi,
> >>
> >> I don't want to re-introduce those FPU flags for DCN31/DCN314/DCN316
> >> since we fully isolate FPU operations for those ASICs inside the DML
> >
> > I don't understand why we don't need to add the hard-float flags back
> > on the other DCN blocks.  Did we miss something in the DML cleanup for
> > DCN 3.1.x?  Anyway, at this point, the patch is:
> > Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > We can sort the rest out for 5.20.
> >
>
> The problem is not the FPU operations, but the fact that soft-float
> and hard-float compiled code is linked together. The soft-float and
> hard-float ABIs on powerpc are not compatible, so one ends up with
> an object file which is partially soft-float and partially hard-float
> compiled and thus uses different ABIs. That can only create chaos,
> so the linker complains about it.

I get that, I just don't see why only DCN 3.1.x files have this
problem.  The DCN 2.x files should as well.

Alex
Guenter Roeck July 13, 2022, 10:05 p.m. UTC | #9
On Wed, Jul 13, 2022 at 05:20:40PM -0400, Alex Deucher wrote:
[ ... ]
> > The problem is not the FPU operations, but the fact that soft-float
> > and hard-float compiled code is linked together. The soft-float and
> > hard-float ABIs on powerpc are not compatible, so one ends up with
> > an object file which is partially soft-float and partially hard-float
> > compiled and thus uses different ABIs. That can only create chaos,
> > so the linker complains about it.
> 
> I get that, I just don't see why only DCN 3.1.x files have this
> problem.  The DCN 2.x files should as well.
> 

No idea. Maybe ppc:allmodconfig only builds DCN 3.1.x, and other builds
don't use -Werror and the warning is ignored.

Guenter
Guenter Roeck July 13, 2022, 11:09 p.m. UTC | #10
On Wed, Jul 13, 2022 at 05:20:40PM -0400, Alex Deucher wrote:
> >
> > The problem is not the FPU operations, but the fact that soft-float
> > and hard-float compiled code is linked together. The soft-float and
> > hard-float ABIs on powerpc are not compatible, so one ends up with
> > an object file which is partially soft-float and partially hard-float
> > compiled and thus uses different ABIs. That can only create chaos,
> > so the linker complains about it.
> 
> I get that, I just don't see why only DCN 3.1.x files have this
> problem.  The DCN 2.x files should as well.
> 

Seen in drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile:

# prevent build errors regarding soft-float vs hard-float FP ABI tags
# this code is currently unused on ppc64, as it applies to Renoir APUs only
ifdef CONFIG_PPC64
CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
endif

Does that explain it ?

Guenter
Alex Deucher July 14, 2022, 1:11 a.m. UTC | #11
On Wed, Jul 13, 2022 at 7:09 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Wed, Jul 13, 2022 at 05:20:40PM -0400, Alex Deucher wrote:
> > >
> > > The problem is not the FPU operations, but the fact that soft-float
> > > and hard-float compiled code is linked together. The soft-float and
> > > hard-float ABIs on powerpc are not compatible, so one ends up with
> > > an object file which is partially soft-float and partially hard-float
> > > compiled and thus uses different ABIs. That can only create chaos,
> > > so the linker complains about it.
> >
> > I get that, I just don't see why only DCN 3.1.x files have this
> > problem.  The DCN 2.x files should as well.
> >
>
> Seen in drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile:
>
> # prevent build errors regarding soft-float vs hard-float FP ABI tags
> # this code is currently unused on ppc64, as it applies to Renoir APUs only
> ifdef CONFIG_PPC64
> CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
> endif
>
> Does that explain it ?

I would expect to see it in dcn20_resource.c and dcn30_clk_mgr.c for
example.  They follow the same pattern as the dcn 3.1.x files.  They
call functions that use FP, but maybe there is some FP code still in
those functions that we missed somehow.

Alex
Melissa Wen July 14, 2022, 6:49 p.m. UTC | #12
O 07/13, Alex Deucher wrote:
> On Wed, Jul 13, 2022 at 7:09 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Wed, Jul 13, 2022 at 05:20:40PM -0400, Alex Deucher wrote:
> > > >
> > > > The problem is not the FPU operations, but the fact that soft-float
> > > > and hard-float compiled code is linked together. The soft-float and
> > > > hard-float ABIs on powerpc are not compatible, so one ends up with
> > > > an object file which is partially soft-float and partially hard-float
> > > > compiled and thus uses different ABIs. That can only create chaos,
> > > > so the linker complains about it.
> > >
> > > I get that, I just don't see why only DCN 3.1.x files have this
> > > problem.  The DCN 2.x files should as well.
> > >
> >
> > Seen in drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile:
> >
> > # prevent build errors regarding soft-float vs hard-float FP ABI tags
> > # this code is currently unused on ppc64, as it applies to Renoir APUs only
> > ifdef CONFIG_PPC64
> > CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
> > endif
> >
> > Does that explain it ?
> 
> I would expect to see it in dcn20_resource.c and dcn30_clk_mgr.c for
> example.  They follow the same pattern as the dcn 3.1.x files.  They
> call functions that use FP, but maybe there is some FP code still in
> those functions that we missed somehow.

Hi,

I'm a little late here, but I'm not able to reproduce the issue yet.
I have this setup:
- gcc 11.3.0
- binutils 2.38.50
- mainline kernel (torvalds) version: 5.19.0-rc6 (cross-compiling)
  -> make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- allmodconfig
    => DRM_AMD_DC [=y] && HAS_IOMEM [=y] && DRM [=m] && DRM_AMDGPU [=m] && (X86 || PPC64 [=y]) && (!KCOV_INSTRUMENT_ALL [=n] || !KCOV_ENABLE_COMPARISONS [=n])
  -> make -j16 ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu-

Am I missing something?

So, as Alex mentioned the possibility of some non-isolated FPU code in
3.1, I reviewed dcn31 code and my best bet so far is that the issue
is here:

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c#L1721

Although dcn31_update_soc_for_wm_a() is only called inside
dml/dcn31/dcn31_fpu:
- dc->res_pool->funcs->update_soc_for_wm_a(dc, context);

it's declared in dcn31_resource and has FPU code. So, we should move it
to dml/dcn31/dcn31_fpu.

However, as I can't reproduce the issue, I don't know if it addresses
the problem reported here and also if everything will be clean after
moving it. 

Guenter,

Can you provide more info about your setup: cross-compile or not, any
flags, branch, etc?

Best Regards,

Melissa

> 
> Alex
Guenter Roeck July 14, 2022, 8:24 p.m. UTC | #13
On 7/14/22 11:49, Melissa Wen wrote:
> O 07/13, Alex Deucher wrote:
>> On Wed, Jul 13, 2022 at 7:09 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>>
>>> On Wed, Jul 13, 2022 at 05:20:40PM -0400, Alex Deucher wrote:
>>>>>
>>>>> The problem is not the FPU operations, but the fact that soft-float
>>>>> and hard-float compiled code is linked together. The soft-float and
>>>>> hard-float ABIs on powerpc are not compatible, so one ends up with
>>>>> an object file which is partially soft-float and partially hard-float
>>>>> compiled and thus uses different ABIs. That can only create chaos,
>>>>> so the linker complains about it.
>>>>
>>>> I get that, I just don't see why only DCN 3.1.x files have this
>>>> problem.  The DCN 2.x files should as well.
>>>>
>>>
>>> Seen in drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile:
>>>
>>> # prevent build errors regarding soft-float vs hard-float FP ABI tags
>>> # this code is currently unused on ppc64, as it applies to Renoir APUs only
>>> ifdef CONFIG_PPC64
>>> CFLAGS_$(AMDDALPATH)/dc/clk_mgr/dcn21/rn_clk_mgr.o := $(call cc-option,-mno-gnu-attribute)
>>> endif
>>>
>>> Does that explain it ?
>>
>> I would expect to see it in dcn20_resource.c and dcn30_clk_mgr.c for
>> example.  They follow the same pattern as the dcn 3.1.x files.  They
>> call functions that use FP, but maybe there is some FP code still in
>> those functions that we missed somehow.
> 
> Hi,
> 
> I'm a little late here, but I'm not able to reproduce the issue yet.
> I have this setup:
> - gcc 11.3.0
> - binutils 2.38.50
> - mainline kernel (torvalds) version: 5.19.0-rc6 (cross-compiling)
>    -> make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- allmodconfig
>      => DRM_AMD_DC [=y] && HAS_IOMEM [=y] && DRM [=m] && DRM_AMDGPU [=m] && (X86 || PPC64 [=y]) && (!KCOV_INSTRUMENT_ALL [=n] || !KCOV_ENABLE_COMPARISONS [=n])
>    -> make -j16 ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu-
> 
> Am I missing something?
> 
> So, as Alex mentioned the possibility of some non-isolated FPU code in
> 3.1, I reviewed dcn31 code and my best bet so far is that the issue
> is here:
> 
> https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c#L1721
> 
> Although dcn31_update_soc_for_wm_a() is only called inside
> dml/dcn31/dcn31_fpu:
> - dc->res_pool->funcs->update_soc_for_wm_a(dc, context);
> 
> it's declared in dcn31_resource and has FPU code. So, we should move it
> to dml/dcn31/dcn31_fpu.
> 
> However, as I can't reproduce the issue, I don't know if it addresses
> the problem reported here and also if everything will be clean after
> moving it.
> 

I don't think that would solve anything. As I have tried to point out,
the problem is that code compiled with hard-float is linked together
with code compiled with soft-float. An alternate fix might be something
like the one attached below, but I don't know if that would be correct
and/or complete.

> Guenter,
> 
> Can you provide more info about your setup: cross-compile or not, any
> flags, branch, etc?
> 

Nothing special. Same compile options as the ones you use, and it is a
cross-compile environment. I tried gcc 11.2.0 with binutils 2.36.1
and gcc 11.3.0 with binutils 2.38.

Guenter

---
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
index ec041e3cda30..44ff6f196860 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
@@ -10,6 +10,8 @@
  #
  # Makefile for dcn31.

+CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := $(call cc-option,-mno-gnu-attribute)
+
  DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o \
         dcn31_dccg.o dcn31_optc.o dcn31_dio_link_encoder.o dcn31_panel_cntl.o \
         dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
index 59381d24800b..55fcae2d2aae 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
@@ -25,6 +25,8 @@

  DCN315 = dcn315_resource.o

+CFLAGS_$(AMDDALPATH)/dc/dcn315/$(DCN315) := $(call cc-option,-mno-gnu-attribute)
+
  AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))

  AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
index 819d44a9439b..7251ef9c1afb 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
@@ -25,6 +25,8 @@

  DCN316 = dcn316_resource.o

+CFLAGS_$(AMDDALPATH)/dc/dcn316/$(DCN316) := $(call cc-option,-mno-gnu-attribute)
+
  AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))

  AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
index ec041e3cda30..74be02114ae4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/Makefile
@@ -15,6 +15,10 @@  DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o
 	dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
 	dcn31_afmt.o dcn31_vpg.o
 
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn31/dcn31_resource.o := -mhard-float -maltivec
+endif
+
 AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
index 59381d24800b..1395c1ced8c5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn315/Makefile
@@ -25,6 +25,10 @@ 
 
 DCN315 = dcn315_resource.o
 
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn315/dcn315_resource.o := -mhard-float -maltivec
+endif
+
 AMD_DAL_DCN315 = $(addprefix $(AMDDALPATH)/dc/dcn315/,$(DCN315))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_DCN315)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
index 819d44a9439b..c3d2dd78f1e2 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn316/Makefile
@@ -25,6 +25,10 @@ 
 
 DCN316 = dcn316_resource.o
 
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
+endif
+
 AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)