Files
acrn-hypervisor/devicemodel/core
Peter Fang 82fa9946e0 dm: safely access MMIO hint in MMIO emulation
mmio_hint in mem.c can potentially be accessed concurrently in
emulate_mem() because it only holds a read lock. Use a local variable to
make sure the same entry address is used throughout the function. Since
it only serves as a hint, it's okay if the function does not use the
most up-to-date version of mmio_hint, as long as mmio_hint is accessed
atomically.

Explicitly enforce natural alignment on mmio_hint to guarantee atomic
accesses on x86 and increase code portability, even though compilers
most likely always do it.

Entries in the RB tree are only removed in unregister_mem_int() while
holding a write lock, so accessing mmio_hint while holding a read lock
is safe.

Tracked-On: #2902
Signed-off-by: Peter Fang <peter.fang@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
2019-04-22 15:18:21 +08:00
..
2018-06-07 14:35:30 +08:00
2018-06-07 14:35:30 +08:00
2019-02-28 18:33:11 +08:00
2018-08-02 13:14:03 +08:00
2018-06-07 14:35:30 +08:00
2019-03-21 10:28:17 +08:00
2019-04-12 13:45:32 +08:00
2018-10-29 11:07:45 +08:00