VirtualBox

Changeset 14997 in vbox for trunk/src


Ignore:
Timestamp:
Dec 4, 2008 4:32:35 PM (16 years ago)
Author:
vboxsync
Message:

Clearly mark possible 64 bits values

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMGC/HWACCMGCA.asm

    r14993 r14997  
    179179    cli
    180180
     181    ; Have to sync half the guest state as we can't access most of the 64 bits state. Sigh
     182;    VMCSWRITE VMX_VMCS64_GUEST_CS_BASE,         [rsi + CPUMCTX.csHid.u64Base]
     183;    VMCSWRITE VMX_VMCS64_GUEST_DS_BASE,         [rsi + CPUMCTX.dsHid.u64Base]
     184;    VMCSWRITE VMX_VMCS64_GUEST_ES_BASE,         [rsi + CPUMCTX.esHid.u64Base]
     185;    VMCSWRITE VMX_VMCS64_GUEST_FS_BASE,         [rsi + CPUMCTX.fsHid.u64Base]
     186;    VMCSWRITE VMX_VMCS64_GUEST_GS_BASE,         [rsi + CPUMCTX.gsHid.u64Base]
     187;    VMCSWRITE VMX_VMCS64_GUEST_SS_BASE,         [rsi + CPUMCTX.ssHid.u64Base]
     188;    VMCSWRITE VMX_VMCS64_GUEST_LDTR_BASE,       [rsi + CPUMCTX.ldtrHid.u64Base]
     189;    VMCSWRITE VMX_VMCS64_GUEST_GDTR_BASE,       [rsi + CPUMCTX.gdtrHid.u64Base]
     190;    VMCSWRITE VMX_VMCS64_GUEST_IDTR_BASE,       [rsi + CPUMCTX.idtrHid.u64Base]
     191;    VMCSWRITE VMX_VMCS64_GUEST_TR_BASE,         [rsi + CPUMCTX.trHid.u64Base]
     192;   
     193;    VMCSWRITE VMX_VMCS64_GUEST_SYSENTER_EIP,    [rsi + CPUMCTX.SysEnter.eip]
     194;    VMCSWRITE VMX_VMCS64_GUEST_SYSENTER_ESP,    [rsi + CPUMCTX.SysEnter.esp]
     195;   
     196;    VMCSWRITE VMX_VMCS64_GUEST_RIP,             [rsi + CPUMCTX.eip]
     197;    VMCSWRITE VMX_VMCS64_GUEST_RSP,             [rsi + CPUMCTX.esp]
     198   
     199
    181200    ;/* First we have to save some final CPU context registers. */
    182     lea     rax, [.vmlaunch64_done wrt rip]
     201    lea     rax, [.vmlaunch64_done wrt rip]   
    183202    push    rax
    184203    mov     rax, VMX_VMCS_HOST_RIP  ;/* return address (too difficult to continue after VMLAUNCH?) */
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r14946 r14997  
    11321132            rc =  VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_LDTR,         0);
    11331133            rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_LIMIT,         0);
    1134             rc |= VMXWriteVMCS(VMX_VMCS_GUEST_LDTR_BASE,            0);
     1134            rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_LDTR_BASE,          0);
    11351135            /* Note: vmlaunch will fail with 0 or just 0x02. No idea why. */
    11361136            rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, 0x82 /* present, LDT */);
     
    11401140            rc =  VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_LDTR,         pCtx->ldtr);
    11411141            rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_LIMIT,         pCtx->ldtrHid.u32Limit);
    1142             rc |= VMXWriteVMCS(VMX_VMCS_GUEST_LDTR_BASE,            pCtx->ldtrHid.u64Base);
     1142            rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_LDTR_BASE,          pCtx->ldtrHid.u64Base);
    11431143            rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_LDTR_ACCESS_RIGHTS, pCtx->ldtrHid.Attr.u);
    11441144        }
     
    11601160            rc =  VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_TR,         0);
    11611161            rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_LIMIT,         HWACCM_VTX_TSS_SIZE);
    1162             rc |= VMXWriteVMCS(VMX_VMCS_GUEST_TR_BASE,            GCPhys /* phys = virt in this mode */);
     1162            rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_TR_BASE,          GCPhys /* phys = virt in this mode */);
    11631163
    11641164            X86DESCATTR attr;
     
    11741174            rc =  VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_TR,         pCtx->tr);
    11751175            rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_TR_LIMIT,         pCtx->trHid.u32Limit);
    1176             rc |= VMXWriteVMCS(VMX_VMCS_GUEST_TR_BASE,            pCtx->trHid.u64Base);
     1176            rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_TR_BASE,          pCtx->trHid.u64Base);
    11771177
    11781178            val = pCtx->trHid.Attr.u;
     
    11931193    {
    11941194        rc  = VMXWriteVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT,       pCtx->gdtr.cbGdt);
    1195         rc |= VMXWriteVMCS(VMX_VMCS_GUEST_GDTR_BASE,          pCtx->gdtr.pGdt);
     1195        rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_GDTR_BASE,        pCtx->gdtr.pGdt);
    11961196        AssertRC(rc);
    11971197    }
     
    12001200    {
    12011201        rc  = VMXWriteVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT,       pCtx->idtr.cbIdt);
    1202         rc |= VMXWriteVMCS(VMX_VMCS_GUEST_IDTR_BASE,          pCtx->idtr.pIdt);
     1202        rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_IDTR_BASE,        pCtx->idtr.pIdt);
    12031203        AssertRC(rc);
    12041204    }
     
    12081208     */
    12091209    rc  = VMXWriteVMCS(VMX_VMCS32_GUEST_SYSENTER_CS,    pCtx->SysEnter.cs);
    1210     rc |= VMXWriteVMCS(VMX_VMCS_GUEST_SYSENTER_EIP,     pCtx->SysEnter.eip);
    1211     rc |= VMXWriteVMCS(VMX_VMCS_GUEST_SYSENTER_ESP,     pCtx->SysEnter.esp);
     1210    rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_SYSENTER_EIP,   pCtx->SysEnter.eip);
     1211    rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_SYSENTER_ESP,   pCtx->SysEnter.esp);
    12121212    AssertRC(rc);
    12131213
     
    12591259        val &= ~(X86_CR0_CD|X86_CR0_NW);
    12601260
    1261         rc |= VMXWriteVMCS(VMX_VMCS_GUEST_CR0,              val);
     1261        rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_CR0,            val);
    12621262        Log2(("Guest CR0 %08x\n", val));
    12631263        /* CR0 flags owned by the host; if the guests attempts to change them, then
     
    13301330#endif /* HWACCM_VMX_EMULATE_REALMODE */
    13311331
    1332         rc |= VMXWriteVMCS(VMX_VMCS_GUEST_CR4,              val);
     1332        rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_CR4,            val);
    13331333        Log2(("Guest CR4 %08x\n", val));
    13341334        /* CR4 flags owned by the host; if the guests attempts to change them, then
     
    13931393
    13941394        /* Save our shadow CR3 register. */
    1395         rc = VMXWriteVMCS(VMX_VMCS_GUEST_CR3, val);
     1395        rc = VMXWriteVMCS(VMX_VMCS64_GUEST_CR3, val);
    13961396        AssertRC(rc);
    13971397    }
     
    14081408
    14091409        /* Resync DR7 */
    1410         rc = VMXWriteVMCS(VMX_VMCS_GUEST_DR7, pCtx->dr[7]);
     1410        rc = VMXWriteVMCS(VMX_VMCS64_GUEST_DR7, pCtx->dr[7]);
    14111411        AssertRC(rc);
    14121412
     
    14381438
    14391439    /* EIP, ESP and EFLAGS */
    1440     rc  = VMXWriteVMCS(VMX_VMCS_GUEST_RIP,              pCtx->rip);
    1441     rc |= VMXWriteVMCS(VMX_VMCS_GUEST_RSP,              pCtx->rsp);
     1440    rc  = VMXWriteVMCS(VMX_VMCS64_GUEST_RIP, pCtx->rip);
     1441    rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_RSP, pCtx->rsp);
    14421442    AssertRC(rc);
    14431443
     
    15101510#endif
    15111511        /* Unconditionally update these as wrmsr might have changed them. */
    1512         rc = VMXWriteVMCS(VMX_VMCS_GUEST_FS_BASE, pCtx->fsHid.u64Base);
    1513         AssertRC(rc);
    1514         rc = VMXWriteVMCS(VMX_VMCS_GUEST_GS_BASE, pCtx->gsHid.u64Base);
     1512        rc = VMXWriteVMCS(VMX_VMCS64_GUEST_FS_BASE, pCtx->fsHid.u64Base);
     1513        AssertRC(rc);
     1514        rc = VMXWriteVMCS(VMX_VMCS64_GUEST_GS_BASE, pCtx->gsHid.u64Base);
    15151515        AssertRC(rc);
    15161516    }
     
    15431543
    15441544    /* Let's first sync back eip, esp, and eflags. */
    1545     rc = VMXReadVMCS(VMX_VMCS_GUEST_RIP,              &val);
     1545    rc = VMXReadVMCS(VMX_VMCS64_GUEST_RIP,              &val);
    15461546    AssertRC(rc);
    15471547    pCtx->rip               = val;
    1548     rc = VMXReadVMCS(VMX_VMCS_GUEST_RSP,              &val);
     1548    rc = VMXReadVMCS(VMX_VMCS64_GUEST_RSP,              &val);
    15491549    AssertRC(rc);
    15501550    pCtx->rsp               = val;
     
    15661566
    15671567    /* Control registers. */
    1568     VMXReadVMCS(VMX_VMCS_CTRL_CR0_READ_SHADOW,   &valShadow);
    1569     VMXReadVMCS(VMX_VMCS_GUEST_CR0,              &val);
     1568    VMXReadVMCS(VMX_VMCS_CTRL_CR0_READ_SHADOW,     &valShadow);
     1569    VMXReadVMCS(VMX_VMCS64_GUEST_CR0,              &val);
    15701570    val = (valShadow & pVCpu->hwaccm.s.vmx.cr0_mask) | (val & ~pVCpu->hwaccm.s.vmx.cr0_mask);
    15711571    CPUMSetGuestCR0(pVM, val);
    15721572
    1573     VMXReadVMCS(VMX_VMCS_CTRL_CR4_READ_SHADOW,   &valShadow);
    1574     VMXReadVMCS(VMX_VMCS_GUEST_CR4,              &val);
     1573    VMXReadVMCS(VMX_VMCS_CTRL_CR4_READ_SHADOW,     &valShadow);
     1574    VMXReadVMCS(VMX_VMCS64_GUEST_CR4,              &val);
    15751575    val = (valShadow & pVCpu->hwaccm.s.vmx.cr4_mask) | (val & ~pVCpu->hwaccm.s.vmx.cr4_mask);
    15761576    CPUMSetGuestCR4(pVM, val);
     
    15841584        CPUMSetGuestCR2(pVM, ASMGetCR2());
    15851585
    1586         VMXReadVMCS(VMX_VMCS_GUEST_CR3, &val);
     1586        VMXReadVMCS(VMX_VMCS64_GUEST_CR3, &val);
    15871587
    15881588        if (val != pCtx->cr3)
     
    15961596
    15971597    /* Sync back DR7 here. */
    1598     VMXReadVMCS(VMX_VMCS_GUEST_DR7, &val);
     1598    VMXReadVMCS(VMX_VMCS64_GUEST_DR7, &val);
    15991599    pCtx->dr[7] = val;
    16001600
     
    16121612    VMXReadVMCS(VMX_VMCS32_GUEST_SYSENTER_CS,    &val);
    16131613    pCtx->SysEnter.cs       = val;
    1614     VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_EIP,     &val);
     1614    VMXReadVMCS(VMX_VMCS64_GUEST_SYSENTER_EIP,     &val);
    16151615    pCtx->SysEnter.eip      = val;
    1616     VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_ESP,     &val);
     1616    VMXReadVMCS(VMX_VMCS64_GUEST_SYSENTER_ESP,     &val);
    16171617    pCtx->SysEnter.esp      = val;
    16181618
     
    16221622    VMXReadVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT,     &val);
    16231623    pCtx->gdtr.cbGdt        = val;
    1624     VMXReadVMCS(VMX_VMCS_GUEST_GDTR_BASE,        &val);
     1624    VMXReadVMCS(VMX_VMCS64_GUEST_GDTR_BASE,        &val);
    16251625    pCtx->gdtr.pGdt         = val;
    16261626
    16271627    VMXReadVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT,     &val);
    16281628    pCtx->idtr.cbIdt        = val;
    1629     VMXReadVMCS(VMX_VMCS_GUEST_IDTR_BASE,        &val);
     1629    VMXReadVMCS(VMX_VMCS64_GUEST_IDTR_BASE,        &val);
    16301630    pCtx->idtr.pIdt         = val;
    16311631
     
    23372337
    23382338                    /* Resync DR7 */
    2339                     rc = VMXWriteVMCS(VMX_VMCS_GUEST_DR7, pCtx->dr[7]);
     2339                    rc = VMXWriteVMCS(VMX_VMCS64_GUEST_DR7, pCtx->dr[7]);
    23402340                    AssertRC(rc);
    23412341
     
    28722872
    28732873                            /* Resync DR7 */
    2874                             rc = VMXWriteVMCS(VMX_VMCS_GUEST_DR7, pCtx->dr[7]);
     2874                            rc = VMXWriteVMCS(VMX_VMCS64_GUEST_DR7, pCtx->dr[7]);
    28752875                            AssertRC(rc);
    28762876
     
    30203020        Log(("VMX_EXIT_ERR_INVALID_GUEST_STATE\n"));
    30213021
    3022         VMXReadVMCS(VMX_VMCS_GUEST_RIP, &val);
     3022        VMXReadVMCS(VMX_VMCS64_GUEST_RIP, &val);
    30233023        Log(("Old eip %RGv new %RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)val));
    30243024
    3025         VMXReadVMCS(VMX_VMCS_GUEST_CR0, &val);
     3025        VMXReadVMCS(VMX_VMCS64_GUEST_CR0, &val);
    30263026        Log(("VMX_VMCS_GUEST_CR0        %RX64\n", val));
    30273027
    3028         VMXReadVMCS(VMX_VMCS_GUEST_CR3, &val);
     3028        VMXReadVMCS(VMX_VMCS64_GUEST_CR3, &val);
    30293029        Log(("VMX_VMCS_GUEST_CR3        %RGp\n", val));
    30303030
    3031         VMXReadVMCS(VMX_VMCS_GUEST_CR4, &val);
     3031        VMXReadVMCS(VMX_VMCS64_GUEST_CR4, &val);
    30323032        Log(("VMX_VMCS_GUEST_CR4        %RX64\n", val));
    30333033
     
    30443044        VMX_LOG_SELREG(LDTR, "LDTR");
    30453045
    3046         VMXReadVMCS(VMX_VMCS_GUEST_GDTR_BASE, &val);
     3046        VMXReadVMCS(VMX_VMCS64_GUEST_GDTR_BASE, &val);
    30473047        Log(("VMX_VMCS_GUEST_GDTR_BASE    %RGv\n", val));
    3048         VMXReadVMCS(VMX_VMCS_GUEST_IDTR_BASE, &val);
     3048        VMXReadVMCS(VMX_VMCS64_GUEST_IDTR_BASE, &val);
    30493049        Log(("VMX_VMCS_GUEST_IDTR_BASE    %RGv\n", val));
    30503050#endif /* VBOX_STRICT */
     
    33013301            ASMGetGDTR(&gdtr);
    33023302
    3303             VMXReadVMCS(VMX_VMCS_GUEST_RIP, &val);
     3303            VMXReadVMCS(VMX_VMCS64_GUEST_RIP, &val);
    33043304            Log(("Old eip %RGv new %RGv\n", (RTGCPTR)pCtx->rip, (RTGCPTR)val));
    33053305            VMXReadVMCS(VMX_VMCS_CTRL_PIN_EXEC_CONTROLS, &val);
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.h

    r14875 r14997  
    155155        rc  = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_##REG,      pCtx->reg);                         \
    156156        rc |= VMXWriteVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT,    pCtx->reg##Hid.u32Limit);           \
    157         rc |= VMXWriteVMCS(VMX_VMCS_GUEST_##REG##_BASE,     pCtx->reg##Hid.u64Base);            \
     157        rc |= VMXWriteVMCS(VMX_VMCS64_GUEST_##REG##_BASE,     pCtx->reg##Hid.u64Base);            \
    158158        if ((pCtx->eflags.u32 & X86_EFL_VM))                                                    \
    159159            val = pCtx->reg##Hid.Attr.u;                                                        \
     
    181181        VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT,         &val);   \
    182182        pCtx->reg##Hid.u32Limit    = val;                            \
    183         VMXReadVMCS(VMX_VMCS_GUEST_##REG##_BASE,          &val);     \
     183        VMXReadVMCS(VMX_VMCS64_GUEST_##REG##_BASE,          &val);   \
    184184        pCtx->reg##Hid.u64Base     = val;                            \
    185185        VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val);   \
     
    193193        VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_LIMIT,         &val);   \
    194194        Log(("%s Limit        %x\n", szSelReg, val));                \
    195         VMXReadVMCS(VMX_VMCS_GUEST_##REG##_BASE,          &val);     \
     195        VMXReadVMCS(VMX_VMCS64_GUEST_##REG##_BASE,          &val);   \
    196196        Log(("%s Base         %RX64\n", szSelReg, val));             \
    197197        VMXReadVMCS(VMX_VMCS32_GUEST_##REG##_ACCESS_RIGHTS, &val);   \
Note: See TracChangeset for help on using the changeset viewer.

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