lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 30 May 2023 11:24:55 -0400
From:   Hamza Mahfooz <hamza.mahfooz@....com>
To:     amd-gfx@...ts.freedesktop.org
Cc:     Alex Deucher <alexander.deucher@....com>,
        Kenny Ho <kenny.ho@....com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Felix Kuehling <Felix.Kuehling@....com>,
        Harry Wentland <harry.wentland@....com>,
        André Almeida <andrealmeid@...lia.com>,
        Andrew Davis <afd@...com>, Peter Foley <pefoley2@...oley.com>,
        Hawking Zhang <Hawking.Zhang@....com>, Le Ma <le.ma@....com>,
        Tao Zhou <tao.zhou1@....com>, Lijo Lazar <lijo.lazar@....com>,
        James Zhu <James.Zhu@....com>,
        YiPeng Chai <YiPeng.Chai@....com>,
        Candice Li <candice.li@....com>,
        Yang Wang <KevinYang.Wang@....com>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amd/amdgpu: introduce DRM_AMDGPU_WERROR

On 5/25/23 12:38, Hamza Mahfooz wrote:
> We want to do -Werror builds on our CI. However, non-amdgpu breakages
> have prevented us from doing so thus far. Also, there are a number of
> additional checks that we should enable, that the community cares about
> and are hidden behind -Wextra. So, define DRM_AMDGPU_WERROR to only
> enable -Werror for the amdgpu kernel module and enable -Wextra while
> disabling all of the checks that are too noisy.
> 
> Cc: Alex Deucher <alexander.deucher@....com>
> Cc: Kenny Ho <kenny.ho@....com>
> Suggested-by: Jani Nikula <jani.nikula@...ux.intel.com>
> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@....com>

I am able to get clean builds with this enabled on GCC 11-13 and Clang
15, at least as of commit e786aef0869c ("drm/amd/display: remove unused
definition") on amd-staging-drm-next.

> ---
>   drivers/gpu/drm/amd/amdgpu/Kconfig  | 10 ++++++++++
>   drivers/gpu/drm/amd/amdgpu/Makefile |  9 +++++++++
>   2 files changed, 19 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig
> index 07135ffa6d24..334511f331e3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/Kconfig
> +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig
> @@ -66,6 +66,16 @@ config DRM_AMDGPU_USERPTR
>   	  This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it
>   	  isn't already selected to enabled full userptr support.
>   
> +config DRM_AMDGPU_WERROR
> +	bool "Force the compiler to throw an error instead of a warning when compiling"
> +	depends on DRM_AMDGPU
> +	depends on EXPERT
> +	depends on !COMPILE_TEST
> +	default n
> +	help
> +	  Add -Werror to the build flags for amdgpu.ko.
> +	  Only enable this if you are warning code for amdgpu.ko.
> +
>   source "drivers/gpu/drm/amd/acp/Kconfig"
>   source "drivers/gpu/drm/amd/display/Kconfig"
>   source "drivers/gpu/drm/amd/amdkfd/Kconfig"
> diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile
> index 74a9aa6fe18c..7ee68b1bbfed 100644
> --- a/drivers/gpu/drm/amd/amdgpu/Makefile
> +++ b/drivers/gpu/drm/amd/amdgpu/Makefile
> @@ -39,6 +39,15 @@ ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \
>   	-I$(FULL_AMD_DISPLAY_PATH)/amdgpu_dm \
>   	-I$(FULL_AMD_PATH)/amdkfd
>   
> +subdir-ccflags-y := -Wextra
> +subdir-ccflags-y += -Wunused-but-set-variable
> +subdir-ccflags-y += -Wno-unused-parameter
> +subdir-ccflags-y += -Wno-type-limits
> +subdir-ccflags-y += -Wno-sign-compare
> +subdir-ccflags-y += -Wno-missing-field-initializers
> +subdir-ccflags-y += -Wno-override-init
> +subdir-ccflags-$(CONFIG_DRM_AMDGPU_WERROR) += -Werror
> +
>   amdgpu-y := amdgpu_drv.o
>   
>   # add KMS driver
-- 
Hamza

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ