[PATCH] cpu/init.cc: proper CPL restore in after_restore_statE

This commit is contained in:
Stanislav Shwartsman 2010-06-04 20:31:04 +00:00
parent 23a28d2892
commit eaa2e0e0ea

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: init.cc,v 1.245 2010-05-23 05:32:00 sshwarts Exp $
// $Id: init.cc,v 1.246 2010-06-04 20:31:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
@ -688,11 +688,6 @@ void BX_CPU_C::param_restore(bx_param_c *param, Bit64s val)
void BX_CPU_C::after_restore_state(void)
{
if (BX_CPU_THIS_PTR cpu_mode == BX_MODE_IA32_REAL) CPL = 0;
else {
if (BX_CPU_THIS_PTR cpu_mode == BX_MODE_IA32_V8086) CPL = 3;
}
TLB_flush();
#if BX_CPU_LEVEL >= 4 && BX_SUPPORT_ALIGNMENT_CHECK
@ -700,6 +695,11 @@ void BX_CPU_C::after_restore_state(void)
#endif
handleCpuModeChange();
if (BX_CPU_THIS_PTR cpu_mode == BX_MODE_IA32_REAL) CPL = 0;
else {
if (BX_CPU_THIS_PTR cpu_mode == BX_MODE_IA32_V8086) CPL = 3;
}
#if BX_SUPPORT_VMX
set_VMCSPTR(BX_CPU_THIS_PTR vmcsptr);
#endif