Skip to contentSkip to conversation

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

PATCH In review Guenter Roeck 4 participants 14 messages Jun 18, 2022 – Jul 14, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
 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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +4 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -0
index 819d44a9439b..c3d2dd78f1e2 100644
@@ -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)
Signature · 1 line
2.35.1
#1 lore raw
Quoted 49 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
 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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +0 -0
index ec041e3cda30..74be02114ae4 100644

drivers/gpu/drm/amd/display/dc/dcn31/Makefile DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o · line 20

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +3 -0
@@ -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

Quoted 37 lines
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +1 -0
+
 AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -1
index 819d44a9439b..c3d2dd78f1e2 100644
@@ -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

#2 lore raw
Quoted 53 lines · Alex Deucher
Quoted 52 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
 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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +0 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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
 
Quoted 11 lines

drivers/gpu/drm/amd/display/dc/dcn31/Makefile DCN31 = dcn31_resource.o dcn31_hubbub.o dcn31_hwseq.o dcn31_init.o dcn31_hubp.o · line 20

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +3 -0
+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

Quoted 39 lines

Alex

Quoted 37 lines
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +1 -0
+
 AMD_DAL_DCN31 = $(addprefix $(AMDDALPATH)/dc/dcn31/,$(DCN31))
 
 AMD_DISPLAY_FILES += $(AMD_DAL_DCN31)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -1
index 819d44a9439b..c3d2dd78f1e2 100644
@@ -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

#3 lore raw
In reply to Guenter Roeck
Quoted 78 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
  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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +4 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +0 -0
index 819d44a9439b..c3d2dd78f1e2 100644

drivers/gpu/drm/amd/display/dc/dcn316/Makefile line 34

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -0
@@ -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

#4 lore raw
Quoted 86 lines · Rodrigo Siqueira Jordao
Quoted 78 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>

---
  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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +0 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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

drivers/gpu/drm/amd/display/dc/dcn31/Makefile +4 -0
+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)

drivers/gpu/drm/amd/display/dc/dcn315/Makefile +0 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -25,6 +25,10 @@

  DCN315 = dcn315_resource.o

drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
+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)

drivers/gpu/drm/amd/display/dc/dcn316/Makefile +0 -0
index 819d44a9439b..c3d2dd78f1e2 100644
@@ -25,6 +25,10 @@

  DCN316 = dcn316_resource.o

drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -0
+ifdef CONFIG_PPC64
+CFLAGS_$(AMDDALPATH)/dc/dcn316/dcn316_resource.o := -mhard-float -maltivec
+endif
+
Quoted 2 lines

  AMD_DAL_DCN316 = $(addprefix $(AMDDALPATH)/dc/dcn316/,$(DCN316)) AMD_DISPLAY_FILES += $(AMD_DAL_DCN316)

Hi,

Quoted 4 lines

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.

Quoted 1 line

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:

Quoted 2 lines

* 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

#5 lore raw
In reply to Rodrigo Siqueira Jordao
Quoted 86 lines · Rodrigo Siqueira Jordao
Quoted 73 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
  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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +4 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +0 -0
index 819d44a9439b..c3d2dd78f1e2 100644

drivers/gpu/drm/amd/display/dc/dcn316/Makefile line 31

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -0
@@ -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,

Quoted 2 lines

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

Acked-by
#6 lore raw
In reply to Rodrigo Siqueira Jordao
Quoted 91 lines · Rodrigo Siqueira Jordao
Quoted 87 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
  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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +4 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -0
index 819d44a9439b..c3d2dd78f1e2 100644
@@ -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))
 
Quoted 6 lines

drivers/gpu/drm/amd/display/dc/dcn316/Makefile line 34

Quoted 1 line
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +0 -0
  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:

We can sort the rest out for 5.20.

Alex

Quoted 12 lines

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

#7 lore raw
Quoted 97 lines · Alex Deucher
Quoted 95 lines · Rodrigo Siqueira Jordao
Quoted 78 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
   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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +4 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +0 -0
index 819d44a9439b..c3d2dd78f1e2 100644

drivers/gpu/drm/amd/display/dc/dcn316/Makefile line 34

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -0
@@ -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,

Quoted 9 lines
Quoted 2 lines

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:

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

#8 lore raw
Quoted 109 lines · Guenter Roeck
Quoted 97 lines · Alex Deucher
Quoted 95 lines · Rodrigo Siqueira Jordao
Quoted 78 lines · Guenter Roeck

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 <[email protected]>
Cc Daniel Axtens <[email protected]>
---
   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(+)
drivers/gpu/drm/amd/display/dc/dcn31/Makefile +4 -0
index ec041e3cda30..74be02114ae4 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +4 -0
index 59381d24800b..1395c1ced8c5 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +0 -0
index 819d44a9439b..c3d2dd78f1e2 100644

drivers/gpu/drm/amd/display/dc/dcn316/Makefile line 34

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +4 -0
@@ -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,

Quoted 9 lines
Quoted 2 lines

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:

We can sort the rest out for 5.20.

Quoted 6 lines

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

#9 lore raw

On Wed, Jul 13, 2022 at 05:20:40PM -0400, Alex Deucher wrote:
[ ... ]

Quoted 10 lines
Quoted 6 lines

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

#10 lore raw
In reply to Alex Deucher
Quoted 11 lines · Alex Deucher
Quoted 7 lines

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

#11 lore raw
Quoted 16 lines · Guenter Roeck
Quoted 11 lines · Alex Deucher
Quoted 7 lines

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:

Quoted 7 lines
# 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

#12 lore raw
Quoted 23 lines · Alex Deucher
Quoted 22 lines · Guenter Roeck
Quoted 11 lines · Alex Deucher
Quoted 7 lines

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
Quoted 6 lines
Quoted 1 line

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

Quoted 2 lines

Alex

#13 lore raw
Quoted 54 lines · Melissa Wen
Quoted 23 lines · Alex Deucher
Quoted 22 lines · Guenter Roeck
Quoted 11 lines · Alex Deucher
Quoted 7 lines

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
Quoted 6 lines
Quoted 1 line

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);

Quoted 7 lines

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.

Quoted 5 lines

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

---

drivers/gpu/drm/amd/display/dc/dcn31/Makefile +2 -0
index ec041e3cda30..44ff6f196860 100644
@@ -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 \
drivers/gpu/drm/amd/display/dc/dcn315/Makefile +2 -0
index 59381d24800b..55fcae2d2aae 100644
@@ -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)
drivers/gpu/drm/amd/display/dc/dcn316/Makefile +2 -0
index 819d44a9439b..7251ef9c1afb 100644
@@ -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)