- MONITORX/MWAITX: It is possible that MWAITX wakeup from timed mwait but APIC timer was still not reset.

A corruption would happen if MWAIT is called again to setup the timer while it still running from previous time.
  Also spurious wakeup could possibly happen as timer will send wakeup when it stops counting.
This commit is contained in:
Stanislav Shwartsman 2023-11-25 14:55:14 +02:00
parent 86e4675a1d
commit 1ae23ad935
2 changed files with 3 additions and 2 deletions

View File

@ -1199,8 +1199,9 @@ void bx_local_apic_c::vmx_preemption_timer_expired(void *this_ptr)
#if BX_SUPPORT_MONITOR_MWAIT
void bx_local_apic_c::set_mwaitx_timer(Bit32u value)
void bx_local_apic_c::set_mwaitx_timer(Bit64u value)
{
if (mwaitx_timer_active) deactivate_mwaitx_timer();
BX_DEBUG(("MWAITX timer: value = %u", value));
bx_pc_system.activate_timer_ticks(mwaitx_timer_handle, value, 0);
mwaitx_timer_active = true;

View File

@ -286,7 +286,7 @@ public:
#endif
#if BX_SUPPORT_MONITOR_MWAIT
void set_mwaitx_timer(Bit32u value);
void set_mwaitx_timer(Bit64u value);
void deactivate_mwaitx_timer(void);
static void mwaitx_timer_expired(void *);
#endif