bugfix: vmx preemption timer vmexit should not wakeup CPU from sleep state. cpuid: added definitions from recently published intel SDM rev047
This commit is contained in:
parent
e824499639
commit
9651b5d53c
@ -365,6 +365,7 @@ struct BxExceptionInfo {
|
||||
/* MSR registers */
|
||||
#define BX_MSR_TSC 0x010
|
||||
#define BX_MSR_APICBASE 0x01b
|
||||
#define BX_MSR_TSC_ADJUST 0x03b
|
||||
|
||||
#if BX_CPU_LEVEL >= 6
|
||||
#define BX_MSR_SYSENTER_CS 0x174
|
||||
|
@ -309,7 +309,8 @@ typedef bx_cpuid_t* (*bx_create_cpuid_method)(BX_CPU_C *cpu);
|
||||
// -----------------------------
|
||||
|
||||
// [0:0] FS/GS BASE access instructions
|
||||
// [2:1] reserved
|
||||
// [1:1] Support for IA32_TSC_ADJUST MSR
|
||||
// [2:2] reserved
|
||||
// [3:3] BMI1: Advanced Bit Manipulation Extensions
|
||||
// [4:4] HLE: Hardware Lock Elision
|
||||
// [5:5] AVX2
|
||||
@ -328,7 +329,7 @@ typedef bx_cpuid_t* (*bx_create_cpuid_method)(BX_CPU_C *cpu);
|
||||
// [31:21] reserved
|
||||
|
||||
#define BX_CPUID_EXT3_FSGSBASE (1 << 0)
|
||||
#define BX_CPUID_EXT3_RESERVED1 (1 << 1)
|
||||
#define BX_CPUID_EXT3_TSC_ADJUST (1 << 1)
|
||||
#define BX_CPUID_EXT3_RESERVED2 (1 << 2)
|
||||
#define BX_CPUID_EXT3_BMI1 (1 << 3)
|
||||
#define BX_CPUID_EXT3_HLE (1 << 4)
|
||||
|
@ -42,12 +42,11 @@ bx_bool BX_CPU_C::handleWaitForEvent(void)
|
||||
while (1)
|
||||
{
|
||||
if ((is_pending(BX_EVENT_PENDING_INTR | BX_EVENT_PENDING_LAPIC_INTR) && (BX_CPU_THIS_PTR get_IF() || BX_CPU_THIS_PTR activity_state == BX_ACTIVITY_STATE_MWAIT_IF)) ||
|
||||
is_pending(BX_EVENT_NMI | BX_EVENT_SMI | BX_EVENT_INIT |
|
||||
is_unmasked_event_pending(BX_EVENT_NMI | BX_EVENT_SMI | BX_EVENT_INIT |
|
||||
BX_EVENT_VMX_VTPR_UPDATE |
|
||||
BX_EVENT_VMX_VEOI_UPDATE |
|
||||
BX_EVENT_VMX_VIRTUAL_APIC_WRITE |
|
||||
BX_EVENT_VMX_MONITOR_TRAP_FLAG |
|
||||
BX_EVENT_VMX_PREEMPTION_TIMER_EXPIRED |
|
||||
BX_EVENT_VMX_VIRTUAL_NMI))
|
||||
{
|
||||
// interrupt ends the HALT condition
|
||||
@ -60,6 +59,11 @@ bx_bool BX_CPU_C::handleWaitForEvent(void)
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_unmasked_event_pending(BX_EVENT_VMX_PREEMPTION_TIMER_EXPIRED)) {
|
||||
// Exit from waiting loop and proceed to VMEXIT
|
||||
break;
|
||||
}
|
||||
|
||||
if (BX_CPU_THIS_PTR activity_state == BX_ACTIVITY_STATE_ACTIVE) {
|
||||
// happens also when MWAIT monitor was hit
|
||||
// BX_INFO(("handleWaitForEvent: reset detected in HLT state"));
|
||||
|
@ -1928,7 +1928,7 @@ Bit32u BX_CPU_C::VMenterLoadCheckGuestState(Bit64u *qualification)
|
||||
BX_INSTR_TLB_CNTRL(BX_CPU_ID, BX_INSTR_CONTEXT_SWITCH, 0);
|
||||
|
||||
if (guest.activity_state) {
|
||||
BX_ERROR(("VMEntry to non-active CPU state %d", guest.activity_state));
|
||||
BX_DEBUG(("VMEntry to non-active CPU state %d", guest.activity_state));
|
||||
enter_sleep_state(guest.activity_state);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user