From patchwork Mon Dec 4 13:08:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 120533 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4412881qgn; Mon, 4 Dec 2017 05:10:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMZsFJ63OXrG3aH4T6mHE7bxh3k7IrYK+jCqWALaGoMXZk3P3Mf/tFBUd/vWkQ906Z7AaeWL X-Received: by 10.159.229.136 with SMTP id az8mr14560608plb.59.1512393046682; Mon, 04 Dec 2017 05:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512393046; cv=none; d=google.com; s=arc-20160816; b=QHzQxmi0IL2E7EcQqM4dXkC2XV4HLDDjiUERU/SnbHE+Qu/dzbvn0F1tO233I2JL+T Vd9Dut+w2Zh5A1Bq3IiL4JifIVXzRlN7hMCwXV77JCuPKV4rPEUqArjXQh1+C0Wdk8Vb O3ZDAvJ2M+MnsaqLRE4wua4MUkfIhseocR5V5YI9bPNbFhuNm3A55oo46a/lnKh9Jjhy qHLAHasvhSIpygawqzHFbdUHnSIAe9QPAF+6MqfW5cdGUwpSVXZ3e6gqZL1aP9FbONwm +3MOk18u+u4eFAnGPL9GeHZRRj6ZuJA8CemX4PdaVcZ26NqIGM5vlPjmwudOP8jpZOVi 6MxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=C64lXZHGhlRzlow7CioWTjo3RI/uA6KnlJlz4XRDN/s=; b=qJ7C/ctGTR6JEfnh/1KIIkbWWEgApvzysNBlh/m8RE0lVi9g1do9XF/jOduunvmAr0 +igipZett7hiE+xBQRqxbZvCgx//R7pjAcYYPVYgur5MXLkp124IGYT4+8ux4QA/5Yoi 1gAA3asieZN4Vxqj9yNU53z09CYSQrph5DAG7Np2WEtyyGzmeJ0DCwfEXrks09TtQfmC LJJ+pTcknoa/xhtBb8Ic7pQdB+759Jq5nfPsyISkr7axHzmcY6P3ez6Btv8j32MVi5/6 e565rlXu82DlKTjfOszWKedmeNOBWFBCZgp8o9vqZ9NrBMPZFTTaVPJboA/qSz4eRwNU 5g3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y84si10184215pfa.362.2017.12.04.05.10.46; Mon, 04 Dec 2017 05:10:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754048AbdLDNKo (ORCPT + 28 others); Mon, 4 Dec 2017 08:10:44 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:63219 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752235AbdLDNKm (ORCPT ); Mon, 4 Dec 2017 08:10:42 -0500 Received: from wuerfel.lan ([149.172.96.106]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lr2TD-1ezsIi1yyZ-00eg5L; Mon, 04 Dec 2017 14:10:35 +0100 From: Arnd Bergmann To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Cc: Arnd Bergmann , David Airlie , Harry Wentland , Jordan Lazare , Roman Li , Shirish S , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm: amd: dc: don't use FP math when Kcov is enabled Date: Mon, 4 Dec 2017 14:08:19 +0100 Message-Id: <20171204131031.1418828-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:sPrSIP9QbWEyPciVeDsn9aH2yLRAsXBwkLyo8ATaXUJauDSjlwZ KXGZ+EoRJymCdtpY20ppu3UJ3k45Zey/sqmvMjJXu480lJKncCQQ7lkUIDTXEBQAwYSI2F8 2CAuw55qnxn8/AYNFtlL/FEZ2kfNC2GwWZbpFIf7t9Tz58nOYagjDfSc/nOTT2SpxOScZyf 5uCZ3Q5H2sU51rSn50mkQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:wE1hu+Y18RY=:ZOCqR0OcqDcYlB2W7anPMO yoFA6IEPpaaNnqlvT64wPreifRaZu5mCfrF36TUZIkcpwrJV7iJ/klCNRxO1L4cpY+BZT5ufZ Se7gT6Hn+Jh0qctP66zSBzj4jAnNN8EkF0KbDqdCSUbnFuXCB1zY5xAdcf7BoovhaJmAmjimN oP0xYyDJT8/Sy5C7lkcVvyjD6358H5ZsUFF1q03buuOysaHtGToxNjrJiNAHQPT2g68TjaB06 +ZU4JKu1bmytZ1+WoTCDe/1Fvl54aFzSKZCuQs1Ds0m/C5NaHuJLAXUvOX3OTXFWHuMFS4GJi Ulzle4Xc5ID+08PV6w2OrW94ikjcovHbKmjHgS0fPPICyrH7dYsz3vv9c9TuWLf5Vm+RVYe1d LnVCjlpKXK74i3VAW7KLbM7/W+c8+s6yI02vY1lEjxaJW6jFfhhV33NF8IbaBD4TZzAOqtLIl LsU1SSoTr3MbG/6CdPpXqvuJnJT49O14W4XG8I3rh2BthXciPZWhzEBjCS2M4b9Rut2BLddho ijWY7dJQ/mJHxRVyAdwAmR38x4+657bVJ1Hyc0XBoUXzrEoEzLaTyDuzjoHA24PXIlQgd+QR1 m6GGuJPvjWEyUNwZGel4CBQxCxfBFwVPHtfCXmZOuWKrL0hOBzn2qYp1X6iW9cDYAhJGX+en2 klhScnvEI706ePIzx5y8t5D5MigpaRRlGYRQAlUr7+XVCPfpxeDsmX9lsqwYFIZgVpLE+9UZa PeGFQcFmYG2wiGh/LMcvekVq7PUrBR8jsAtD3A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/Kconfig | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig index ec3285f65517..5cd5906c9bee 100644 --- a/drivers/gpu/drm/amd/display/Kconfig +++ b/drivers/gpu/drm/amd/display/Kconfig @@ -30,6 +30,8 @@ config DRM_AMD_DC_FBC config DRM_AMD_DC_DCN1_0 bool "DCN 1.0 Raven family" depends on DRM_AMD_DC && X86 + # x86 floating point math here breaks with KCOV: + depends on !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) || BROKEN help Choose this option if you want to have RV family for display engine