2018-08-11 15:57:08

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

Building the DCN 1.0 Raven display driver with CONFIG_KCOV_INSTRUMENT_ALL=y
and CONFIG_KCOV_ENABLE_COMPARISONS=y results in warnings about many functions
that do a comparison of floating-point variables:

drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_bw_calc_rq_dlg_ttu':
dcn_calcs.c:(.text+0x263): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `hack_force_pipe_split':
dcn_calcs.c:(.text+0x155b): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_find_dcfclk_suits_all':
dcn_calcs.c:(.text+0x190e): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_validate_bandwidth':
dcn_calcs.c:(.text+0xe121): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_mod':
dcn_calc_math.c:(.text+0x22): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_min2':
dcn_calc_math.c:(.text+0xb2): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_ceil2':
dcn_calc_math.c:(.text+0x2a0): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max3':
dcn_calc_math.c:(.text+0x325): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max5':
dcn_calc_math.c:(.text+0x3c3): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_log':
dcn_calc_math.c:(.text+0x54e): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_math.c:(.text+0x57c): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `scaler_settings_calculation':
dcn_calc_auto.c:(.text+0x5c5): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0x137c): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0x9233): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0xb70f): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0x121fd): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `display_pipe_configuration':
dcn_calc_auto.c:(.text+0x15a2f): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0x17c2d): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0x19362): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0x25575): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0x27f33): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `get_refcyc_per_delivery':
display_rq_dlg_calc.c:(.text+0xb5): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `calculate_ttu_cursor.isra.1':
display_rq_dlg_calc.c:(.text+0x9f6): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `dml_rq_dlg_get_dlg_params':
display_rq_dlg_calc.c:(.text+0x82cc): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_refcyc_per_delivery.isra.0':
dml1_display_rq_dlg_calc.c:(.text+0x6c4): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_vratio_pre.isra.2':
dml1_display_rq_dlg_calc.c:(.text+0x957): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_swath_need.isra.3':
dml1_display_rq_dlg_calc.c:(.text+0xc8e): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_extract_rq_regs':
dml1_display_rq_dlg_calc.c:(.text+0x30a8): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
dml1_display_rq_dlg_calc.c:(.text+0x41ee): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
dml1_display_rq_dlg_calc.c:(.text+0x8f95): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o: In function `dml_round':
dml_common_defs.c:(.text+0x77): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.o: In function `adjust_ReturnBW':
display_mode_vba.c:(.text+0x4490): undefined reference to `__sanitizer_cov_trace_cmpd'

We already prevent the driver from being built on non-x86 architectures
because of its use of floating-point arithmetic, this extends the
dependency to also cover Kcov-enabled builds, which arguably is a much
more severe limitation.

I tried implementing the two functions in KCOV: __sanitizer_cov_trace_cmpd
and __sanitizer_cov_trace_cmpf, but that fails to build on architectures
that do not support any floating-point functions, or would require making
that code x86 specific as well. I also looked at what it would take to
convert the code to fixed-point arithmetic, but quickly gave up. This
is probably the right approach, but it requires a non-trivial amount of
work and certainly won't be appropriate as a bugfix.

Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
Link: drm: amd: dc: don't use FP math when Kcov is enabled
Signed-off-by: Arnd Bergmann <[email protected]>
---
v3: rebase on top of 4841203102a3, which removed the option for
CONFIG_DRM_AMD_DC_DCN1_0. The problem still gets hit occasionally
in randconfig testing.
---
drivers/gpu/drm/amd/display/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
index 325083b0297e..b132d434e572 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -3,6 +3,7 @@ menu "Display Engine Configuration"

config DRM_AMD_DC
bool "AMD DC - Enable new display engine"
+ depends on !X86 || !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN
default y
help
Choose this option if you want to use the new display engine
--
2.18.0



2018-08-12 07:58:09

by Christian König

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

Adding Harry as well.

Am 11.08.2018 um 17:54 schrieb Arnd Bergmann:
> Building the DCN 1.0 Raven display driver with CONFIG_KCOV_INSTRUMENT_ALL=y
> and CONFIG_KCOV_ENABLE_COMPARISONS=y results in warnings about many functions
> that do a comparison of floating-point variables:
>
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_bw_calc_rq_dlg_ttu':
> dcn_calcs.c:(.text+0x263): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `hack_force_pipe_split':
> dcn_calcs.c:(.text+0x155b): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_find_dcfclk_suits_all':
> dcn_calcs.c:(.text+0x190e): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_validate_bandwidth':
> dcn_calcs.c:(.text+0xe121): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_mod':
> dcn_calc_math.c:(.text+0x22): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_min2':
> dcn_calc_math.c:(.text+0xb2): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_ceil2':
> dcn_calc_math.c:(.text+0x2a0): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max3':
> dcn_calc_math.c:(.text+0x325): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max5':
> dcn_calc_math.c:(.text+0x3c3): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_log':
> dcn_calc_math.c:(.text+0x54e): undefined reference to `__sanitizer_cov_trace_cmpd'
> dcn_calc_math.c:(.text+0x57c): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `scaler_settings_calculation':
> dcn_calc_auto.c:(.text+0x5c5): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x137c): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x9233): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0xb70f): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x121fd): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `display_pipe_configuration':
> dcn_calc_auto.c:(.text+0x15a2f): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x17c2d): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x19362): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x25575): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x27f33): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `get_refcyc_per_delivery':
> display_rq_dlg_calc.c:(.text+0xb5): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `calculate_ttu_cursor.isra.1':
> display_rq_dlg_calc.c:(.text+0x9f6): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `dml_rq_dlg_get_dlg_params':
> display_rq_dlg_calc.c:(.text+0x82cc): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_refcyc_per_delivery.isra.0':
> dml1_display_rq_dlg_calc.c:(.text+0x6c4): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_vratio_pre.isra.2':
> dml1_display_rq_dlg_calc.c:(.text+0x957): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_swath_need.isra.3':
> dml1_display_rq_dlg_calc.c:(.text+0xc8e): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_extract_rq_regs':
> dml1_display_rq_dlg_calc.c:(.text+0x30a8): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> dml1_display_rq_dlg_calc.c:(.text+0x41ee): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> dml1_display_rq_dlg_calc.c:(.text+0x8f95): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o: In function `dml_round':
> dml_common_defs.c:(.text+0x77): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.o: In function `adjust_ReturnBW':
> display_mode_vba.c:(.text+0x4490): undefined reference to `__sanitizer_cov_trace_cmpd'
>
> We already prevent the driver from being built on non-x86 architectures
> because of its use of floating-point arithmetic, this extends the
> dependency to also cover Kcov-enabled builds, which arguably is a much
> more severe limitation.
>
> I tried implementing the two functions in KCOV: __sanitizer_cov_trace_cmpd
> and __sanitizer_cov_trace_cmpf, but that fails to build on architectures
> that do not support any floating-point functions, or would require making
> that code x86 specific as well. I also looked at what it would take to
> convert the code to fixed-point arithmetic, but quickly gave up. This
> is probably the right approach, but it requires a non-trivial amount of
> work and certainly won't be appropriate as a bugfix.
>
> Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
> Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
> Link: drm: amd: dc: don't use FP math when Kcov is enabled
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> v3: rebase on top of 4841203102a3, which removed the option for
> CONFIG_DRM_AMD_DC_DCN1_0. The problem still gets hit occasionally
> in randconfig testing.
> ---
> drivers/gpu/drm/amd/display/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
> index 325083b0297e..b132d434e572 100644
> --- a/drivers/gpu/drm/amd/display/Kconfig
> +++ b/drivers/gpu/drm/amd/display/Kconfig
> @@ -3,6 +3,7 @@ menu "Display Engine Configuration"
>
> config DRM_AMD_DC
> bool "AMD DC - Enable new display engine"
> + depends on !X86 || !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN
> default y
> help
> Choose this option if you want to use the new display engine


2018-08-13 15:25:23

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

On Mon, Aug 13, 2018 at 4:49 PM Alex Deucher <[email protected]> wrote:
>
> On Sun, Aug 12, 2018 at 3:55 AM Christian König
> <[email protected]> wrote:
> > Adding Harry as well.
> > Am 11.08.2018 um 17:54 schrieb Arnd Bergmann:
> > >
> > > Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
> > > Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
>
> Maybe it would be better to revert 4841203102a3 so we can limit the
> scope of this to DCN support.

That would help, but we would still require the patch at
https://patchwork.kernel.org/patch/10090227/ or something else to avoid
broken randconfig builds.

Arnd

2018-08-13 15:37:17

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

On Sun, Aug 12, 2018 at 3:55 AM Christian König
<[email protected]> wrote:
>
> Adding Harry as well.
>
> Am 11.08.2018 um 17:54 schrieb Arnd Bergmann:
> > Building the DCN 1.0 Raven display driver with CONFIG_KCOV_INSTRUMENT_ALL=y
> > and CONFIG_KCOV_ENABLE_COMPARISONS=y results in warnings about many functions
> > that do a comparison of floating-point variables:
> >
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_bw_calc_rq_dlg_ttu':
> > dcn_calcs.c:(.text+0x263): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `hack_force_pipe_split':
> > dcn_calcs.c:(.text+0x155b): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_find_dcfclk_suits_all':
> > dcn_calcs.c:(.text+0x190e): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_validate_bandwidth':
> > dcn_calcs.c:(.text+0xe121): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_mod':
> > dcn_calc_math.c:(.text+0x22): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_min2':
> > dcn_calc_math.c:(.text+0xb2): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_ceil2':
> > dcn_calc_math.c:(.text+0x2a0): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max3':
> > dcn_calc_math.c:(.text+0x325): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max5':
> > dcn_calc_math.c:(.text+0x3c3): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_log':
> > dcn_calc_math.c:(.text+0x54e): undefined reference to `__sanitizer_cov_trace_cmpd'
> > dcn_calc_math.c:(.text+0x57c): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `scaler_settings_calculation':
> > dcn_calc_auto.c:(.text+0x5c5): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> > dcn_calc_auto.c:(.text+0x137c): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> > dcn_calc_auto.c:(.text+0x9233): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> > dcn_calc_auto.c:(.text+0xb70f): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> > dcn_calc_auto.c:(.text+0x121fd): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `display_pipe_configuration':
> > dcn_calc_auto.c:(.text+0x15a2f): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> > dcn_calc_auto.c:(.text+0x17c2d): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> > dcn_calc_auto.c:(.text+0x19362): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> > dcn_calc_auto.c:(.text+0x25575): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> > dcn_calc_auto.c:(.text+0x27f33): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `get_refcyc_per_delivery':
> > display_rq_dlg_calc.c:(.text+0xb5): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `calculate_ttu_cursor.isra.1':
> > display_rq_dlg_calc.c:(.text+0x9f6): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `dml_rq_dlg_get_dlg_params':
> > display_rq_dlg_calc.c:(.text+0x82cc): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_refcyc_per_delivery.isra.0':
> > dml1_display_rq_dlg_calc.c:(.text+0x6c4): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_vratio_pre.isra.2':
> > dml1_display_rq_dlg_calc.c:(.text+0x957): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_swath_need.isra.3':
> > dml1_display_rq_dlg_calc.c:(.text+0xc8e): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_extract_rq_regs':
> > dml1_display_rq_dlg_calc.c:(.text+0x30a8): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> > dml1_display_rq_dlg_calc.c:(.text+0x41ee): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> > dml1_display_rq_dlg_calc.c:(.text+0x8f95): undefined reference to `__sanitizer_cov_trace_cmpf'
> > drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o: In function `dml_round':
> > dml_common_defs.c:(.text+0x77): undefined reference to `__sanitizer_cov_trace_cmpd'
> > drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.o: In function `adjust_ReturnBW':
> > display_mode_vba.c:(.text+0x4490): undefined reference to `__sanitizer_cov_trace_cmpd'
> >
> > We already prevent the driver from being built on non-x86 architectures
> > because of its use of floating-point arithmetic, this extends the
> > dependency to also cover Kcov-enabled builds, which arguably is a much
> > more severe limitation.
> >
> > I tried implementing the two functions in KCOV: __sanitizer_cov_trace_cmpd
> > and __sanitizer_cov_trace_cmpf, but that fails to build on architectures
> > that do not support any floating-point functions, or would require making
> > that code x86 specific as well. I also looked at what it would take to
> > convert the code to fixed-point arithmetic, but quickly gave up. This
> > is probably the right approach, but it requires a non-trivial amount of
> > work and certainly won't be appropriate as a bugfix.
> >
> > Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
> > Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")

Maybe it would be better to revert 4841203102a3 so we can limit the
scope of this to DCN support.

Alex


> > Link: drm: amd: dc: don't use FP math when Kcov is enabled
> > Signed-off-by: Arnd Bergmann <[email protected]>
> > ---
> > v3: rebase on top of 4841203102a3, which removed the option for
> > CONFIG_DRM_AMD_DC_DCN1_0. The problem still gets hit occasionally
> > in randconfig testing.
> > ---
> > drivers/gpu/drm/amd/display/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
> > index 325083b0297e..b132d434e572 100644
> > --- a/drivers/gpu/drm/amd/display/Kconfig
> > +++ b/drivers/gpu/drm/amd/display/Kconfig
> > @@ -3,6 +3,7 @@ menu "Display Engine Configuration"
> >
> > config DRM_AMD_DC
> > bool "AMD DC - Enable new display engine"
> > + depends on !X86 || !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN
> > default y
> > help
> > Choose this option if you want to use the new display engine
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

2018-08-14 09:18:53

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

On Tue, Aug 14, 2018 at 10:54 AM Michel Dänzer <[email protected]> wrote:
>
> On 2018-08-13 05:23 PM, Arnd Bergmann wrote:
> > On Mon, Aug 13, 2018 at 4:49 PM Alex Deucher <[email protected]> wrote:
> >>
> >> On Sun, Aug 12, 2018 at 3:55 AM Christian König
> >> <[email protected]> wrote:
> >>> Adding Harry as well.
> >>> Am 11.08.2018 um 17:54 schrieb Arnd Bergmann:
> >>>>
> >>>> Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
> >>>> Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
> >>
> >> Maybe it would be better to revert 4841203102a3 so we can limit the
> >> scope of this to DCN support.
> >
> > That would help, but we would still require the patch at
> > https://patchwork.kernel.org/patch/10090227/ or something else to avoid
> > broken randconfig builds.
>
> FWIW, please don't revert 4841203102a3 in a way which allows
> CONFIG_DRM_AMD_DC_DCN1_0 to be accidentally disabled on X86 again. If it
> is reinstated, it should be strictly derived from other options, not
> changeable by the user.

How about making all of AMDGPU depend on
" !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN"
then?

Arnd

2018-08-14 09:53:10

by Michel Dänzer

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

On 2018-08-13 05:23 PM, Arnd Bergmann wrote:
> On Mon, Aug 13, 2018 at 4:49 PM Alex Deucher <[email protected]> wrote:
>>
>> On Sun, Aug 12, 2018 at 3:55 AM Christian König
>> <[email protected]> wrote:
>>> Adding Harry as well.
>>> Am 11.08.2018 um 17:54 schrieb Arnd Bergmann:
>>>>
>>>> Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
>>>> Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
>>
>> Maybe it would be better to revert 4841203102a3 so we can limit the
>> scope of this to DCN support.
>
> That would help, but we would still require the patch at
> https://patchwork.kernel.org/patch/10090227/ or something else to avoid
> broken randconfig builds.

FWIW, please don't revert 4841203102a3 in a way which allows
CONFIG_DRM_AMD_DC_DCN1_0 to be accidentally disabled on X86 again. If it
is reinstated, it should be strictly derived from other options, not
changeable by the user.


--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

2018-08-14 10:26:22

by Christian König

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

Am 14.08.2018 um 11:15 schrieb Arnd Bergmann:
> On Tue, Aug 14, 2018 at 10:54 AM Michel Dänzer <[email protected]> wrote:
>> On 2018-08-13 05:23 PM, Arnd Bergmann wrote:
>>> On Mon, Aug 13, 2018 at 4:49 PM Alex Deucher <[email protected]> wrote:
>>>> On Sun, Aug 12, 2018 at 3:55 AM Christian König
>>>> <[email protected]> wrote:
>>>>> Adding Harry as well.
>>>>> Am 11.08.2018 um 17:54 schrieb Arnd Bergmann:
>>>>>> Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
>>>>>> Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
>>>> Maybe it would be better to revert 4841203102a3 so we can limit the
>>>> scope of this to DCN support.
>>> That would help, but we would still require the patch at
>>> https://patchwork.kernel.org/patch/10090227/ or something else to avoid
>>> broken randconfig builds.
>> FWIW, please don't revert 4841203102a3 in a way which allows
>> CONFIG_DRM_AMD_DC_DCN1_0 to be accidentally disabled on X86 again. If it
>> is reinstated, it should be strictly derived from other options, not
>> changeable by the user.
> How about making all of AMDGPU depend on
> " !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN"
> then?

Well, certainly not a good idea.

We don't want to disable the whole driver just because one broken component.

Christian.

>
> Arnd


2018-08-15 16:20:07

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: allmodconfig/allyesconfig doesn't work with Kernel 4.18 - Was: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

Em Sat, 11 Aug 2018 17:54:12 +0200
Arnd Bergmann <[email protected]> escreveu:

> Building the DCN 1.0 Raven display driver with CONFIG_KCOV_INSTRUMENT_ALL=y
> and CONFIG_KCOV_ENABLE_COMPARISONS=y results in warnings about many functions
> that do a comparison of floating-point variables:
>
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_bw_calc_rq_dlg_ttu':
> dcn_calcs.c:(.text+0x263): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `hack_force_pipe_split':
> dcn_calcs.c:(.text+0x155b): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_find_dcfclk_suits_all':
> dcn_calcs.c:(.text+0x190e): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_validate_bandwidth':
> dcn_calcs.c:(.text+0xe121): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_mod':
> dcn_calc_math.c:(.text+0x22): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_min2':
> dcn_calc_math.c:(.text+0xb2): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_ceil2':
> dcn_calc_math.c:(.text+0x2a0): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max3':
> dcn_calc_math.c:(.text+0x325): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max5':
> dcn_calc_math.c:(.text+0x3c3): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_log':
> dcn_calc_math.c:(.text+0x54e): undefined reference to `__sanitizer_cov_trace_cmpd'
> dcn_calc_math.c:(.text+0x57c): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `scaler_settings_calculation':
> dcn_calc_auto.c:(.text+0x5c5): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x137c): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x9233): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0xb70f): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x121fd): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `display_pipe_configuration':
> dcn_calc_auto.c:(.text+0x15a2f): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x17c2d): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x19362): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x25575): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x27f33): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `get_refcyc_per_delivery':
> display_rq_dlg_calc.c:(.text+0xb5): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `calculate_ttu_cursor.isra.1':
> display_rq_dlg_calc.c:(.text+0x9f6): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `dml_rq_dlg_get_dlg_params':
> display_rq_dlg_calc.c:(.text+0x82cc): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_refcyc_per_delivery.isra.0':
> dml1_display_rq_dlg_calc.c:(.text+0x6c4): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_vratio_pre.isra.2':
> dml1_display_rq_dlg_calc.c:(.text+0x957): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_swath_need.isra.3':
> dml1_display_rq_dlg_calc.c:(.text+0xc8e): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_extract_rq_regs':
> dml1_display_rq_dlg_calc.c:(.text+0x30a8): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> dml1_display_rq_dlg_calc.c:(.text+0x41ee): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> dml1_display_rq_dlg_calc.c:(.text+0x8f95): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o: In function `dml_round':
> dml_common_defs.c:(.text+0x77): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.o: In function `adjust_ReturnBW':
> display_mode_vba.c:(.text+0x4490): undefined reference to `__sanitizer_cov_trace_cmpd'
>
> We already prevent the driver from being built on non-x86 architectures
> because of its use of floating-point arithmetic, this extends the
> dependency to also cover Kcov-enabled builds, which arguably is a much
> more severe limitation.
>
> I tried implementing the two functions in KCOV: __sanitizer_cov_trace_cmpd
> and __sanitizer_cov_trace_cmpf, but that fails to build on architectures
> that do not support any floating-point functions, or would require making
> that code x86 specific as well. I also looked at what it would take to
> convert the code to fixed-point arithmetic, but quickly gave up. This
> is probably the right approach, but it requires a non-trivial amount of
> work and certainly won't be appropriate as a bugfix.
>
> Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
> Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
> Link: drm: amd: dc: don't use FP math when Kcov is enabled
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> v3: rebase on top of 4841203102a3, which removed the option for
> CONFIG_DRM_AMD_DC_DCN1_0. The problem still gets hit occasionally
> in randconfig testing.

Here, I'm getting this with allyesconfig and allmodconfig, on x86_64, with
gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5), with Kernel 4.18.

Please apply this patch upstream - or some other approach that would allow
allyesconfig/allmodconfig to work again, as not being able to build the
Kernel with those prevents us to see potential bugs on other drivers.

See ktest.pl relevant logs:

TEST 1 OPTIONS
ARCH[1] = x86_64
BUILD_TYPE[1] = allmodconfig
...
RUNNING TEST 1 of 19 (x86_64 ) with option build allmodconfig
...
Kernel: arch/x86/boot/bzImage is ready (#1)
ERROR: "__sanitizer_cov_trace_cmpd" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__sanitizer_cov_trace_cmpf" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
make[2]: *** [/devel/v4l/to_next/scripts/Makefile.modpost:92: __modpost] Error 1
make[1]: *** [/devel/v4l/to_next/Makefile:1208: modules] Error 2
make[1]: Leaving directory '/devel/v4l/ktests/ktest-cross-compile'
make: *** [Makefile:146: sub-make] Error 2
[679 seconds] FAILED!
FAILED: failed build
...
TEST 8 OPTIONS
ARCH[8] = x86_64
BUILD_TYPE[8] = allyesconfig
CROSS[8] =
MAKE_CMD[8] = make ARCH=x86_64 KCONFIG_ALLCONFIG=/devel/v4l/ktests/config-compiletest
...
MODPOST vmlinux.o
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_bw_calc_rq_dlg_ttu':
dcn_calcs.c:(.text+0x214): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0x54a): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calcs.c:(.text+0x611): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_find_dcfclk_suits_all':
dcn_calcs.c:(.text+0xea6): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0xeef): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0xf38): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0xf7a): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0x1014): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o:dcn_calcs.c:(.text+0x105d): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_validate_bandwidth':
dcn_calcs.c:(.text+0x6d2b): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calcs.c:(.text+0x6e6f): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0x6ef7): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0x6f77): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0x7181): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calcs.c:(.text+0x7673): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o:dcn_calc_math.c:(.text+0x27): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_ceil2':
dcn_calc_math.c:(.text+0x34d): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max3':
dcn_calc_math.c:(.text+0x3cd): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_math.c:(.text+0x3f8): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_math.c:(.text+0x41b): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_math.c:(.text+0x43e): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_math.c:(.text+0x47d): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o:dcn_calc_math.c:(.text+0x49d): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_log':
dcn_calc_math.c:(.text+0xb5e): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_math.c:(.text+0xb8c): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `scaler_settings_calculation':
dcn_calc_auto.c:(.text+0x164): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x1cb): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x49a): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x55b): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x586): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o:dcn_calc_auto.c:(.text+0x6f4): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0xb99): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x182e): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x1980): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x19af): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x1b49): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x1cab): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x1cd6): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x1e0c): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x1e8b): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x20c2): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x223f): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x266e): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x26a5): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x27c8): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x2901): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x2965): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x2c54): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x3265): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x32a2): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x3321): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x34d4): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o:dcn_calc_auto.c:(.text+0x35d7): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0x4363): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x4682): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x494b): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x49ce): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x4d78): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x4f1c): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o:dcn_calc_auto.c:(.text+0x4f65): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0x5091): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x578b): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x598f): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x67e0): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x6d5e): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x733f): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x73a1): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x745a): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x74bc): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x76b6): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x775e): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x77c0): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x7879): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x78db): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x80b7): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x8c6a): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x8ce9): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x8d2f): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x8d6f): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o:dcn_calc_auto.c:(.text+0x8dd9): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
dcn_calc_auto.c:(.text+0xacfa): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0xb1ed): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xbd73): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `display_pipe_configuration':
dcn_calc_auto.c:(.text+0xc51d): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xc6a5): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0xc732): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xcb77): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xd351): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xd376): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xd3d6): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0xda16): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xdab4): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xde82): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xeb8c): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xed71): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xedb6): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0xf399): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xf627): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xf7f5): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xf8c3): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0xfd1b): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o:dcn_calc_auto.c:(.text+0x1019d): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0x1380c): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x1389c): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x1391b): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x13981): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x13a0f): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x1429e): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x14555): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x146bd): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x14772): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o:dcn_calc_auto.c:(.text+0x147b3): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0x14e7e): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x15068): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x150e1): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x15225): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x157a0): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x157c8): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x1580f): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x15cc5): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x15cf6): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x15d8b): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x15e55): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x15e99): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o:dcn_calc_auto.c:(.text+0x1622d): more undefined references to `__sanitizer_cov_trace_cmpf' follow
drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
dcn_calc_auto.c:(.text+0x16835): undefined reference to `__sanitizer_cov_trace_cmpd'
dcn_calc_auto.c:(.text+0x169a4): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x169cd): undefined reference to `__sanitizer_cov_trace_cmpf'
dcn_calc_auto.c:(.text+0x16af3): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_refcyc_per_delivery.isra.0':
dml1_display_rq_dlg_calc.c:(.text+0x187): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_vratio_pre.isra.2':
dml1_display_rq_dlg_calc.c:(.text+0x431): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x4ae): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x4e2): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_swath_need.isra.4':
dml1_display_rq_dlg_calc.c:(.text+0x713): undefined reference to `__sanitizer_cov_trace_cmpf'
dml1_display_rq_dlg_calc.c:(.text+0x73e): undefined reference to `__sanitizer_cov_trace_cmpf'
dml1_display_rq_dlg_calc.c:(.text+0x7ce): undefined reference to `__sanitizer_cov_trace_cmpf'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_extract_rq_regs':
dml1_display_rq_dlg_calc.c:(.text+0x2fbe): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
dml1_display_rq_dlg_calc.c:(.text+0x3d0f): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x47c7): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x4f7b): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x4fa1): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o:dml1_display_rq_dlg_calc.c:(.text+0x4fd7): more undefined references to `__sanitizer_cov_trace_cmpd' follow
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
dml1_display_rq_dlg_calc.c:(.text+0x5e2e): undefined reference to `__sanitizer_cov_trace_cmpf'
dml1_display_rq_dlg_calc.c:(.text+0x5ee1): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x5fff): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x745d): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x74ac): undefined reference to `__sanitizer_cov_trace_cmpd'
dml1_display_rq_dlg_calc.c:(.text+0x7821): undefined reference to `__sanitizer_cov_trace_cmpd'
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o:dml1_display_rq_dlg_calc.c:(.text+0x785e): more undefined references to `__sanitizer_cov_trace_cmpd' follow
make[1]: *** [/devel/v4l/to_next/Makefile:1006: vmlinux] Error 1
make[1]: Leaving directory '/devel/v4l/ktests/ktest-cross-compile'
make: *** [Makefile:146: sub-make] Error 2
[686 seconds] FAILED!
FAILED: failed build

With Arnd's patch applied, allmodconfig/allyesconfig works again:

RUNNING TEST 1 of 19 (x86_64 ) with option build allmodconfig
KTEST RESULT: TEST 1 (x86_64 ) SUCCESS!!!! **
RUNNING TEST 8 of 19 (x86_64 ) with option build allyesconfig
KTEST RESULT: TEST 8 (x86_64 ) SUCCESS!!!! **



> ---
> drivers/gpu/drm/amd/display/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
> index 325083b0297e..b132d434e572 100644
> --- a/drivers/gpu/drm/amd/display/Kconfig
> +++ b/drivers/gpu/drm/amd/display/Kconfig
> @@ -3,6 +3,7 @@ menu "Display Engine Configuration"
>
> config DRM_AMD_DC
> bool "AMD DC - Enable new display engine"
> + depends on !X86 || !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN
> default y
> help
> Choose this option if you want to use the new display engine



Thanks,
Mauro

2018-08-16 19:59:05

by Leo Li

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled



On 2018-08-11 11:54 AM, Arnd Bergmann wrote:
> Building the DCN 1.0 Raven display driver with CONFIG_KCOV_INSTRUMENT_ALL=y
> and CONFIG_KCOV_ENABLE_COMPARISONS=y results in warnings about many functions
> that do a comparison of floating-point variables:
>
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_bw_calc_rq_dlg_ttu':
> dcn_calcs.c:(.text+0x263): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `hack_force_pipe_split':
> dcn_calcs.c:(.text+0x155b): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_find_dcfclk_suits_all':
> dcn_calcs.c:(.text+0x190e): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.o: In function `dcn_validate_bandwidth':
> dcn_calcs.c:(.text+0xe121): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_mod':
> dcn_calc_math.c:(.text+0x22): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_min2':
> dcn_calc_math.c:(.text+0xb2): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_ceil2':
> dcn_calc_math.c:(.text+0x2a0): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max3':
> dcn_calc_math.c:(.text+0x325): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_max5':
> dcn_calc_math.c:(.text+0x3c3): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.o: In function `dcn_bw_log':
> dcn_calc_math.c:(.text+0x54e): undefined reference to `__sanitizer_cov_trace_cmpd'
> dcn_calc_math.c:(.text+0x57c): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `scaler_settings_calculation':
> dcn_calc_auto.c:(.text+0x5c5): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x137c): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x9233): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0xb70f): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `mode_support_and_system_configuration':
> dcn_calc_auto.c:(.text+0x121fd): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `display_pipe_configuration':
> dcn_calc_auto.c:(.text+0x15a2f): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x17c2d): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x19362): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x25575): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_auto.o: In function `dispclkdppclkdcfclk_deep_sleep_prefetch_parameters_watermarks_and_performance_calculation':
> dcn_calc_auto.c:(.text+0x27f33): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `get_refcyc_per_delivery':
> display_rq_dlg_calc.c:(.text+0xb5): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `calculate_ttu_cursor.isra.1':
> display_rq_dlg_calc.c:(.text+0x9f6): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_rq_dlg_calc.o: In function `dml_rq_dlg_get_dlg_params':
> display_rq_dlg_calc.c:(.text+0x82cc): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_refcyc_per_delivery.isra.0':
> dml1_display_rq_dlg_calc.c:(.text+0x6c4): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_vratio_pre.isra.2':
> dml1_display_rq_dlg_calc.c:(.text+0x957): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `get_swath_need.isra.3':
> dml1_display_rq_dlg_calc.c:(.text+0xc8e): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_extract_rq_regs':
> dml1_display_rq_dlg_calc.c:(.text+0x30a8): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> dml1_display_rq_dlg_calc.c:(.text+0x41ee): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.o: In function `dml1_rq_dlg_get_dlg_params':
> dml1_display_rq_dlg_calc.c:(.text+0x8f95): undefined reference to `__sanitizer_cov_trace_cmpf'
> drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.o: In function `dml_round':
> dml_common_defs.c:(.text+0x77): undefined reference to `__sanitizer_cov_trace_cmpd'
> drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.o: In function `adjust_ReturnBW':
> display_mode_vba.c:(.text+0x4490): undefined reference to `__sanitizer_cov_trace_cmpd'
>
> We already prevent the driver from being built on non-x86 architectures
> because of its use of floating-point arithmetic, this extends the
> dependency to also cover Kcov-enabled builds, which arguably is a much
> more severe limitation.
>
> I tried implementing the two functions in KCOV: __sanitizer_cov_trace_cmpd
> and __sanitizer_cov_trace_cmpf, but that fails to build on architectures
> that do not support any floating-point functions, or would require making
> that code x86 specific as well. I also looked at what it would take to

Hi Arnd,

Is there a reason why we can't make __sanitizer_cov_trace_cmpd and
__sanitizer_cov_trace_cmpf X86 dependent?

I sent out two patches to disable DCN1, but would prefer implementing
these two functions as opposed to disabling a component.

Thanks,
Leo

> convert the code to fixed-point arithmetic, but quickly gave up. This
> is probably the right approach, but it requires a non-trivial amount of
> work and certainly won't be appropriate as a bugfix.
>
> Fixes: bf2e2e2e0ea9 ("drm/amd/display: Limit DCN to x86 arch")
> Fixes: 4841203102a3 ("drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86")
> Link: drm: amd: dc: don't use FP math when Kcov is enabled
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> v3: rebase on top of 4841203102a3, which removed the option for
> CONFIG_DRM_AMD_DC_DCN1_0. The problem still gets hit occasionally
> in randconfig testing.
> ---
> drivers/gpu/drm/amd/display/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
> index 325083b0297e..b132d434e572 100644
> --- a/drivers/gpu/drm/amd/display/Kconfig
> +++ b/drivers/gpu/drm/amd/display/Kconfig
> @@ -3,6 +3,7 @@ menu "Display Engine Configuration"
>
> config DRM_AMD_DC
> bool "AMD DC - Enable new display engine"
> + depends on !X86 || !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN
> default y
> help
> Choose this option if you want to use the new display engine
>

2018-08-16 21:03:51

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] [v3] drm: amd: dc: don't use FP math when Kcov is enabled

On Thu, Aug 16, 2018 at 9:56 PM Leo Li <[email protected]> wrote:
> On 2018-08-11 11:54 AM, Arnd Bergmann wrote:
> >
> > I tried implementing the two functions in KCOV: __sanitizer_cov_trace_cmpd
> > and __sanitizer_cov_trace_cmpf, but that fails to build on architectures
> > that do not support any floating-point functions, or would require making
> > that code x86 specific as well. I also looked at what it would take to
>
> Hi Arnd,
>
> Is there a reason why we can't make __sanitizer_cov_trace_cmpd and
> __sanitizer_cov_trace_cmpf X86 dependent?
>
> I sent out two patches to disable DCN1, but would prefer implementing
> these two functions as opposed to disabling a component.

I think it should be possible to implement them, perhaps not even hard
to do it in an architecture independent way. I tried this at some point
and couldn't figure it out, but I suppose it would fix the problem nicely.

This would assume that the two functions can only ever be called
from a context that already has access to the fpu, which I think is
the case here.

Arnd