Skip to content

Commit

Permalink
gfx12_architecture_t::wave_set_halt: Fix setting halt
Browse files Browse the repository at this point in the history
The gfx12 implementation changing the HALT bit.  Before this patch, the
implementation would flip bit 13 of WAVE_STATE_PRIV (which is bit 1 of
USER_PRIO) instead of bit 14.

As a result, when resuming a wave with exception (wave_t::set_state), we
would fail to keep the wave halted.  As a result, the wave could
continue executing and have unexpected side-effects.

This patch fixes this typo.

Bug: SWDEV-487950
Tested-by: Shahab Vahedi <shahab.vahedi@amd.com>
Change-Id: If96e4547cb3c0d19f0dfad5314ae7882be8ad4d3
  • Loading branch information
lancesix committed Nov 20, 2024
1 parent a83d3f4 commit 81a60b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/architecture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6364,8 +6364,8 @@ gfx12_architecture_t::wave_set_halt (wave_t &wave, bool halt) const
uint32_t state_priv_reg;
wave.read_register (amdgpu_regnum_t::state_priv, &state_priv_reg);

state_priv_reg = halt ? state_priv_reg | sq_wave_status_halt_mask
: state_priv_reg & ~sq_wave_status_halt_mask;
state_priv_reg = halt ? state_priv_reg | sq_wave_state_priv_halt_mask
: state_priv_reg & ~sq_wave_state_priv_halt_mask;

wave.write_register (amdgpu_regnum_t::state_priv, state_priv_reg);
}
Expand Down

0 comments on commit 81a60b8

Please sign in to comment.