diff --git a/bochs/cpu/proc_ctrl.cc b/bochs/cpu/proc_ctrl.cc index 2547c3d11..a25623519 100644 --- a/bochs/cpu/proc_ctrl.cc +++ b/bochs/cpu/proc_ctrl.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: proc_ctrl.cc,v 1.218 2008-04-20 21:44:13 sshwarts Exp $ +// $Id: proc_ctrl.cc,v 1.219 2008-04-25 11:39:51 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -1896,6 +1896,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::WRMSR(bxInstruction_c *i) return; case BX_MSR_KERNELGSBASE: + if (! IsCanonical(val64)) { + BX_ERROR(("WRMSR: attempt to write non-canonical value to MSR_KERNELGSBASE !")); + exception(BX_GP_EXCEPTION, 0, 0); + } MSR_KERNELGSBASE = val64; return; diff --git a/bochs/cpu/tasking.cc b/bochs/cpu/tasking.cc index 6a5619b3f..122c382d0 100644 --- a/bochs/cpu/tasking.cc +++ b/bochs/cpu/tasking.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: tasking.cc,v 1.54 2008-04-22 22:05:38 sshwarts Exp $ +// $Id: tasking.cc,v 1.55 2008-04-25 11:39:51 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -186,6 +186,11 @@ void BX_CPU_C::task_switch(bx_selector_t *tss_selector, exception(BX_TS_EXCEPTION, tss_selector->value & 0xfffc, 0); } + if (old_TSS_limit < old_TSS_max) { + BX_ERROR(("task_switch(): old TSS limit < %d", old_TSS_max)); + exception(BX_TS_EXCEPTION, BX_CPU_THIS_PTR tr.selector.value & 0xfffc, 0); + } + if (obase32 == nbase32) { BX_INFO(("TASK SWITCH: switching to the same TSS !")); }