drm/amdkfd: Add SVM API support capability bits
Subsystems (4)
PATCH 1/1 drm/amdkfd: Add SVM API support capability bits
From: Philip Yang <[email protected]>
SVMAPISupported property added to HSA_CAPABILITY, the value match HSA_CAPABILITY defined in Thunk spec:
SVMAPISupported: it will not be supported on older kernels that don't have HMM or on systems with GFXv8 or older GPUs without support for 48-bit virtual addresses.
CoherentHostAccess property added to HSA_MEMORYPROPERTY, the value match HSA_MEMORYPROPERTY defined in Thunk spec:
CoherentHostAccess: whether or not device memory can be coherently accessed by the host CPU.
--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 6 ++++++ drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +6 -0
@@ -1419,6 +1419,12 @@ int kfd_topology_add_device(struct kfd_dev *gpu) dev->node_props.capability |= (adev->ras_features !=0 ) ?HSA_CAP_RASEVENTNOTIFY :0 ; +/* SVM API and HMM page migration work together, device memory type +* is initialized to not 0 when page migration register device memory. +*/ +if (adev->kfd.dev->pgmap.type !=0 ) + dev->node_props.capability |=HSA_CAP_SVMAPI_SUPPORTED ; +kfd_debug_print_topology ();if (!res)
drivers/gpu/drm/amd/amdkfd/kfd_topology.h +6 -4
@@ -53,8 +53,9 @@#define HSA_CAP_ASIC_REVISION_MASK 0x03c00000#define HSA_CAP_ASIC_REVISION_SHIFT 22#define HSA_CAP_SRAM_EDCSUPPORTED 0x04000000 +#define HSA_CAP_SVMAPI_SUPPORTED 0x08000000 -#define HSA_CAP_RESERVED 0xf80f8000 +#define HSA_CAP_RESERVED 0xf00f8000struct kfd_node_properties {uint64_t hive_id;
@@ -98,9 +99,10 @@ struct kfd_node_properties {#define HSA_MEM_HEAP_TYPE_GPU_LDS 4#define HSA_MEM_HEAP_TYPE_GPU_SCRATCH 5 -#define HSA_MEM_FLAGS_HOT_PLUGGABLE 0x00000001 -#define HSA_MEM_FLAGS_NON_VOLATILE 0x00000002 -#define HSA_MEM_FLAGS_RESERVED 0xfffffffc +#define HSA_MEM_FLAGS_HOT_PLUGGABLE 0x00000001 +#define HSA_MEM_FLAGS_NON_VOLATILE 0x00000002 +#define HSA_MEM_FLAGS_COHERENTHOSTACCESS 0x00000004 +#define HSA_MEM_FLAGS_RESERVED 0xfffffff8struct kfd_mem_properties {struct list_head list;
Signature · 1 line
2.32.0
Please ignore this patch.
Quoted 89 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Sierra
Sent: Wednesday, March 30, 2022 4:24 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Kuehling, Felix <[email protected]>; [email protected]; amd- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; akpm@linux- foundation.org; [email protected]; [email protected]
Subject: [PATCH] drm/amdkfd: Add SVM API support capability bitsFrom: Philip Yang <[email protected]>
SVMAPISupported property added to
HSA_CAPABILITY, the value matchHSA_CAPABILITYdefined in Thunk spec:SVMAPISupported: it will not be supported on older kernels that don't have HMM or on systems with GFXv8 or older GPUs without support for 48-bit virtual addresses.
CoherentHostAccess property added to
HSA_MEMORYPROPERTY, the value matchHSA_MEMORYPROPERTYdefined in Thunk spec:CoherentHostAccess: whether or not device memory can be coherently accessed by the host CPU.
Signed-off-by Philip Yang <[email protected]>Reviewed-by Felix Kuehling <[email protected]>Signed-off-by Felix Kuehling <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 6 ++++++ drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-0@@ -1419,6 +1419,12 @@ int kfd_topology_add_device(struct kfd_dev *gpu) dev->node_props.capability |= (adev->ras_features !=0 ) ?HSA_CAP_RASEVENTNOTIFY :0 ; +/* SVM API and HMM page migration work together, device memory type
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +4
-0+* is initialized to not 0 when page migration register device memory. +*/ +if (adev->kfd.dev->pgmap.type !=0 ) + dev->node_props.capability |=
HSA_CAP_SVMAPI_SUPPORTED;drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-0+kfd_debug_print_topology ();if (!res)drivers/gpu/drm/amd/amdkfd/kfd_topology.h +6
-5@@ -53,8 +53,9 @@#define HSA_CAP_ASIC_REVISION_MASK 0x03c00000#define HSA_CAP_ASIC_REVISION_SHIFT 22#define HSA_CAP_SRAM_EDCSUPPORTED 0x04000000 +#define HSA_CAP_SVMAPI_SUPPORTED 0x08000000 -#define HSA_CAP_RESERVED 0xf80f8000 +#define HSA_CAP_RESERVED 0xf00f8000struct kfd_node_properties {uint64_t hive_id;@@ -98,9 +99,10 @@ struct kfd_node_properties {#define HSA_MEM_HEAP_TYPE_GPU_LDS 4#define HSA_MEM_HEAP_TYPE_GPU_SCRATCH 5 -#define HSA_MEM_FLAGS_HOT_PLUGGABLE 0x00000001 -#define HSA_MEM_FLAGS_NON_VOLATILE 0x00000002 -#define HSA_MEM_FLAGS_RESERVED 0xfffffffc +#define HSA_MEM_FLAGS_HOT_PLUGGABLE 0x00000001 +#define HSA_MEM_FLAGS_NON_VOLATILE 0x00000002 +#define HSA_MEM_FLAGS_COHERENTHOSTACCESS 0x00000004 +#define HSA_MEM_FLAGS_RESERVED 0xfffffff8struct kfd_mem_properties {struct list_head list; --2.32.0
Quoted 9 lines · Alex Sierra
From: Philip Yang <[email protected]>
SVMAPISupported property added to
HSA_CAPABILITY, the value matchHSA_CAPABILITYdefined in Thunk spec:SVMAPISupported: it will not be supported on older kernels that don't have HMM or on systems with GFXv8 or older GPUs without support for 48-bit virtual addresses.
Quoted 5 lines
CoherentHostAccess property added to
HSA_MEMORYPROPERTY, the value matchHSA_MEMORYPROPERTYdefined in Thunk spec:CoherentHostAccess: whether or not device memory can be coherently accessed by the host CPU.
Could you translate this commit message into English? Reviewing Documentation/process/5.Posting.rst might be helpful.
Hi Matthew,
I sent this patch by accident. Please ignore it.
Regards,
Alex Sierra
Quoted 30 lines
-----Original Message-----
From: Matthew Wilcox <[email protected]>
Sent: Wednesday, March 30, 2022 4:29 PM
To: Sierra Guiza, Alejandro (Alex) <[email protected]>
Cc: [email protected]; [email protected]; Kuehling, Felix <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; amd- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] drm/amdkfd: Add SVM API support capability bitsQuoted 10 lines · Alex Sierra
From: Philip Yang <[email protected]>
SVMAPISupported property added to
HSA_CAPABILITY, the value matchHSA_CAPABILITYdefined in Thunk spec:SVMAPISupported: it will not be supported on older kernels that don't have HMM or on systems with GFXv8 or older GPUs without support for 48-bit virtual addresses.
CoherentHostAccess property added to
HSA_MEMORYPROPERTY, thevalue
Quoted 4 lines
match
HSA_MEMORYPROPERTYdefined in Thunk spec:CoherentHostAccess: whether or not device memory can be coherently accessed by the host CPU.
Could you translate this commit message into English? Reviewing
Documentation/process/5.Posting.rstmight be helpful.