On 5/6/25 04:09, Liang, Prike wrote: > [Public] > >> From: Koenig, Christian <[email protected]> >> Sent: Wednesday, April 30, 2025 7:57 PM >> To: Liang, Prike <[email protected]>; [email protected] >> Cc: Deucher, Alexander <[email protected]> >> Subject: Re: [PATCH v3 2/5] drm/amdgpu: don't sync the user queue eviction >> fence >> >> On 4/30/25 04:40, Prike Liang wrote: >>> Don't return and sync the user queue eviction fence; otherwise, the >>> eviction fence will be returned as a dependent fence during VM update >>> and refer to the fence result in leakage. >> >> Please drop that patch, it shouldn't be needed any more after the changes in >> patch #1. > > Yes, may I get patch#1( drm/amdgpu: promote the implicit sync to the > dependent read fences) reviewed?
Sorry, I thought I've already done that. Feel free to add Reviewed-by: Christian König <[email protected]> to that patch. Regards, Christian. > > >> Regards, >> Christian. >> >>> >>> Signed-off-by: Prike Liang <[email protected]> >>> --- >>> drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 11 +++++++++++ >>> drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h | 1 + >>> drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 ++++ >>> 3 files changed, 16 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c >>> index d86e611a9ff4..6c9b2b43a929 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c >>> @@ -224,6 +224,17 @@ void amdgpu_eviction_fence_detach(struct >> amdgpu_eviction_fence_mgr *evf_mgr, >>> dma_fence_put(stub); >>> } >>> >>> +bool amdgpu_eviction_fence_valid(struct dma_fence *f) { >>> + >>> + if(!f) >>> + return false; >>> + if (f->ops == &amdgpu_eviction_fence_ops) >>> + return true; >>> + >>> + return false; >>> +} >>> + >>> int amdgpu_eviction_fence_init(struct amdgpu_eviction_fence_mgr >>> *evf_mgr) { >>> /* This needs to be done one time per open */ diff --git >>> a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h >>> index fcd867b7147d..d4e1975cac71 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h >>> @@ -42,6 +42,7 @@ struct amdgpu_eviction_fence_mgr { }; >>> >>> /* Eviction fence helper functions */ >>> +bool amdgpu_eviction_fence_valid(struct dma_fence *f); >>> struct amdgpu_eviction_fence * >>> amdgpu_eviction_fence_create(struct amdgpu_eviction_fence_mgr >>> *evf_mgr); >>> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c >>> index d6ae9974c952..8ac685eb1be1 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c >>> @@ -185,6 +185,10 @@ static bool amdgpu_sync_test_fence(struct >>> amdgpu_device *adev, { >>> void *fence_owner = amdgpu_sync_get_owner(f); >>> >>> + /* don't sync the kgd userq eviction fence*/ >>> + if(amdgpu_eviction_fence_valid(f)) >>> + return false; >>> + >>> /* Always sync to moves, no matter what */ >>> if (fence_owner == AMDGPU_FENCE_OWNER_UNDEFINED) >>> return true; >
