Fix race condition in its_cmd_send()
authorzbb <zbb@FreeBSD.org>
Wed, 26 Aug 2015 12:32:46 +0000 (12:32 +0000)
committerzbb <zbb@FreeBSD.org>
Wed, 26 Aug 2015 12:32:46 +0000 (12:32 +0000)
commit87f05051e4e20a55910fa3903534384b2a178b67
tree8eeed815ed4fdfd22eecc49c636bcfe9c0dffb71
parent949ebfc34f70630c0e4037981afa733f1c935789
Fix race condition in its_cmd_send()

its_cmd_send() can be called by multiple CPUs simultaneously.
After the command is pushed to ITS command ring the completion
status is polled using global pointer to the next free ring slot.
Use copied pointer and provide correct locking to avoid spurious
pointer value when concurrent access occurs.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3436
sys/arm64/arm64/gic_v3_its.c