Changeset 47285 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jul 19, 2013 11:45:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r47283 r47285 2767 2767 if (!(uSel & X86_SEL_MASK_OFF_RPL)) 2768 2768 { 2769 Assert(iSegReg != X86_SREG_CS); /** @todo testcase for \#UD on MOV CS, ax! */ 2769 2770 if (iSegReg == X86_SREG_SS) 2770 2771 { 2772 /* In 64-bit kernel mode, the stack can be 0 because of the way 2773 interrupts are dispatched. AMD seems to have a slighly more 2774 relaxed relationship to SS.RPL than intel does. */ 2775 /** @todo We cannot 'mov ss, 3' in 64-bit kernel mode, can we? There is a testcase (bs-cpu-xcpt-1), but double check this! */ 2771 2776 if ( pIemCpu->enmCpuMode != IEMMODE_64BIT 2772 || pIemCpu->uCpl != 0 2773 || uSel != 0) /** @todo We cannot 'mov ss, 3' in 64-bit kernel mode, can we? */ 2777 || pIemCpu->uCpl > 2 2778 || ( uSel != pIemCpu->uCpl 2779 && !IEM_IS_GUEST_CPU_AMD(pIemCpu)) ) 2774 2780 { 2775 Log(("load sreg -> invalid stack selector, #GP(0)\n", uSel));2781 Log(("load sreg %#x -> invalid stack selector, #GP(0)\n", uSel)); 2776 2782 return iemRaiseGeneralProtectionFault0(pIemCpu); 2777 2783 } 2778 2779 /* In 64-bit kernel mode, the stack can be 0 because of the way2780 interrupts are dispatched when in kernel ctx. Just load the2781 selector value into the register and leave the hidden bits2782 as is. */2783 *pSel = uSel;2784 pHid->ValidSel = uSel;2785 iemRegAddToRip(pIemCpu, cbInstr);2786 return VINF_SUCCESS;2787 2784 } 2788 2785 2789 2786 *pSel = uSel; /* Not RPL, remember :-) */ 2790 if ( pIemCpu->enmCpuMode == IEMMODE_64BIT 2791 && iSegReg != X86_SREG_FS 2792 && iSegReg != X86_SREG_GS) 2793 { 2794 /** @todo figure out what this actually does, it works. Needs 2795 * testcase! */ 2796 pHid->Attr.u = 0; 2797 pHid->Attr.n.u1Present = 1; 2798 pHid->Attr.n.u1Long = 1; 2799 pHid->Attr.n.u4Type = X86_SEL_TYPE_RW; 2800 pHid->Attr.n.u2Dpl = 3; 2801 pHid->u32Limit = 0; 2802 pHid->u64Base = 0; 2803 pHid->ValidSel = uSel; 2804 pHid->fFlags = CPUMSELREG_FLAGS_VALID; 2805 } 2806 else 2807 iemHlpLoadNullDataSelectorProt(pHid, uSel); 2787 iemHlpLoadNullDataSelectorProt(pHid, uSel); 2788 if (iSegReg == X86_SREG_SS) 2789 pHid->Attr.u |= pIemCpu->uCpl << X86DESCATTR_DPL_SHIFT; 2790 2808 2791 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(IEMCPU_TO_VMCPU(pIemCpu), pHid)); 2809 2792 CPUMSetChangedFlags(IEMCPU_TO_VMCPU(pIemCpu), CPUM_CHANGED_HIDDEN_SEL_REGS);
Note:
See TracChangeset
for help on using the changeset viewer.