Reset improvements for GC10+
Subsystems (2)
Alex Deucher
maintainerv2 cover Reset improvements for GC10+
This set improves per queue reset support for GC10+. This uses vmid resets for GFX. GFX resets all state associated with a vmid and then continues where it left off. Since once the IB uses the vmid, only the IB is reset and execution continues after the IB. Tested on GC 10 and 11 chips with a game running and then running hang tests. The game pauses when the hang happens, then continues after the queue reset.
I tried this same approach and GC8 and 9, but it was not as reliable as soft recovery. I also compared this to Christian's reset patches, but I was not able to make them work as reliably as this series.
Alex Deucher (9):
Revert "drm/amd/amdgpu: add pipe1 hardware support" drm/amdgpu: add AMDGPU_QUEUE_RESET_TIMEOUT drm/amdgpu: set the exec flag on the IB fence drm/amdgpu/gfx11: adjust ring reset sequences drm/amdgpu/gfx11: drop soft recovery drm/amdgpu/gfx12: adjust ring reset sequences drm/amdgpu/gfx12: drop soft recovery drm/amdgpu/gfx10: adjust ring reset sequences drm/amdgpu/gfx10: drop soft recovery
Christian König (1):
drm/amdgpu: rework queue reset scheduler interaction
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 ++++++++-------- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 41 ++++++++----------------- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/nvd.h | 1 + 7 files changed, 50 insertions(+), 92 deletions(-)
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v2 1/10 Revert "drm/amd/amdgpu: add pipe1 hardware support"
This reverts commit b7a1a0ef12b81957584fef7b61e2d5ec049c7209.
A user reported stuttering under heavy gfx load with this commit. I suspect it's due to the fact that the gfx contexts are shared between the pipes so if there is alot of load on one pipe, we could end up stalling waiting for a context.
On top of that, disabling the second pipe may fix the reliability of vmid resets.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
@@ -4781,7 +4781,7 @@ static int gfx_v10_0_sw_init(struct amdgpu_ip_block *ip_block)case IP_VERSION (10 ,3 ,3 ):case IP_VERSION (10 ,3 ,7 ): adev->gfx.me.num_me =1 ; - adev->gfx.me.num_pipe_per_me =2 ; + adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =2 ; adev->gfx.mec.num_mec =2 ; adev->gfx.mec.num_pipe_per_mec =4 ;
Signature · 1 line
2.49.0
Re: [PATCH 01/10] Revert "drm/amd/amdgpu: add pipe1 hardware support"
Quoted 6 lines · Alex Deucher
This reverts commit
b7a1a0ef12b81957584fef7b61e2d5ec049c7209.A user reported stuttering under heavy gfx load with this commit. I suspect it's due to the fact that the gfx contexts are shared between the pipes so if there is alot of load on one pipe, we could end up stalling waiting for a context.
Is there any mechanism to check the load per pipe? Debugfs? UMR?
Quoted 5 lines
On top of that, disabling the second pipe may fix the reliability of vmid resets.
btw, since this patch addresses an issue with Gitlab, should it be sent outside of this series?
Thanks
Quoted 22 lines
Reviewed-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1
-1@@ -4781,7 +4781,7 @@ static int gfx_v10_0_sw_init(struct amdgpu_ip_block *ip_block)case IP_VERSION (10 ,3 ,3 ):case IP_VERSION (10 ,3 ,7 ): adev->gfx.me.num_me =1 ; - adev->gfx.me.num_pipe_per_me =2 ; + adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =2 ; adev->gfx.mec.num_mec =2 ; adev->gfx.mec.num_pipe_per_mec =4 ;Signature · 1 line
2.49.0
Signature · 1 line
Rodrigo Siqueira
Re: [PATCH 01/10] Revert "drm/amd/amdgpu: add pipe1 hardware support"
Quoted 10 lines · Rodrigo Siqueira
Quoted 6 lines · Alex Deucher
This reverts commit
b7a1a0ef12b81957584fef7b61e2d5ec049c7209.A user reported stuttering under heavy gfx load with this commit. I suspect it's due to the fact that the gfx contexts are shared between the pipes so if there is alot of load on one pipe, we could end up stalling waiting for a context.
Is there any mechanism to check the load per pipe? Debugfs? UMR?
We expose one queue per pipe, so you can look at the outstanding fences on each gfx queue in debugfs.
Quoted 9 lines
Quoted 6 lines
On top of that, disabling the second pipe may fix the reliability of vmid resets.
btw, since this patch addresses an issue with Gitlab, should it be sent outside of this series?
I don't know that we ultimately want to apply this patch or not. I was thinking it might be helpful to address the issues Christian saw with his original series and I just kept to reduce the possible factors involved in validating this. Ultimately though it's a trade off between parallel execution and sharing available contexts.
Alex
Quoted 28 lines
Thanks
Quoted 20 lines
Reviewed-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1
-2@@ -4781,7 +4781,7 @@ static int gfx_v10_0_sw_init(struct amdgpu_ip_block *ip_block)case IP_VERSION (10 ,3 ,3 ):case IP_VERSION (10 ,3 ,7 ): adev->gfx.me.num_me =1 ; - adev->gfx.me.num_pipe_per_me =2 ; + adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =2 ; adev->gfx.mec.num_mec =2 ; adev->gfx.mec.num_pipe_per_mec =4 ; --Quoted 2 lines
2.49.0
--
Rodrigo Siqueira
Alex Deucher
maintainerPATCH v2 2/10 drm/amdgpu: rework queue reset scheduler interaction
In reply to Alex DeucherFrom: Christian König <[email protected]>
Stopping the scheduler for queue reset is generally a good idea because it prevents any worker from touching the ring buffer.
But using amdgpu_fence_driver_force_completion() before restarting it was a really bad idea because it marked fences as failed while the work was potentially still running.
Stop doing that and cleanup the comment a bit.
v2: keep amdgpu_fence_driver_force_completion() for non-gfx rings
--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +14 -12
@@ -136,10 +136,12 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) }else if (amdgpu_gpu_recovery && ring->funcs->reset) {bool is_guilty; -dev_err (adev->dev,"Starting %s ring reset\n" , s_job->sched->name); -/* stop the scheduler, but don't mess with the -* bad job yet because if ring reset fails -* we'll fall back to full GPU reset. +dev_err (adev->dev,"Starting %s ring reset\n" , + s_job->sched->name); + +/* +* Stop the scheduler to prevent anybody else from touching the +* ring buffer. */ drm_sched_wqueue_stop (&ring->sched);
@@ -157,19 +159,19 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) r =amdgpu_ring_reset (ring, job->vmid);if (!r) { -if (amdgpu_ring_sched_ready (ring)) -drm_sched_stop (&ring->sched, s_job);if (is_guilty) {atomic_inc (&ring->adev->gpu_reset_counter); -amdgpu_fence_driver_force_completion (ring); +if (ring->funcs->type !=AMDGPU_RING_TYPE_GFX ) +amdgpu_fence_driver_force_completion (ring); } -if (amdgpu_ring_sched_ready (ring)) -drm_sched_start (&ring->sched,0 ); -dev_err (adev->dev,"Ring %s reset succeeded\n" , ring->sched.name); -drm_dev_wedged_event (adev_to_drm (adev),DRM_WEDGE_RECOVERY_NONE ); +drm_sched_wqueue_start (&ring->sched); +dev_err (adev->dev,"Ring %s reset succeeded\n" , + ring->sched.name); +drm_dev_wedged_event (adev_to_drm (adev), +DRM_WEDGE_RECOVERY_NONE ); goto exit; } -dev_err (adev->dev,"Ring %s reset failure\n" , ring->sched.name); +dev_err (adev->dev,"Ring %s reset failed\n" , ring->sched.name); }dma_fence_set_error (&s_job->s_fence->finished, -ETIME );
Signature · 1 line
2.49.0
Re: [PATCH 02/10] drm/amdgpu: rework queue reset scheduler interaction
Quoted 5 lines · Alex Deucher
From: Christian König <[email protected]>
Stopping the scheduler for queue reset is generally a good idea because it prevents any worker from touching the ring buffer.
Quoted 7 lines
But using
amdgpu_fence_driver_force_completion()before restarting it was a really bad idea because it marked fences as failed while the work was potentially still running.Stop doing that and cleanup the comment a bit.
v2: keep
amdgpu_fence_driver_force_completion()for non-gfx rings
Why keep this amdgpu_fence_driver_force_completion() for non-gfx is ok? From the commit descriptions, sounds like we want to avoid amdgpu_fence_driver_force_completion() before the driver restarts the queue.
Quoted 60 lines
Reviewed-by Alex Deucher <[email protected]>Signed-off-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +14
-12@@ -136,10 +136,12 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) }else if (amdgpu_gpu_recovery && ring->funcs->reset) {bool is_guilty; -dev_err (adev->dev,"Starting %s ring reset\n" , s_job->sched->name); -/* stop the scheduler, but don't mess with the -* bad job yet because if ring reset fails -* we'll fall back to full GPU reset. +dev_err (adev->dev,"Starting %s ring reset\n" , + s_job->sched->name); + +/* +* Stop the scheduler to prevent anybody else from touching the +* ring buffer. */ drm_sched_wqueue_stop (&ring->sched);@@ -157,19 +159,19 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) r =amdgpu_ring_reset (ring, job->vmid);if (!r) { -if (amdgpu_ring_sched_ready (ring)) -drm_sched_stop (&ring->sched, s_job);if (is_guilty) {atomic_inc (&ring->adev->gpu_reset_counter); -amdgpu_fence_driver_force_completion (ring); +if (ring->funcs->type !=AMDGPU_RING_TYPE_GFX ) +amdgpu_fence_driver_force_completion (ring); } -if (amdgpu_ring_sched_ready (ring)) -drm_sched_start (&ring->sched,0 ); -dev_err (adev->dev,"Ring %s reset succeeded\n" , ring->sched.name); -drm_dev_wedged_event (adev_to_drm (adev),DRM_WEDGE_RECOVERY_NONE ); +drm_sched_wqueue_start (&ring->sched); +dev_err (adev->dev,"Ring %s reset succeeded\n" , + ring->sched.name); +drm_dev_wedged_event (adev_to_drm (adev), +DRM_WEDGE_RECOVERY_NONE ); goto exit; } -dev_err (adev->dev,"Ring %s reset failure\n" , ring->sched.name); +dev_err (adev->dev,"Ring %s reset failed\n" , ring->sched.name); }dma_fence_set_error (&s_job->s_fence->finished, -ETIME );Signature · 1 line
2.49.0
Signature · 1 line
Rodrigo Siqueira
Re: [PATCH 02/10] drm/amdgpu: rework queue reset scheduler interaction
Quoted 11 lines · Rodrigo Siqueira
Quoted 9 lines · Alex Deucher
From: Christian König <[email protected]>
Stopping the scheduler for queue reset is generally a good idea because it prevents any worker from touching the ring buffer.
But using
amdgpu_fence_driver_force_completion()before restarting it was a really bad idea because it marked fences as failed while the work was potentially still running.
Quoted 8 lines
Quoted 3 lines
Stop doing that and cleanup the comment a bit.
v2: keep
amdgpu_fence_driver_force_completion()for non-gfx ringsWhy keep this
amdgpu_fence_driver_force_completion()for non-gfx is ok? From the commit descriptions, sounds like we want to avoidamdgpu_fence_driver_force_completion()before the driver restarts the queue.
It depends on what the queue reset actually does. If the entire queue is lost, then amdgpu_fence_driver_force_completion() is what we want. If the queue reset is able to reset the queue and restore the non-guilty state, then there is no need to call this because the subsequent fences should signal and the rest of the jobs should naturally complete.
Alex
Quoted 64 lines
Quoted 59 lines
Reviewed-by Alex Deucher <[email protected]>Signed-off-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +14
-13@@ -136,10 +136,12 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) }else if (amdgpu_gpu_recovery && ring->funcs->reset) {bool is_guilty; -dev_err (adev->dev,"Starting %s ring reset\n" , s_job->sched->name); -/* stop the scheduler, but don't mess with the -* bad job yet because if ring reset fails -* we'll fall back to full GPU reset. +dev_err (adev->dev,"Starting %s ring reset\n" , + s_job->sched->name); + +/* +* Stop the scheduler to prevent anybody else from touching the +* ring buffer. */ drm_sched_wqueue_stop (&ring->sched);@@ -157,19 +159,19 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job) r =amdgpu_ring_reset (ring, job->vmid);if (!r) { -if (amdgpu_ring_sched_ready (ring)) -drm_sched_stop (&ring->sched, s_job);if (is_guilty) {atomic_inc (&ring->adev->gpu_reset_counter); -amdgpu_fence_driver_force_completion (ring); +if (ring->funcs->type !=AMDGPU_RING_TYPE_GFX ) +amdgpu_fence_driver_force_completion (ring); } -if (amdgpu_ring_sched_ready (ring)) -drm_sched_start (&ring->sched,0 ); -dev_err (adev->dev,"Ring %s reset succeeded\n" , ring->sched.name); -drm_dev_wedged_event (adev_to_drm (adev),DRM_WEDGE_RECOVERY_NONE ); +drm_sched_wqueue_start (&ring->sched); +dev_err (adev->dev,"Ring %s reset succeeded\n" , + ring->sched.name); +drm_dev_wedged_event (adev_to_drm (adev), +DRM_WEDGE_RECOVERY_NONE ); goto exit; } -dev_err (adev->dev,"Ring %s reset failure\n" , ring->sched.name); +dev_err (adev->dev,"Ring %s reset failed\n" , ring->sched.name); }dma_fence_set_error (&s_job->s_fence->finished, -ETIME ); --Quoted 2 lines
2.49.0
--
Rodrigo Siqueira
Alex Deucher
maintainerPATCH v2 3/10 drm/amdgpu: add AMDGPU_QUEUE_RESET_TIMEOUT
In reply to Alex DeucherAdd a new define for queue reset timeout. This will be used for the IB tests used when validatating ring resets.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -278,6 +278,7 @@ extern int amdgpu_user_queue;#define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000#define AMDGPU_MAX_USEC_TIMEOUT 100000/* 100 ms */ #define AMDGPU_FENCE_JIFFIES_TIMEOUT (HZ / 2) +#define AMDGPU_QUEUE_RESET_TIMEOUT (HZ / 10)#define AMDGPU_DEBUGFS_MAX_COMPONENTS 32#define AMDGPUFB_CONN_LIMIT 4#define AMDGPU_BIOS_NUM_SCRATCH 16
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v2 4/10 drm/amdgpu: set the exec flag on the IB fence
In reply to Alex DeucherThis is to make sure the CP executes this packet in the event of a preemption or reset.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -1
@@ -274,7 +274,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,/* wrap the last IB with fence */ if (job && job->uf_addr) {amdgpu_ring_emit_fence (ring, job->uf_addr, job->uf_sequence, - fence_flags |AMDGPU_FENCE_FLAG_64BIT ); + fence_flags |AMDGPU_FENCE_FLAG_64BIT | +AMDGPU_FENCE_FLAG_EXEC ); }if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec) {
Signature · 1 line
2.49.0
Re: [PATCH 04/10] drm/amdgpu: set the exec flag on the IB fence
Ignore this patch. I meant to drop it when I rebased these patches. It's not necessary.
Alex
Quoted 26 lines · Alex Deucher
This is to make sure the CP executes this packet in the event of a preemption or reset.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2
-2@@ -274,7 +274,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,/* wrap the last IB with fence */ if (job && job->uf_addr) {amdgpu_ring_emit_fence (ring, job->uf_addr, job->uf_sequence, - fence_flags |AMDGPU_FENCE_FLAG_64BIT ); + fence_flags |AMDGPU_FENCE_FLAG_64BIT | +AMDGPU_FENCE_FLAG_EXEC ); }if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec) { --2.49.0
Alex Deucher
maintainerPATCH v2 5/10 drm/amdgpu/gfx11: adjust ring reset sequences
In reply to Alex DeucherDon't clear the ring contents after we issue a VM reset just write the trailing fence. GFX block will reset the work associated with the vmid and and then continue from where it left off.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 18 ++++++++++-------- drivers/gpu/drm/amd/amdgpu/nvd.h | 1 + 2 files changed, 11 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +10 -8
@@ -5903,6 +5903,7 @@ static void gfx_v11_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, {bool write64bit = flags &AMDGPU_FENCE_FLAG_64BIT ;bool int_sel = flags &AMDGPU_FENCE_FLAG_INT ; +bool exec = flags &AMDGPU_FENCE_FLAG_EXEC ;/* RELEASE_MEM - flush caches, send int */ amdgpu_ring_write (ring,PACKET3 (PACKET3_RELEASE_MEM ,6 ));
@@ -5912,7 +5913,8 @@ static void gfx_v11_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,PACKET3_RELEASE_MEM_GCR_GLM_WB |PACKET3_RELEASE_MEM_CACHE_POLICY (3 ) |PACKET3_RELEASE_MEM_EVENT_TYPE (CACHE_FLUSH_AND_INV_TS_EVENT ) | - PACKET3_RELEASE_MEM_EVENT_INDEX(5))); +PACKET3_RELEASE_MEM_EVENT_INDEX (5 ) | + (exec ? PACKET3_RELEASE_MEM_EXECUTE_GFX11 : 0)));amdgpu_ring_write (ring, (PACKET3_RELEASE_MEM_DATA_SEL (write64bit ?2 :1 ) |PACKET3_RELEASE_MEM_INT_SEL (int_sel ?2 :0 )));
@@ -6823,19 +6825,19 @@ static int gfx_v11_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)return r; } - r =gfx_v11_0_kgq_init_queue (ring, true); -if (r) { -dev_err (adev->dev,"failed to init kgq\n" ); -return r; - } - r =amdgpu_mes_map_legacy_queue (adev, ring);if (r) {dev_err (adev->dev,"failed to remap kgq\n" );return r; } -return amdgpu_ring_test_ring (ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->fence_drv.sync_seq,AMDGPU_FENCE_FLAG_EXEC ); +amdgpu_ring_commit (ring); + +return gfx_v11_0_ring_test_ib (ring,AMDGPU_QUEUE_RESET_TIMEOUT ); }static int gfx_v11_0_reset_compute_pipe (struct amdgpu_ring *ring)
drivers/gpu/drm/amd/amdgpu/nvd.h +1 -0
@@ -371,6 +371,7 @@* 3 - cache_policy__me_release_mem__bypass */ #define PACKET3_RELEASE_MEM_EXECUTE (1 << 28) +#define PACKET3_RELEASE_MEM_EXECUTE_GFX11 (3 << 28)#define PACKET3_RELEASE_MEM_DATA_SEL (x) ((x) << 29)/* 0 - discard
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v2 6/10 drm/amdgpu/gfx11: drop soft recovery
In reply to Alex DeucherDrop wave vmid kill in favor of queue resets.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +0 -17
@@ -6280,21 +6280,6 @@ static void gfx_v11_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, ref, mask, 0x20); } -static void gfx_v11_0_ring_soft_recovery (struct amdgpu_ring *ring, -unsigned vmid) -{ -struct amdgpu_device *adev = ring->adev; -uint32_t value =0 ; - - value =REG_SET_FIELD (value,SQ_CMD ,CMD ,0x03 ); - value =REG_SET_FIELD (value,SQ_CMD ,MODE ,0x01 ); - value =REG_SET_FIELD (value,SQ_CMD ,CHECK_VMID ,1 ); - value =REG_SET_FIELD (value,SQ_CMD ,VM_ID , vmid); -amdgpu_gfx_rlc_enter_safe_mode (adev,0 ); -WREG32_SOC15 (GC ,0 , regSQ_CMD, value); -amdgpu_gfx_rlc_exit_safe_mode (adev,0 ); -} - static void gfx_v11_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, uint32_t me, uint32_t pipe,
@@ -7233,7 +7218,6 @@ static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_gfx = { .emit_wreg = gfx_v11_0_ring_emit_wreg, .emit_reg_wait = gfx_v11_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v11_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v11_0_ring_soft_recovery, .emit_mem_sync = gfx_v11_0_emit_mem_sync, .reset = gfx_v11_0_reset_kgq, .emit_cleaner_shader = gfx_v11_0_ring_emit_cleaner_shader,
@@ -7275,7 +7259,6 @@ static const struct amdgpu_ring_funcs gfx_v11_0_ring_funcs_compute = { .emit_wreg = gfx_v11_0_ring_emit_wreg, .emit_reg_wait = gfx_v11_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v11_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v11_0_ring_soft_recovery, .emit_mem_sync = gfx_v11_0_emit_mem_sync, .reset = gfx_v11_0_reset_kcq, .emit_cleaner_shader = gfx_v11_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v2 7/10 drm/amdgpu/gfx12: adjust ring reset sequences
In reply to Alex DeucherDon't clear the ring contents after we issue a VM reset just write the trailing fence. GFX block will reset the work associated with the vmid and and then continue from where it left off.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +10 -8
@@ -4448,6 +4448,7 @@ static void gfx_v12_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, {bool write64bit = flags &AMDGPU_FENCE_FLAG_64BIT ;bool int_sel = flags &AMDGPU_FENCE_FLAG_INT ; +bool exec = flags &AMDGPU_FENCE_FLAG_EXEC ;/* RELEASE_MEM - flush caches, send int */ amdgpu_ring_write (ring,PACKET3 (PACKET3_RELEASE_MEM ,6 ));
@@ -4455,7 +4456,8 @@ static void gfx_v12_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,PACKET3_RELEASE_MEM_GCR_GL2_WB |PACKET3_RELEASE_MEM_CACHE_POLICY (3 ) |PACKET3_RELEASE_MEM_EVENT_TYPE (CACHE_FLUSH_AND_INV_TS_EVENT ) | - PACKET3_RELEASE_MEM_EVENT_INDEX(5))); +PACKET3_RELEASE_MEM_EVENT_INDEX (5 ) | + (exec ? PACKET3_RELEASE_MEM_EXECUTE_GFX11 : 0)));amdgpu_ring_write (ring, (PACKET3_RELEASE_MEM_DATA_SEL (write64bit ?2 :1 ) |PACKET3_RELEASE_MEM_INT_SEL (int_sel ?2 :0 )));
@@ -5323,19 +5325,19 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)return r; } - r =gfx_v12_0_kgq_init_queue (ring, true); -if (r) { -dev_err (adev->dev,"failed to init kgq\n" ); -return r; - } - r =amdgpu_mes_map_legacy_queue (adev, ring);if (r) {dev_err (adev->dev,"failed to remap kgq\n" );return r; } -return amdgpu_ring_test_ring (ring); +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->fence_drv.sync_seq,AMDGPU_FENCE_FLAG_EXEC ); +amdgpu_ring_commit (ring); + +return gfx_v12_0_ring_test_ib (ring,AMDGPU_QUEUE_RESET_TIMEOUT ); }static int gfx_v12_0_reset_compute_pipe (struct amdgpu_ring *ring)
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v2 8/10 drm/amdgpu/gfx12: drop soft recovery
In reply to Alex DeucherDrop wave vmid kill in favor of queue resets.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0 -17
@@ -4692,21 +4692,6 @@ static void gfx_v12_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, ref, mask, 0x20); } -static void gfx_v12_0_ring_soft_recovery (struct amdgpu_ring *ring, -unsigned vmid) -{ -struct amdgpu_device *adev = ring->adev; -uint32_t value =0 ; - - value =REG_SET_FIELD (value,SQ_CMD ,CMD ,0x03 ); - value =REG_SET_FIELD (value,SQ_CMD ,MODE ,0x01 ); - value =REG_SET_FIELD (value,SQ_CMD ,CHECK_VMID ,1 ); - value =REG_SET_FIELD (value,SQ_CMD ,VM_ID , vmid); -amdgpu_gfx_rlc_enter_safe_mode (adev,0 ); -WREG32_SOC15 (GC ,0 , regSQ_CMD, value); -amdgpu_gfx_rlc_exit_safe_mode (adev,0 ); -} - static void gfx_v12_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, uint32_t me, uint32_t pipe,
@@ -5528,7 +5513,6 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_gfx = { .emit_wreg = gfx_v12_0_ring_emit_wreg, .emit_reg_wait = gfx_v12_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v12_0_ring_soft_recovery, .emit_mem_sync = gfx_v12_0_emit_mem_sync, .reset = gfx_v12_0_reset_kgq, .emit_cleaner_shader = gfx_v12_0_ring_emit_cleaner_shader,
@@ -5567,7 +5551,6 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_compute = { .emit_wreg = gfx_v12_0_ring_emit_wreg, .emit_reg_wait = gfx_v12_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v12_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v12_0_ring_soft_recovery, .emit_mem_sync = gfx_v12_0_emit_mem_sync, .reset = gfx_v12_0_reset_kcq, .emit_cleaner_shader = gfx_v12_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v2 9/10 drm/amdgpu/gfx10: adjust ring reset sequences
In reply to Alex DeucherDon't clear the ring contents after we issue a VM reset just write the trailing fence. GFX block will reset the work associated with the vmid and and then continue from where it left off.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +11 -11
@@ -8713,6 +8713,7 @@ static void gfx_v10_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, {bool write64bit = flags &AMDGPU_FENCE_FLAG_64BIT ;bool int_sel = flags &AMDGPU_FENCE_FLAG_INT ; +bool exec = flags &AMDGPU_FENCE_FLAG_EXEC ;/* RELEASE_MEM - flush caches, send int */ amdgpu_ring_write (ring,PACKET3 (PACKET3_RELEASE_MEM ,6 ));
@@ -8722,7 +8723,8 @@ static void gfx_v10_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr,PACKET3_RELEASE_MEM_GCR_GLM_WB |PACKET3_RELEASE_MEM_CACHE_POLICY (3 ) |PACKET3_RELEASE_MEM_EVENT_TYPE (CACHE_FLUSH_AND_INV_TS_EVENT ) | - PACKET3_RELEASE_MEM_EVENT_INDEX(5))); +PACKET3_RELEASE_MEM_EVENT_INDEX (5 ) | + (exec ? PACKET3_RELEASE_MEM_EXECUTE : 0)));amdgpu_ring_write (ring, (PACKET3_RELEASE_MEM_DATA_SEL (write64bit ?2 :1 ) |PACKET3_RELEASE_MEM_INT_SEL (int_sel ?2 :0 )));
@@ -9563,19 +9565,18 @@ static int gfx_v10_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid) kiq->pmf->kiq_map_queues (kiq_ring, ring);amdgpu_ring_commit (kiq_ring); -spin_unlock_irqrestore (&kiq->ring_lock, flags); - r =amdgpu_ring_test_ring (kiq_ring); +spin_unlock_irqrestore (&kiq->ring_lock, flags);if (r)return r; - r =gfx_v10_0_kgq_init_queue (ring, true); -if (r) { -DRM_ERROR ("fail to init kgq\n" ); -return r; - } +if (amdgpu_ring_alloc (ring,8 )) +return -ENOMEM ; +amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, + ring->fence_drv.sync_seq,AMDGPU_FENCE_FLAG_EXEC ); +amdgpu_ring_commit (ring); -return amdgpu_ring_test_ring (ring); +return gfx_v10_0_ring_test_ib (ring,AMDGPU_QUEUE_RESET_TIMEOUT ); } static int gfx_v10_0_reset_kcq(struct amdgpu_ring *ring,
@@ -9641,9 +9642,8 @@ static int gfx_v10_0_reset_kcq(struct amdgpu_ring *ring, } kiq->pmf->kiq_map_queues (kiq_ring, ring);amdgpu_ring_commit (kiq_ring); -spin_unlock_irqrestore (&kiq->ring_lock, flags); - r =amdgpu_ring_test_ring (kiq_ring); +spin_unlock_irqrestore (&kiq->ring_lock, flags);if (r)return r;
Signature · 1 line
2.49.0
Alex Deucher
maintainerPATCH v2 10/10 drm/amdgpu/gfx10: drop soft recovery
In reply to Alex DeucherDrop wave vmid kill in favor of queue resets.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -17
@@ -9048,21 +9048,6 @@ static void gfx_v10_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring, ref, mask); } -static void gfx_v10_0_ring_soft_recovery (struct amdgpu_ring *ring, -unsigned int vmid) -{ -struct amdgpu_device *adev = ring->adev; -uint32_t value =0 ; - - value =REG_SET_FIELD (value,SQ_CMD ,CMD ,0x03 ); - value =REG_SET_FIELD (value,SQ_CMD ,MODE ,0x01 ); - value =REG_SET_FIELD (value,SQ_CMD ,CHECK_VMID ,1 ); - value =REG_SET_FIELD (value,SQ_CMD ,VM_ID , vmid); -amdgpu_gfx_rlc_enter_safe_mode (adev,0 ); -WREG32_SOC15 (GC ,0 , mmSQ_CMD, value); -amdgpu_gfx_rlc_exit_safe_mode (adev,0 ); -} - static void gfx_v10_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, uint32_t me, uint32_t pipe,
@@ -9882,7 +9867,6 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_gfx = { .emit_wreg = gfx_v10_0_ring_emit_wreg, .emit_reg_wait = gfx_v10_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v10_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v10_0_ring_soft_recovery, .emit_mem_sync = gfx_v10_0_emit_mem_sync, .reset = gfx_v10_0_reset_kgq, .emit_cleaner_shader = gfx_v10_0_ring_emit_cleaner_shader,
@@ -9923,7 +9907,6 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_compute = { .emit_wreg = gfx_v10_0_ring_emit_wreg, .emit_reg_wait = gfx_v10_0_ring_emit_reg_wait, .emit_reg_write_reg_wait = gfx_v10_0_ring_emit_reg_write_reg_wait, - .soft_recovery = gfx_v10_0_ring_soft_recovery, .emit_mem_sync = gfx_v10_0_emit_mem_sync, .reset = gfx_v10_0_reset_kcq, .emit_cleaner_shader = gfx_v10_0_ring_emit_cleaner_shader,
Signature · 1 line
2.49.0
Quoted 9 lines · Alex Deucher
This set improves per queue reset support for GC10+. This uses vmid resets for GFX. GFX resets all state associated with a vmid and then continues where it left off. Since once the IB uses the vmid, only the IB is reset and execution continues after the IB. Tested on GC 10 and 11 chips with a game running and then running hang tests. The game pauses when the hang happens, then continues after the queue reset.
After further investigation, this appears to work as expected, but only by chance. The ring is reset, but any pipelined content in the ring after the job is lost. We either need to limit the ring to one job or patch in the subsequent packets after resetting.
Alex
Quoted 32 lines
I tried this same approach and GC8 and 9, but it was not as reliable as soft recovery. I also compared this to Christian's reset patches, but I was not able to make them work as reliably as this series.
Alex Deucher (9):
Revert "drm/amd/amdgpu: add pipe1 hardware support" drm/amdgpu: addAMDGPU_QUEUE_RESET_TIMEOUTdrm/amdgpu: set the exec flag on the IB fence drm/amdgpu/gfx11: adjust ring reset sequences drm/amdgpu/gfx11: drop soft recovery drm/amdgpu/gfx12: adjust ring reset sequences drm/amdgpu/gfx12: drop soft recovery drm/amdgpu/gfx10: adjust ring reset sequences drm/amdgpu/gfx10: drop soft recoveryChristian König (1):
drm/amdgpu: rework queue reset scheduler interactiondrivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 ++++++++-------- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 41 ++++++++----------------- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/nvd.h | 1 + 7 files changed, 50 insertions(+), 92 deletions(-)--
2.49.0
Christian König
maintainerQuoted 11 lines · Alex Deucher
Quoted 9 lines · Alex Deucher
This set improves per queue reset support for GC10+. This uses vmid resets for GFX. GFX resets all state associated with a vmid and then continues where it left off. Since once the IB uses the vmid, only the IB is reset and execution continues after the IB. Tested on GC 10 and 11 chips with a game running and then running hang tests. The game pauses when the hang happens, then continues after the queue reset.
Quoted 4 lines
After further investigation, this appears to work as expected, but only by chance. The ring is reset, but any pipelined content in the ring after the job is lost. We either need to limit the ring to one job or patch in the subsequent packets after resetting.
Yeah, I feared that this wouldn't work.
Any idea why the VMID based reset isn't working?
On the other hand we could just restart from the ring RPTR again.
Regards,
Christian.
Quoted 35 lines
Alex
Quoted 32 lines
I tried this same approach and GC8 and 9, but it was not as reliable as soft recovery. I also compared this to Christian's reset patches, but I was not able to make them work as reliably as this series.
Alex Deucher (9):
Revert "drm/amd/amdgpu: add pipe1 hardware support" drm/amdgpu: addAMDGPU_QUEUE_RESET_TIMEOUTdrm/amdgpu: set the exec flag on the IB fence drm/amdgpu/gfx11: adjust ring reset sequences drm/amdgpu/gfx11: drop soft recovery drm/amdgpu/gfx12: adjust ring reset sequences drm/amdgpu/gfx12: drop soft recovery drm/amdgpu/gfx10: adjust ring reset sequences drm/amdgpu/gfx10: drop soft recoveryChristian König (1):
drm/amdgpu: rework queue reset scheduler interactiondrivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 ++++++++-------- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 41 ++++++++----------------- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/nvd.h | 1 + 7 files changed, 50 insertions(+), 92 deletions(-)--
2.49.0
Quoted 13 lines · Christian König
Quoted 11 lines · Alex Deucher
Quoted 9 lines · Alex Deucher
This set improves per queue reset support for GC10+. This uses vmid resets for GFX. GFX resets all state associated with a vmid and then continues where it left off. Since once the IB uses the vmid, only the IB is reset and execution continues after the IB. Tested on GC 10 and 11 chips with a game running and then running hang tests. The game pauses when the hang happens, then continues after the queue reset.
Quoted 8 lines
Quoted 4 lines
After further investigation, this appears to work as expected, but only by chance. The ring is reset, but any pipelined content in the ring after the job is lost. We either need to limit the ring to one job or patch in the subsequent packets after resetting.
Yeah, I feared that this wouldn't work.
Any idea why the VMID based reset isn't working?
I think it works similarly to the preemption sequence. E.g., see gfx_v9_0_ring_preempt_ib(), but with a reset rather than a preemption, but I don't think this will be easily portable to gfx11 and newer as they no longer have direct access to the HWS.
Quoted 2 lines
On the other hand we could just restart from the ring RPTR again.
I think that's probably the best option. I was thinking we could mirror the ring frames for each gang and after a reset, we submit the unprocessed frames again. That way we can still do a ring test to make sure the ring is functional after the reset and then submit the unprocessed work.
Alex
Quoted 40 lines
Regards,
Christian.Quoted 35 lines
Alex
Quoted 32 lines
I tried this same approach and GC8 and 9, but it was not as reliable as soft recovery. I also compared this to Christian's reset patches, but I was not able to make them work as reliably as this series.
Alex Deucher (9):
Revert "drm/amd/amdgpu: add pipe1 hardware support" drm/amdgpu: addAMDGPU_QUEUE_RESET_TIMEOUTdrm/amdgpu: set the exec flag on the IB fence drm/amdgpu/gfx11: adjust ring reset sequences drm/amdgpu/gfx11: drop soft recovery drm/amdgpu/gfx12: adjust ring reset sequences drm/amdgpu/gfx12: drop soft recovery drm/amdgpu/gfx10: adjust ring reset sequences drm/amdgpu/gfx10: drop soft recoveryChristian König (1):
drm/amdgpu: rework queue reset scheduler interactiondrivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 26 ++++++++-------- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 41 ++++++++----------------- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 35 ++++++--------------- drivers/gpu/drm/amd/amdgpu/nvd.h | 1 + 7 files changed, 50 insertions(+), 92 deletions(-)--
2.49.0
Christian König
maintainerQuoted 5 lines · Alex Deucher
I think that's probably the best option. I was thinking we could mirror the ring frames for each gang and after a reset, we submit the unprocessed frames again. That way we can still do a ring test to make sure the ring is functional after the reset and then submit the unprocessed work.
Keep in mind that we can't allocate any memory during submission or in a reset.
I think we should just tell the newly mapped kernel ring to start to from the known good RPTR and process to whatever the current WPTR is. Only after that an IB test should be inserted.
We could also modify the conditional code used for MCBP to skip processing for a specific VMID by applying a mask instead of always checking for 0 and 1.
Christian.
Quoted 9 lines · Christian König
Quoted 5 lines · Alex Deucher
I think that's probably the best option. I was thinking we could mirror the ring frames for each gang and after a reset, we submit the unprocessed frames again. That way we can still do a ring test to make sure the ring is functional after the reset and then submit the unprocessed work.
Keep in mind that we can't allocate any memory during submission or in a reset.
Yeah, I was thinking we'd just have a static mirror allocated upfront.
Quoted 2 lines
I think we should just tell the newly mapped kernel ring to start to from the known good RPTR and process to whatever the current WPTR is. Only after that an IB test should be inserted.
I considered that, but we don't know if the reset worked or not without some sort of test. I guess we could put an IB test at the end, but it may take a while if there is a lot of content to process. I guess that's not really fundamentally different from how vmid reset is supposed to work anyway. We should be able to set the requested wptr/rptr in the MQD when we map the ring after the reset.
Quoted 2 lines
We could also modify the conditional code used for MCBP to skip processing for a specific VMID by applying a mask instead of always checking for 0 and 1.
How would that work? I haven't paged that into my head in a while.
Alex
Quoted 2 lines
Christian.
Quoted 16 lines · Alex Deucher
Quoted 9 lines · Christian König
Quoted 5 lines · Alex Deucher
I think that's probably the best option. I was thinking we could mirror the ring frames for each gang and after a reset, we submit the unprocessed frames again. That way we can still do a ring test to make sure the ring is functional after the reset and then submit the unprocessed work.
Keep in mind that we can't allocate any memory during submission or in a reset.
Yeah, I was thinking we'd just have a static mirror allocated upfront.
Quoted 1 line
Quoted 8 lines
Quoted 1 line
I think we should just tell the newly mapped kernel ring to start to from the known good RPTR and process to whatever the current WPTR is. Only after that an IB test should be inserted.
I considered that, but we don't know if the reset worked or not without some sort of test. I guess we could put an IB test at the end, but it may take a while if there is a lot of content to process. I guess that's not really fundamentally different from how vmid reset is supposed to work anyway. We should be able to set the requested wptr/rptr in the MQD when we map the ring after the reset.
I think I've got something workable. What's the best way to keep track of the last known good RPTR?
Alex
Quoted 10 lines
Quoted 3 lines
We could also modify the conditional code used for MCBP to skip processing for a specific VMID by applying a mask instead of always checking for 0 and 1.
How would that work? I haven't paged that into my head in a while.
Alex
Quoted 2 lines
Christian.
Christian König
maintainerQuoted 26 lines · Alex Deucher
Quoted 16 lines · Alex Deucher
Quoted 9 lines · Christian König
Quoted 5 lines · Alex Deucher
I think that's probably the best option. I was thinking we could mirror the ring frames for each gang and after a reset, we submit the unprocessed frames again. That way we can still do a ring test to make sure the ring is functional after the reset and then submit the unprocessed work.
Keep in mind that we can't allocate any memory during submission or in a reset.
Yeah, I was thinking we'd just have a static mirror allocated upfront.
Quoted 1 line
Quoted 8 lines
Quoted 1 line
I think we should just tell the newly mapped kernel ring to start to from the known good RPTR and process to whatever the current WPTR is. Only after that an IB test should be inserted.
I considered that, but we don't know if the reset worked or not without some sort of test. I guess we could put an IB test at the end, but it may take a while if there is a lot of content to process. I guess that's not really fundamentally different from how vmid reset is supposed to work anyway. We should be able to set the requested wptr/rptr in the MQD when we map the ring after the reset.
Quoted 2 lines
I think I've got something workable. What's the best way to keep track of the last known good RPTR?
Good question. We could stuff that into the fence, but I'm not 100% sure if that would be correct or not.
Could be that there is still stuff behind the fence which we don't want to execute.
Christian.
Quoted 13 lines
Alex
Quoted 10 lines
Quoted 3 lines
We could also modify the conditional code used for MCBP to skip processing for a specific VMID by applying a mask instead of always checking for 0 and 1.
How would that work? I haven't paged that into my head in a while.
Alex
Quoted 2 lines
Christian.