Changeset 13343 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Oct 16, 2008 3:01:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r13289 r13343 954 954 if (pVM->hwaccm.s.vmx.enmCurrGuestMode != enmGuestMode) 955 955 { 956 # define VTX_CORRECT_PROT_SEL(reg) \957 { \958 if ( pCtx->reg##Hid.u64Base == (pVM->hwaccm.s.vmx.RealMode.reg##Hid.u64Base & 0xfffff) \959 && pCtx->reg == ((pVM->hwaccm.s.vmx.RealMode.reg##Hid.u64Base >> 4) & ~X86_SEL_RPL)) \960 { \961 pCtx->reg##Hid = pVM->hwaccm.s.vmx.RealMode.reg##Hid; \962 pCtx->reg = pVM->hwaccm.s.vmx.RealMode.reg; \963 } \964 }965 966 956 /* Correct weird requirements for switching to protected mode. */ 967 957 if ( pVM->hwaccm.s.vmx.enmCurrGuestMode == PGMMODE_REAL … … 977 967 pCtx->gsHid.Attr.n.u2Dpl = 0; 978 968 pCtx->ssHid.Attr.n.u2Dpl = 0; 979 980 /* RPL of all selectors must match the current CPL (0). */981 pCtx->cs &= ~X86_SEL_RPL;982 pCtx->ds &= ~X86_SEL_RPL;983 pCtx->es &= ~X86_SEL_RPL;984 pCtx->fs &= ~X86_SEL_RPL;985 pCtx->gs &= ~X86_SEL_RPL;986 pCtx->ss &= ~X86_SEL_RPL;987 988 if (pVM->hwaccm.s.vmx.RealMode.fValid)989 {990 VTX_CORRECT_PROT_SEL(ds);991 VTX_CORRECT_PROT_SEL(es);992 VTX_CORRECT_PROT_SEL(fs);993 VTX_CORRECT_PROT_SEL(gs);994 pVM->hwaccm.s.vmx.RealMode.fValid = false;995 }996 969 } 997 970 else … … 1000 973 && enmGuestMode == PGMMODE_REAL) 1001 974 { 1002 /* Save the original hidden selectors in case we need to restore them later on. */1003 pVM->hwaccm.s.vmx.RealMode.ds = pCtx->ds;1004 pVM->hwaccm.s.vmx.RealMode.dsHid = pCtx->dsHid;1005 pVM->hwaccm.s.vmx.RealMode.es = pCtx->es;1006 pVM->hwaccm.s.vmx.RealMode.esHid = pCtx->esHid;1007 pVM->hwaccm.s.vmx.RealMode.fs = pCtx->fs;1008 pVM->hwaccm.s.vmx.RealMode.fsHid = pCtx->fsHid;1009 pVM->hwaccm.s.vmx.RealMode.gs = pCtx->gs;1010 pVM->hwaccm.s.vmx.RealMode.gsHid = pCtx->gsHid;1011 pVM->hwaccm.s.vmx.RealMode.ss = pCtx->ss;1012 pVM->hwaccm.s.vmx.RealMode.ssHid = pCtx->ssHid;1013 pVM->hwaccm.s.vmx.RealMode.fValid = true;1014 1015 /* The selector value & base must be adjusted or else... */1016 pCtx->cs = pCtx->csHid.u64Base >> 4;1017 pCtx->ds = pCtx->dsHid.u64Base >> 4;1018 pCtx->es = pCtx->esHid.u64Base >> 4;1019 pCtx->fs = pCtx->fsHid.u64Base >> 4;1020 pCtx->gs = pCtx->gsHid.u64Base >> 4;1021 pCtx->ss = pCtx->ssHid.u64Base >> 4;1022 1023 975 /* The limit must also be adjusted. */ 1024 976 pCtx->csHid.u32Limit &= 0xffff;
Note:
See TracChangeset
for help on using the changeset viewer.