Re: [PATCH] drm/amdkfd: Fix the shift-out-of-bounds warning

2024-01-11 Thread Jay Cornwall
On 1/11/2024 11:25, Kim, Jonathan wrote: >> This looks OK. The compiler must be warning about a potential problem >> here, not a definite one. >> >> Question for Jon, how does the firmware encode the error code in the >> context ID? I see these macros: >> >> #define KFD_DEBUG_CP_BAD_OP_ECODE_MASK

RE: [PATCH] drm/amdkfd: Fix the shift-out-of-bounds warning

2024-01-11 Thread Kim, Jonathan
[Public] > -Original Message- > From: Kuehling, Felix > Sent: Thursday, January 11, 2024 11:03 AM > To: Ma, Jun ; Ma, Jun ; amd- > g...@lists.freedesktop.org; Kim, Jonathan > Subject: Re: [PATCH] drm/amdkfd: Fix the shift-out-of-bounds warning > > [+Jon] > >

Re: [PATCH] drm/amdkfd: Fix the shift-out-of-bounds warning

2024-01-11 Thread Felix Kuehling
[+Jon] On 2024-01-11 01:05, Ma, Jun wrote: Hi Felix, On 1/10/2024 11:57 PM, Felix Kuehling wrote: On 2024-01-10 04:39, Ma Jun wrote: There is following shift-out-of-bounds warning if ecode=0. "shift exponent 4294967295 is too large for 64-bit type 'long long unsigned int'" Signed-off-by:

Re: [PATCH] drm/amdkfd: Fix the shift-out-of-bounds warning

2024-01-10 Thread Ma, Jun
Hi Felix, On 1/10/2024 11:57 PM, Felix Kuehling wrote: > On 2024-01-10 04:39, Ma Jun wrote: >> There is following shift-out-of-bounds warning if ecode=0. >> "shift exponent 4294967295 is too large for 64-bit type 'long long unsigned >> int'" >> >> Signed-off-by: Ma Jun >> --- >>

Re: [PATCH] drm/amdkfd: Fix the shift-out-of-bounds warning

2024-01-10 Thread Felix Kuehling
On 2024-01-10 04:39, Ma Jun wrote: There is following shift-out-of-bounds warning if ecode=0. "shift exponent 4294967295 is too large for 64-bit type 'long long unsigned int'" Signed-off-by: Ma Jun --- include/uapi/linux/kfd_ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] drm/amdkfd: Fix the shift-out-of-bounds warning

2024-01-10 Thread Ma Jun
There is following shift-out-of-bounds warning if ecode=0. "shift exponent 4294967295 is too large for 64-bit type 'long long unsigned int'" Signed-off-by: Ma Jun --- include/uapi/linux/kfd_ioctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

RE: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2022-09-26 Thread Sider, Graham
[AMD Official Use Only - General] > -Original Message- > From: amd-gfx On Behalf Of Felix > Kuehling > Sent: Wednesday, September 21, 2022 6:30 PM > To: amd-gfx@lists.freedesktop.org > Cc: Ellis Michael > Subject: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds

[PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2022-09-21 Thread Felix Kuehling
This was fixed in initialize_cpsch before, but not in initialize_nocpsch. Factor sdma bitmap initialization into a helper function to apply the correct implementation in both cases without duplicating it. Reported-by: Ellis Michael Signed-off-by: Felix Kuehling ---

Re: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2021-03-15 Thread Lyude Paul
g...@lists.freedesktop.org> > Cc: Deucher, Alexander ; Kuehling, Felix > > Subject: Re: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning  > Tested-by: Lyude Paul > > That just leaves the KASAN error from read_indirect_azalia_reg, thanks for the &

Re: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2021-03-05 Thread Jacob, Anson
:08 PM To: Jacob, Anson ; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander ; Kuehling, Felix Subject: Re: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning Tested-by: Lyude Paul That just leaves the KASAN error from read_indirect_azalia_reg, thanks for the fix! On Thu, 2021-03-04

Re: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2021-03-05 Thread Lyude Paul
Tested-by: Lyude Paul That just leaves the KASAN error from read_indirect_azalia_reg, thanks for the fix! On Thu, 2021-03-04 at 15:08 -0500, Anson Jacob wrote: > If get_num_sdma_queues or get_num_xgmi_sdma_queues is 0, we end up > doing a shift operation where the number of bits shifted equals

RE: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2021-03-05 Thread Lazar, Lijo
/amdkfd: Fix UBSAN shift-out-of-bounds warning [AMD Public Use] -Original Message- From: amd-gfx On Behalf Of Anson Jacob Sent: Friday, March 5, 2021 1:39 AM To: amd-gfx@lists.freedesktop.org Cc: Jacob, Anson ; Deucher, Alexander ; Kuehling, Felix Subject: [PATCH] drm/amdkfd: Fix UBSAN

RE: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2021-03-04 Thread Lazar, Lijo
[AMD Public Use] -Original Message- From: amd-gfx On Behalf Of Anson Jacob Sent: Friday, March 5, 2021 1:39 AM To: amd-gfx@lists.freedesktop.org Cc: Jacob, Anson ; Deucher, Alexander ; Kuehling, Felix Subject: [PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

[PATCH] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2021-03-04 Thread Anson Jacob
If get_num_sdma_queues or get_num_xgmi_sdma_queues is 0, we end up doing a shift operation where the number of bits shifted equals number of bits in the operand. This behaviour is undefined. Set num_sdma_queues or num_xgmi_sdma_queues to ULLONG_MAX, if the count is >= number of bits in the