For KFDTest testing, don't merge.
To verify if remote shootdown flushes the TLB on the importer.
exporter, amdgpu_ualink_revoke_exported_memory doesn't send NPA-REVOKE, so the
importer keeps the NPA address mapping. Still send remote shootdown to importer,
to flush importer TLB, and then unmap from NPA vm, free BO and NPA address.
The -EFAULT return makes the caller clear npa_release_bitmap, so the exporter
doesn't wait for an NPA-RELEASE that will never come. The resulting
"NPA-REVOKE send failed" errors are expected.
KFDTest UALink remote_shootdown_test steps:
exporter importer
1. export BO
2. import BO, map NPA address to GPU
access remote BO with SDMA
3. free BO, send remote shootdown
unmap from NPA vm
4. access remote BO with SDMA
Test result:
If GPU page fault on importer, test passed, remote shootdown works as expected
If GPU page fault on exporter NPA vmid 15, test failed, remote shootdown didn't
flush importer TLB or RPC not working.
Signed-off-by: Philip Yang <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
index 3b3339c5be08..b60390ebadca 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
@@ -1943,6 +1943,10 @@ static int amdgpu_ualink_send_npa_revoke_msg(struct
amdgpu_device *adev,
{
u32 dw0, dw1, dw2, dw3;
+ dev_dbg(adev->dev, "dont send NPA revoke to accel_id %u for KFDTest\n",
+ remote_acc_id);
+ return -EFAULT;
+
dw0 = lower_32_bits(handle.handle_lo);
dw0 &= ~AMDGPU_UALINK_MESSAGE_HEADER_MASK;
dw0 |= AMDGPU_UALINK_NPA_REVOKE_MSG;
--
2.50.1