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
..
console.c DM: cleanup for header inclusions 2018-06-07 14:35:30 +08:00
gc.c DM: cleanup for header inclusions 2018-06-07 14:35:30 +08:00
hugetlb.c dm: add support of high MMIO mapping 2019-02-28 18:33:11 +08:00
inout.c dm: completely remove enable_bar()/disable_bar() functions 2019-04-22 15:18:21 +08:00
main.c acrn-dm: enable debug option for acrn-dm 2019-04-16 15:24:25 +08:00
mem.c dm: safely access MMIO hint in MMIO emulation 2019-04-22 15:18:21 +08:00
mevent.c dm: create mevent's pipe in non-blocking mode 2019-01-23 10:33:28 +08:00
monitor.c tools: acrn-manager: fix the possibility of creating directory at will by no permission process 2019-04-15 17:01:03 +08:00
mptbl.c dm: adapt mptable generation for VM with lapic pt 2019-01-28 19:47:33 +08:00
pm.c DM: register pm ops to monitor 2018-08-02 13:14:03 +08:00
post.c DM: cleanup for header inclusions 2018-06-07 14:35:30 +08:00
sw_load_bzimage.c dm: use strncpy to replace strcpy 2018-12-25 18:40:04 +08:00
sw_load_common.c dm: leave a gap for 32-bit PCI hole in E820 map 2019-03-25 13:49:48 +08:00
sw_load_elf.c dm: fix possible memory leak in 'load_elf32()' 2019-04-15 17:33:42 +08:00
sw_load_ovmf.c dm: build E820 map for OVMF 2019-03-21 10:28:17 +08:00
sw_load_vsbl.c dm: use strncpy to replace strcpy 2018-12-25 18:40:04 +08:00
timer.c dm: provide timer callback handlers the number of expirations 2019-01-23 10:33:28 +08:00
vmmapi.c HV: use term of UUID 2019-04-12 13:45:32 +08:00
vrpmb.c DM: generate random virtual RPMB key 2018-10-29 11:07:45 +08:00