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]
Message-ID: <15d5b9dc-8452-411c-9957-ba759d307223@amd.com>
Date: Thu, 9 Oct 2025 16:40:43 -0400
From: Harry Wentland <harry.wentland@....com>
To: Christian König <christian.koenig@....com>,
 Ard Biesheuvel <ardb+git@...gle.com>, linux-kernel@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org, Ard Biesheuvel <ardb@...nel.org>,
 Austin Zheng <austin.zheng@....com>, Jun Lei <jun.lei@....com>,
 Leo Li <sunpeng.li@....com>, Rodrigo Siqueira <siqueira@...lia.com>,
 Alex Deucher <alexander.deucher@....com>, amd-gfx@...ts.freedesktop.org,
 dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] drm/amd: Permit DC_FP_START/END only in non-FP
 compilation units



On 2025-10-09 12:19, Christian König wrote:
> On 09.10.25 17:06, Ard Biesheuvel wrote:
>> From: Ard Biesheuvel <ardb@...nel.org>
>>
>> Test the existing CPP macro _LINUX_FPU_COMPILATION_UNIT, which is set
>> when building source files that are permitted to use floating point,
>> in the implementation of DC_FP_START/END so that those are only usable
>> in non-FP code. This is a requirement of the generic kernel mode FPU
>> API, as some architectures (i.e., arm64) cannot safely enable FP codegen
>> in arbitrary code.
> 
> If I'm not completely mistaken that is actually an issue on basically all architectures, at least x86 is affected as well if I'm not completely mistaken.
> 
>> Cc: Austin Zheng <austin.zheng@....com>
>> Cc: Jun Lei <jun.lei@....com>
>> Cc: Harry Wentland <harry.wentland@....com>
>> Cc: Leo Li <sunpeng.li@....com>
>> Cc: Rodrigo Siqueira <siqueira@...lia.com>
>> Cc: Alex Deucher <alexander.deucher@....com>
>> Cc: "Christian König" <christian.koenig@....com>
>> Cc: amd-gfx@...ts.freedesktop.org
>> Cc: dri-devel@...ts.freedesktop.org
>> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> 
> Anyway, patch looks sane to me but I'm not so deep in the DC code to fully judge.
> 
> Fell free to add Acked-by: Christian König <christian.koenig@....com>, but Harry and Leo need to take a look.
> 

Thanks. Good safe-guard. Flags a bunch of issues in the
current code. Let me fix them before merging it.

Reviewed-by: Harry Wentland <harry.wentland@....com>

Harry

> Thanks,
> Christian.
> 
>> ---
>>  drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.h | 8 ++++++++
>>  drivers/gpu/drm/amd/display/dc/os_types.h      | 2 --
>>  2 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.h b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.h
>> index b8275b397920..4e921632bc4e 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.h
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.h
>> @@ -31,4 +31,12 @@ void dc_assert_fp_enabled(void);
>>  void dc_fpu_begin(const char *function_name, const int line);
>>  void dc_fpu_end(const char *function_name, const int line);
>>  
>> +#ifndef _LINUX_FPU_COMPILATION_UNIT
>> +#define DC_FP_START()	dc_fpu_begin(__func__, __LINE__)
>> +#define DC_FP_END()	dc_fpu_end(__func__, __LINE__)
>> +#else
>> +#define DC_FP_START()	BUILD_BUG()
>> +#define DC_FP_END()	BUILD_BUG()
>> +#endif
>> +
>>  #endif /* __DC_FPU_H__ */
>> diff --git a/drivers/gpu/drm/amd/display/dc/os_types.h b/drivers/gpu/drm/amd/display/dc/os_types.h
>> index 782316348941..6af831710489 100644
>> --- a/drivers/gpu/drm/amd/display/dc/os_types.h
>> +++ b/drivers/gpu/drm/amd/display/dc/os_types.h
>> @@ -55,8 +55,6 @@
>>  
>>  #if defined(CONFIG_DRM_AMD_DC_FP)
>>  #include "amdgpu_dm/dc_fpu.h"
>> -#define DC_FP_START() dc_fpu_begin(__func__, __LINE__)
>> -#define DC_FP_END() dc_fpu_end(__func__, __LINE__)
>>  #endif /* CONFIG_DRM_AMD_DC_FP */
>>  
>>  /*
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ