VirtualBox

Changeset 46098 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
May 15, 2013 2:16:27 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: nits.

File:
1 edited

Legend:

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

    r46089 r46098  
    38663866                rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, &u32Val);                 AssertRC(rc);
    38673867                Log(("VMX_VMCS32_CTRL_PROC_EXEC               %#RX32\n", u32Val));
    3868                 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val);       AssertRC(rc);
     3868                rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val);                AssertRC(rc);
    38693869                Log(("VMX_VMCS32_CTRL_PROC_EXEC2              %#RX32\n", u32Val));
    3870                 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_ENTRY, &u32Val);            AssertRC(rc);
     3870                rc = VMXReadVmcs32(VMX_VMCS32_CTRL_ENTRY, &u32Val);                     AssertRC(rc);
    38713871                Log(("VMX_VMCS32_CTRL_ENTRY                   %#RX32\n", u32Val));
    3872                 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_EXIT, &u32Val);             AssertRC(rc);
     3872                rc = VMXReadVmcs32(VMX_VMCS32_CTRL_EXIT, &u32Val);                      AssertRC(rc);
    38733873                Log(("VMX_VMCS32_CTRL_EXIT                    %#RX32\n", u32Val));
    38743874                rc = VMXReadVmcs32(VMX_VMCS32_CTRL_CR3_TARGET_COUNT, &u32Val);          AssertRC(rc);
     
    39063906
    39073907                /* Guest bits. */
    3908                 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RIP, &u64Val);        AssertRC(rc);
     3908                rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RIP, &u64Val);          AssertRC(rc);
    39093909                Log(("Old Guest Rip %#RX64 New %#RX64\n", pCtx->rip, u64Val));
    3910                 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RSP, &u64Val);        AssertRC(rc);
     3910                rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RSP, &u64Val);          AssertRC(rc);
    39113911                Log(("Old Guest Rsp %#RX64 New %#RX64\n", pCtx->rsp, u64Val));
    3912                 rc = VMXReadVmcs32(VMX_VMCS_GUEST_RFLAGS, &u32Val);       AssertRC(rc);
     3912                rc = VMXReadVmcs32(VMX_VMCS_GUEST_RFLAGS, &u32Val);         AssertRC(rc);
    39133913                Log(("Old Guest Rflags %#RX32 New %#RX32\n", pCtx->eflags.u32, u32Val));
    3914                 rc = VMXReadVmcs32(VMX_VMCS16_GUEST_FIELD_VPID, &u32Val); AssertRC(rc);
     3914                rc = VMXReadVmcs32(VMX_VMCS16_GUEST_FIELD_VPID, &u32Val);   AssertRC(rc);
    39153915                Log(("VMX_VMCS16_GUEST_FIELD_VPID %u\n", u32Val));
    39163916
    39173917                /* Host bits. */
    3918                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_CR0, &uHCReg); AssertRC(rc);
     3918                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_CR0, &uHCReg);           AssertRC(rc);
    39193919                Log(("Host CR0 %#RHr\n", uHCReg));
    3920                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_CR3, &uHCReg); AssertRC(rc);
     3920                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_CR3, &uHCReg);           AssertRC(rc);
    39213921                Log(("Host CR3 %#RHr\n", uHCReg));
    3922                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_CR4, &uHCReg); AssertRC(rc);
     3922                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_CR4, &uHCReg);           AssertRC(rc);
    39233923                Log(("Host CR4 %#RHr\n", uHCReg));
    39243924
     
    39263926                PCX86DESCHC pDesc;
    39273927                ASMGetGDTR(&HostGdtr);
    3928                 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_CS, &u32Val);
     3928                rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_CS, &u32Val);      AssertRC(rc);
    39293929                Log(("Host CS %#08x\n", u32Val));
    39303930                if (u32Val < HostGdtr.cbGdt)
     
    39343934                }
    39353935
    3936                 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_DS, &u32Val); AssertRC(rc);
     3936                rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_DS, &u32Val);      AssertRC(rc);
    39373937                Log(("Host DS %#08x\n", u32Val));
    39383938                if (u32Val < HostGdtr.cbGdt)
     
    39423942                }
    39433943
    3944                 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_ES, &u32Val); AssertRC(rc);
     3944                rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_ES, &u32Val);      AssertRC(rc);
    39453945                Log(("Host ES %#08x\n", u32Val));
    39463946                if (u32Val < HostGdtr.cbGdt)
     
    39503950                }
    39513951
    3952                 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_FS, &u32Val); AssertRC(rc);
     3952                rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_FS, &u32Val);      AssertRC(rc);
    39533953                Log(("Host FS %#08x\n", u32Val));
    39543954                if (u32Val < HostGdtr.cbGdt)
     
    39583958                }
    39593959
    3960                 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_GS, &u32Val); AssertRC(rc);
     3960                rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_GS, &u32Val);      AssertRC(rc);
    39613961                Log(("Host GS %#08x\n", u32Val));
    39623962                if (u32Val < HostGdtr.cbGdt)
     
    39663966                }
    39673967
    3968                 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_SS, &u32Val); AssertRC(rc);
     3968                rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_SS, &u32Val);      AssertRC(rc);
    39693969                Log(("Host SS %#08x\n", u32Val));
    39703970                if (u32Val < HostGdtr.cbGdt)
     
    39743974                }
    39753975
    3976                 rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_TR,  &u32Val); AssertRC(rc);
     3976                rc = VMXReadVmcs32(VMX_VMCS16_HOST_FIELD_TR,  &u32Val);     AssertRC(rc);
    39773977                Log(("Host TR %#08x\n", u32Val));
    39783978                if (u32Val < HostGdtr.cbGdt)
     
    39823982                }
    39833983
    3984                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_TR_BASE, &uHCReg); AssertRC(rc);
     3984                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_TR_BASE, &uHCReg);       AssertRC(rc);
    39853985                Log(("Host TR Base %#RHv\n", uHCReg));
    3986                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_GDTR_BASE, &uHCReg); AssertRC(rc);
     3986                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_GDTR_BASE, &uHCReg);     AssertRC(rc);
    39873987                Log(("Host GDTR Base %#RHv\n", uHCReg));
    3988                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_IDTR_BASE, &uHCReg); AssertRC(rc);
     3988                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_IDTR_BASE, &uHCReg);     AssertRC(rc);
    39893989                Log(("Host IDTR Base %#RHv\n", uHCReg));
    3990                 rc = VMXReadVmcs32(VMX_VMCS32_HOST_SYSENTER_CS, &u32Val); AssertRC(rc);
     3990                rc = VMXReadVmcs32(VMX_VMCS32_HOST_SYSENTER_CS, &u32Val);   AssertRC(rc);
    39913991                Log(("Host SYSENTER CS  %#08x\n", u32Val));
    3992                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_SYSENTER_EIP, &uHCReg); AssertRC(rc);
     3992                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_SYSENTER_EIP, &uHCReg);  AssertRC(rc);
    39933993                Log(("Host SYSENTER EIP %#RHv\n", uHCReg));
    3994                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_SYSENTER_ESP, &uHCReg); AssertRC(rc);
     3994                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_SYSENTER_ESP, &uHCReg);  AssertRC(rc);
    39953995                Log(("Host SYSENTER ESP %#RHv\n", uHCReg));
    3996                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_RSP, &uHCReg); AssertRC(rc);
     3996                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_RSP, &uHCReg);           AssertRC(rc);
    39973997                Log(("Host RSP %#RHv\n", uHCReg));
    3998                 rc = VMXReadVmcsHstN(VMX_VMCS_HOST_RIP, &uHCReg); AssertRC(rc);
     3998                rc = VMXReadVmcsHstN(VMX_VMCS_HOST_RIP, &uHCReg);           AssertRC(rc);
    39993999                Log(("Host RIP %#RHv\n", uHCReg));
    40004000# if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
     
    40644064#endif /* VBOX_STRICT */
    40654065
     4066
    40664067/**
    40674068 * Executes the specified handler in 64-bit mode.
     
    41264127    STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatWorldSwitch3264, z);
    41274128
    4128     /** @todo replace with hmR0VmxEnterRootMode() and LeaveRootMode(). */
     4129    /** @todo replace with hmR0VmxEnterRootMode() and hmR0VmxLeaveRootMode(). */
    41294130    /* Make sure the VMX instructions don't cause #UD faults. */
    41304131    ASMSetCR4(ASMGetCR4() | X86_CR4_VMXE);
     
    42064207    AssertMsg(pCache->TestIn.HCPhysCpuPage == HCPhysCpuPage, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysCpuPage, HCPhysCpuPage));
    42074208    AssertMsg(pCache->TestIn.HCPhysVmcs    == pVCpu->hm.s.vmx.HCPhysVmcs, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysVmcs,
    4208                                                                                pVCpu->hm.s.vmx.HCPhysVmcs));
     4209                                                                           pVCpu->hm.s.vmx.HCPhysVmcs));
    42094210    AssertMsg(pCache->TestIn.HCPhysVmcs    == pCache->TestOut.HCPhysVmcs, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysVmcs,
    42104211                                                                           pCache->TestOut.HCPhysVmcs));
     
    42144215              ("%RGv vs %RGv\n", pCache->TestIn.pCache, VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.VMCSCache)));
    42154216    AssertMsg(pCache->TestIn.pCtx          == pCache->TestOut.pCtx, ("%RGv vs %RGv\n", pCache->TestIn.pCtx,
    4216                                                                     pCache->TestOut.pCtx));
     4217                                                                     pCache->TestOut.pCtx));
    42174218    Assert(!(pCache->TestOut.eflags & X86_EFL_IF));
    42184219#endif
     
    42334234static int hmR0VmxInitVmcsReadCache(PVM pVM, PVMCPU pVCpu)
    42344235{
    4235 #define VMXLOCAL_INIT_READ_CACHE_FIELD(pCache, idxField)                            \
    4236 {                                                                                   \
    4237     Assert(pCache->Read.aField[idxField##_CACHE_IDX] == 0);                         \
    4238     pCache->Read.aField[idxField##_CACHE_IDX] = idxField;                           \
    4239     pCache->Read.aFieldVal[idxField##_CACHE_IDX] = 0;                               \
    4240     ++cReadFields;                                                                  \
     4236#define VMXLOCAL_INIT_READ_CACHE_FIELD(pCache, idxField)       \
     4237{                                                              \
     4238    Assert(pCache->Read.aField[idxField##_CACHE_IDX] == 0);    \
     4239    pCache->Read.aField[idxField##_CACHE_IDX] = idxField;      \
     4240    pCache->Read.aFieldVal[idxField##_CACHE_IDX] = 0;          \
     4241    ++cReadFields;                                             \
    42414242}
    42424243
     
    42464247    uint32_t cReadFields = 0;
    42474248
    4248     /* Guest-natural selector base fields */
     4249    /*
     4250     * Don't remove the #if 0'd fields in this code. They're listed here for consistency
     4251     * and serve to indicate exceptions to the rules.
     4252     */
     4253
     4254    /* Guest-natural selector base fields. */
    42494255#if 0
    42504256    /* These are 32-bit in practice. See Intel spec. 2.5 "Control Registers". */
     
    52025208 *
    52035209 * @remarks No-long-jump zone!!!
    5204  * @remarks Never call this function directly. Use the VMXLOCAL_READ_SEG() macro
    5205  *          as that takes care of whether to read from the VMCS cache or not.
     5210 * @remarks Never call this function directly!!! Use the VMXLOCAL_READ_SEG()
     5211 *          macro as that takes care of whether to read from the VMCS cache or
     5212 *          not.
    52065213 */
    52075214DECLINLINE(int) hmR0VmxReadSegmentReg(PVMCPU pVCpu, uint32_t idxSel, uint32_t idxLimit, uint32_t idxBase, uint32_t idxAccess,
     
    52425249    return VINF_SUCCESS;
    52435250}
     5251
    52445252
    52455253#ifdef VMX_USE_CACHED_VMCS_ACCESSES
     
    52525260                          VMX_VMCS_GUEST_##Sel##_BASE, VMX_VMCS32_GUEST_##Sel##_ACCESS_RIGHTS, &pMixedCtx->CtxSel)
    52535261#endif
     5262
    52545263
    52555264/**
     
    56895698
    56905699    Log(("HM event->TRPM: uVector=%#x enmTrapType=%d\n", uVector, enmTrapType));
     5700
    56915701    int rc = TRPMAssertTrap(pVCpu, uVector, enmTrapType);
    56925702    AssertRC(rc);
     
    75807590{
    75817591    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
     7592
    75827593    /* We expose XSETBV to the guest, fallback to the recompiler for emulation. */
    75837594    /** @todo check if XSETBV is supported by the recompiler. */
     
    75927603{
    75937604    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
     7605
    75947606    /* The guest should not invalidate the host CPU's TLBs, fallback to recompiler. */
    75957607    /** @todo implement EMInterpretInvpcid() */
     
    76827694{
    76837695    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
     7696
    76847697    /* By default, we don't enable VMX_VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT. */
    76857698    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitXdtrAccess);
     
    76977710{
    76987711    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
     7712
    76997713    /* By default, we don't enable VMX_VMCS_CTRL_PROC_EXEC2_RDRAND_EXIT. */
    77007714    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitRdrand);
     
    77127726{
    77137727    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
     7728
    77147729    /* EMInterpretRdmsr() requires CR0, Eflags and SS segment register. */
    77157730    int rc  = hmR0VmxSaveGuestCR0(pVCpu, pMixedCtx);
     
    78437858{
    78447859    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
     7860
    78457861    /* By default, we don't enable VMX_VMCS_CTRL_PROC_EXEC_PAUSE_EXIT. */
    78467862    STAM_COUNTER_INC(&pVCpu->hm.s.StatExitPause);
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