misc: sgi-gru: inline the user CBR status update

The process-context fault path always has a valid user CBR pointer. Inline
the one-use status helper and remove its obsolete NULL check.

No functional change.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20260730111316.3672672-4-usama.anjum@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Muhammad Usama Anjum
2026-07-30 12:12:52 +01:00
committed by Greg Kroah-Hartman
parent 7d58b218e7
commit 48c7907d92

View File

@@ -111,21 +111,6 @@ static void gru_unlock_gts(struct gru_thread_state *gts)
mmap_read_unlock(current->mm);
}
/*
* Set a CB.istatus to active using a user virtual address. This must be done
* just prior to a TFH RESTART. The new cb.istatus is an in-cache status ONLY.
* If the line is evicted, the status may be lost. The in-cache update
* is necessary to prevent the user from seeing a stale cb.istatus that will
* change as soon as the TFH restart is complete. Races may cause an
* occasional failure to clear the cb.istatus, but that is ok.
*/
static void gru_cb_set_istatus_active(struct gru_instruction_bits *cbk)
{
if (cbk) {
cbk->istatus = CBS_ACTIVE;
}
}
/*
* Read & clear a TFM
*
@@ -354,7 +339,12 @@ static int gru_try_dropin(struct gru_state *gru,
gru_flush_cache_cbe(cbe);
}
gru_cb_set_istatus_active(cbk);
/*
* Set CB.istatus active in cache before restarting the TFH to avoid
* exposing stale pre-restart status. Cacheline eviction may lose the
* update, but an occasional stale status is harmless.
*/
cbk->istatus = CBS_ACTIVE;
gts->ustats.tlbdropin++;
tfh_write_restart(tfh, gpa, GAA_RAM, vaddr, asid, write,
GRU_PAGESIZE(pageshift));