more SVM fixes
This commit is contained in:
parent
810aa1b67c
commit
269d5e3443
@ -316,6 +316,7 @@ void BX_CPU_C::handleCpuModeChange(void)
|
||||
if (BX_CPU_THIS_PTR cr0.get_PE()) {
|
||||
if (BX_CPU_THIS_PTR get_VM()) {
|
||||
BX_CPU_THIS_PTR cpu_mode = BX_MODE_IA32_V8086;
|
||||
CPL = 3;
|
||||
}
|
||||
else
|
||||
BX_CPU_THIS_PTR cpu_mode = BX_MODE_IA32_PROTECTED;
|
||||
@ -328,7 +329,7 @@ void BX_CPU_C::handleCpuModeChange(void)
|
||||
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.segment = 1; /* data/code segment */
|
||||
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.type = BX_DATA_READ_WRITE_ACCESSED;
|
||||
|
||||
BX_ASSERT(CPL == 0);
|
||||
CPL = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ void BX_CPU_C::SvmExitLoadHostState(SVM_HOST_STATE *host)
|
||||
// Update lazy flags state
|
||||
setEFlagsOSZAPC(host->eflags);
|
||||
|
||||
RIP = host->rip;
|
||||
RIP = BX_CPU_THIS_PTR prev_rip = host->rip;
|
||||
RSP = host->rsp;
|
||||
RAX = host->rax;
|
||||
|
||||
@ -512,7 +512,7 @@ bx_bool BX_CPU_C::SvmEnterLoadCheckGuestState(void)
|
||||
BX_CPU_THIS_PTR gdtr = guest.gdtr;
|
||||
BX_CPU_THIS_PTR idtr = guest.idtr;
|
||||
|
||||
RIP = guest.rip;
|
||||
RIP = BX_CPU_THIS_PTR prev_rip = guest.rip;
|
||||
RSP = guest.rsp;
|
||||
RAX = guest.rax;
|
||||
|
||||
@ -649,7 +649,7 @@ bx_bool BX_CPU_C::SvmInjectEvents(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
BX_ERROR(("SvmInjectEvents: Injecting vector 0x%02x (error_code 0x%04x)", vector, error_code));
|
||||
BX_INFO(("SvmInjectEvents: Injecting vector 0x%02x (error_code 0x%04x)", vector, error_code));
|
||||
|
||||
if (type == BX_HARDWARE_EXCEPTION) {
|
||||
// record exception the same way as BX_CPU_C::exception does
|
||||
|
@ -2081,7 +2081,7 @@ void BX_CPU_C::VMexitLoadHostState(void)
|
||||
BX_CPU_THIS_PTR idtr.base = host_state->idtr_base;
|
||||
BX_CPU_THIS_PTR idtr.limit = 0xFFFF;
|
||||
|
||||
RIP = host_state->rip;
|
||||
RIP = BX_CPU_THIS_PTR prev_rip = host_state->rip;
|
||||
RSP = host_state->rsp;
|
||||
|
||||
BX_CPU_THIS_PTR inhibit_mask = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user