AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/8] drm/amdkfd: fix the kdf debugger issue
@ 2024-05-30  3:47 Jesse Zhang
  2024-05-30 20:47 ` Felix Kuehling
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Zhang @ 2024-05-30  3:47 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian Koenig, Felix Kuehling, jonathan.kim,
	Tim.Huang, Jesse Zhang, Jesse Zhang

the expression caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED
is always 1/true regardless of the values of its operand.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
index 3f27bab7a502..4abd275056d6 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
@@ -503,7 +503,7 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags)
 				kfd_topology_device_by_id(target->pdds[i]->dev->id);
 		uint32_t caps = topo_dev->node_props.capability;
 
-		if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
+		if (!(caps & HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
 			(*flags & KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP)) {
 			*flags = prev_flags;
 			return -EACCES;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/8] drm/amdkfd: fix the kdf debugger issue
  2024-05-30  3:47 [PATCH 2/8] drm/amdkfd: fix the kdf debugger issue Jesse Zhang
@ 2024-05-30 20:47 ` Felix Kuehling
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Kuehling @ 2024-05-30 20:47 UTC (permalink / raw)
  To: Jesse Zhang, amd-gfx
  Cc: Alexander.Deucher, Christian Koenig, jonathan.kim, Tim.Huang


On 2024-05-29 23:47, Jesse Zhang wrote:
> the expression caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED
> is always 1/true regardless of the values of its operand.
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>

Please add a Fixes tag. I think this is the commit that introduced the 
problem:

commit 75de8428c3d632eacc7890b7cb39dbec04d286c3
Author: Jonathan Kim <jonathan.kim@amd.com>
Date:   Mon Aug 21 11:47:47 2023 -0400

     drm/amdkfd: enable single alu ops for gfx12

     GFX12 debugging requires setting up precise ALU operation for catching
     ALU exceptions.

     Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
     Tested-by: Lancelot Six <lancelot.six@amd.com>
     Reviewed-by: Eric Huang <jinhuieric.huang@amd.com>
     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
> index 3f27bab7a502..4abd275056d6 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
> @@ -503,7 +503,7 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags)
>   				kfd_topology_device_by_id(target->pdds[i]->dev->id);
>   		uint32_t caps = topo_dev->node_props.capability;
>   
> -		if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
> +		if (!(caps & HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&

Looks like the same mistake was copied and pasted for 
HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED a few lines below. 
Please fix that as well while you're at it.

Thanks,
   Felix


>   			(*flags & KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP)) {
>   			*flags = prev_flags;
>   			return -EACCES;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/8] drm/amdkfd: fix the kdf debugger issue
@ 2024-05-31  2:51 Jesse Zhang
  2024-05-31 18:45 ` Felix Kuehling
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Zhang @ 2024-05-31  2:51 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian Koenig, Felix Kuehling, jonathan.kim,
	Tim.Huang, Jesse Zhang, Jesse Zhang

The expression caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED
and  caps | HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED
are always 1/true regardless of the values of its operand.

Fixes: 75de8428c3d632 ("drm/amdkfd: enable single alu ops for gfx12")
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Suggested-by: Felix Kuehling <felix.kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
index 3f27bab7a502..34a282540c7e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
@@ -503,13 +503,13 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags)
 				kfd_topology_device_by_id(target->pdds[i]->dev->id);
 		uint32_t caps = topo_dev->node_props.capability;
 
-		if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
+		if (!(caps & HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
 			(*flags & KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP)) {
 			*flags = prev_flags;
 			return -EACCES;
 		}
 
-		if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED) &&
+		if (!(caps & HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED) &&
 		    (*flags & KFD_DBG_TRAP_FLAG_SINGLE_ALU_OP)) {
 			*flags = prev_flags;
 			return -EACCES;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/8] drm/amdkfd: fix the kdf debugger issue
  2024-05-31  2:51 Jesse Zhang
@ 2024-05-31 18:45 ` Felix Kuehling
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Kuehling @ 2024-05-31 18:45 UTC (permalink / raw)
  To: Jesse Zhang, amd-gfx
  Cc: Alexander.Deucher, Christian Koenig, jonathan.kim, Tim.Huang

On 2024-05-30 22:51, Jesse Zhang wrote:
> The expression caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED
> and  caps | HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED
> are always 1/true regardless of the values of its operand.
>
> Fixes: 75de8428c3d632 ("drm/amdkfd: enable single alu ops for gfx12")
> Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
> Suggested-by: Felix Kuehling <felix.kuehling@amd.com>

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
> index 3f27bab7a502..34a282540c7e 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c
> @@ -503,13 +503,13 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags)
>   				kfd_topology_device_by_id(target->pdds[i]->dev->id);
>   		uint32_t caps = topo_dev->node_props.capability;
>   
> -		if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
> +		if (!(caps & HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED) &&
>   			(*flags & KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP)) {
>   			*flags = prev_flags;
>   			return -EACCES;
>   		}
>   
> -		if (!(caps | HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED) &&
> +		if (!(caps & HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED) &&
>   		    (*flags & KFD_DBG_TRAP_FLAG_SINGLE_ALU_OP)) {
>   			*flags = prev_flags;
>   			return -EACCES;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-31 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30  3:47 [PATCH 2/8] drm/amdkfd: fix the kdf debugger issue Jesse Zhang
2024-05-30 20:47 ` Felix Kuehling
  -- strict thread matches above, loose matches on Subject: below --
2024-05-31  2:51 Jesse Zhang
2024-05-31 18:45 ` Felix Kuehling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox