Commit 2030664b authored by Ben Goz's avatar Ben Goz Committed by Oded Gabbay

drm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)

This patch fixes a bug where deallocate_vmid() didn't actually unmap the
VMID<-->PASID mapping (in the registers).
That can cause undefined behavior.

This bug only occurs in non-HWS mode.
Signed-off-by: default avatarBen Goz <ben.goz@amd.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent fec77bb5
...@@ -161,6 +161,9 @@ static void deallocate_vmid(struct device_queue_manager *dqm, ...@@ -161,6 +161,9 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
{ {
int bit = qpd->vmid - KFD_VMID_START_OFFSET; int bit = qpd->vmid - KFD_VMID_START_OFFSET;
/* Release the vmid mapping */
set_pasid_vmid_mapping(dqm, 0, qpd->vmid);
set_bit(bit, (unsigned long *)&dqm->vmid_bitmap); set_bit(bit, (unsigned long *)&dqm->vmid_bitmap);
qpd->vmid = 0; qpd->vmid = 0;
q->properties.vmid = 0; q->properties.vmid = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment