mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-04-04 11:24:03 +00:00
In the current implementation sigev_notify is configured as SIGEV_THREAD. When wdt expires an async thread is created and the registered timer callback is called in the context of this thread, then the watchdog interrupt emulation would require the thread to assert intr on this pci dev. There would be a race condition that when the wdt pci device is freed in pci device deinit and then a timer expires. In this case the wdt expired thread will access a freed buffer which would cause problem such as heap corruption and segment fault. In this patch we replace timer API with acrn_timer which is based on timerfd/epoll mechanism to avoid the race condition. Tracked-On: #1489 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com> Reviewed-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>