diff options
author | Michael S. Tsirkin <[email protected]> | 2024-04-30 09:27:48 +1000 |
---|---|---|
committer | Michael S. Tsirkin <[email protected]> | 2024-07-09 08:42:40 -0400 |
commit | 7ad4723976672b7d359403a555e0ce5c75529153 (patch) | |
tree | facd5a3970b5ffa5df8f945ef5312ea1006314e9 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | fdba68d2adf8d9ae680e23e8b8ba79330baa45bc (diff) |
vhost: move smp_rmb() into vhost_get_avail_idx()
All callers of vhost_get_avail_idx() use smp_rmb() to
order the available ring entry read and avail_idx read.
Make vhost_get_avail_idx() call smp_rmb() itself whenever the avail_idx
is accessed. This way, the callers don't need to worry about the memory
barrier. As a side benefit, we also validate the index on all paths now,
which will hopefully help prevent/catch earlier future bugs.
Note that current code is inconsistent in how the errors are handled.
They are treated as an empty ring in some places, but as non-empty
ring in other places. This patch doesn't attempt to change the existing
behaviour.
No functional change intended.
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Gavin Shan <[email protected]>
Acked-by: Will Deacon <[email protected]>
Message-Id: <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions