VirtualBox

Changeset 9804 in vbox


Ignore:
Timestamp:
Jun 18, 2008 4:14:48 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32174
Message:

FS & GS syncing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r9802 r9804  
    681681        AssertRC(rc);
    682682
    683         /* @todo are the hidden base registers in sync with the MSRs? */
    684         VMX_WRITE_SELREG(FS, fs);
    685         AssertRC(rc);
    686 
    687         VMX_WRITE_SELREG(GS, gs);
    688         AssertRC(rc);
     683        /* The base values in the hidden fs & gs registers are not in sync with the msrs; they are cut to 32 bits. */
     684        if (CPUMIsGuestIn64BitCodeEx(pCtx))
     685        {
     686            rc  = VMXWriteVMCS(VMX_VMCS_GUEST_FIELD_FS,         pCtx->fs);
     687            rc |= VMXWriteVMCS(VMX_VMCS_GUEST_FS_LIMIT,         pCtx->fsHid.u32Limit);
     688            rc |= VMXWriteVMCS(VMX_VMCS_GUEST_FS_BASE,          pCtx->fsHid.u64Base);
     689            rc |= VMXWriteVMCS(VMX_VMCS_GUEST_FS_ACCESS_RIGHTS, pCtx->fsHid.Attr.u);
     690            AssertRC(rc);
     691
     692            rc  = VMXWriteVMCS(VMX_VMCS_GUEST_FIELD_GS,         pCtx->gs);
     693            rc |= VMXWriteVMCS(VMX_VMCS_GUEST_GS_LIMIT,         pCtx->gsHid.u32Limit);
     694            rc |= VMXWriteVMCS(VMX_VMCS_GUEST_GS_BASE,          pCtx->gsHid.u64Base);
     695            rc |= VMXWriteVMCS(VMX_VMCS_GUEST_GS_ACCESS_RIGHTS, pCtx->gsHid.Attr.u);
     696            AssertRC(rc);
     697        }
     698        else
     699        {
     700            VMX_WRITE_SELREG(FS, fs);
     701            AssertRC(rc);
     702
     703            VMX_WRITE_SELREG(GS, gs);
     704            AssertRC(rc);
     705        }
    689706    }
    690707
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette