1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-22 07:20:00 +00:00

iommu_qi_seq_processed: use atomic to read hw-written seq number

otherwise iommu_qi_wait_for_seq() can be legitimately optimized out.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2024-10-03 06:51:20 +03:00
parent ad152571b8
commit eb8326421e

View File

@ -350,8 +350,8 @@ iommu_qi_seq_processed(struct iommu_unit *unit,
x86c = IOMMU2X86C(unit);
gen = x86c->inv_waitd_gen;
return (pseq->gen < gen ||
(pseq->gen == gen && pseq->seq <= x86c->inv_waitd_seq_hw));
return (pseq->gen < gen || (pseq->gen == gen && pseq->seq <=
atomic_load_64(&x86c->inv_waitd_seq_hw)));
}
void