VirtualBox

Changeset 45442 in vbox


Ignore:
Timestamp:
Apr 9, 2013 5:34:38 PM (11 years ago)
Author:
vboxsync
Message:

VMM/VMMR0: HM bits.

File:
1 edited

Legend:

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

    r45419 r45442  
    15911591        Assert(!(pVCpu->hm.s.vmx.HCPhysVirtApic & 0xfff));              /* Bits 11:0 MBZ. */
    15921592        rc  = VMXWriteVmcs32(VMX_VMCS32_CTRL_TPR_THRESHOLD, 0);
    1593         rc  = VMXWriteVmcs64(VMX_VMCS64_CTRL_VAPIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVirtApic);
     1593        rc |= VMXWriteVmcs64(VMX_VMCS64_CTRL_VAPIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVirtApic);
     1594        AssertRCReturn(rc, rc);
    15941595
    15951596        val |= VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_USE_TPR_SHADOW;         /* CR8 reads from the Virtual-APIC page. */
     
    19771978    RTCCUINTREG uReg = ASMGetCR0();
    19781979    int rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_CR0, uReg);
    1979     AssertRCReturn(rc, rc);
    19801980
    19811981#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
     
    19841984    {
    19851985        uint64_t uReg = hmR0Get64bitCR3();
    1986         rc = VMXWriteVmcs64(VMX_VMCS_HOST_CR3, uReg);
     1986        rc |= VMXWriteVmcs64(VMX_VMCS_HOST_CR3, uReg);
    19871987    }
    19881988    else
     
    19901990    {
    19911991        uReg = ASMGetCR3();
    1992         rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_CR3, uReg);
    1993     }
    1994     AssertRCReturn(rc, rc);
     1992        rc |= VMXWriteVmcsHstN(VMX_VMCS_HOST_CR3, uReg);
     1993    }
    19951994
    19961995    uReg = ASMGetCR4();
    1997     rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_CR4, uReg);
     1996    rc |= VMXWriteVmcsHstN(VMX_VMCS_HOST_CR4, uReg);
    19981997    AssertRCReturn(rc, rc);
    19991998    return rc;
     
    22232222
    22242223    int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_EXIT_MSR_LOAD_COUNT, idxHostMsr);
    2225     AssertRCReturn(rc, rc);
    22262224
    22272225    /*
    22282226     * Host Sysenter MSRs.
    22292227     */
    2230     rc  = VMXWriteVmcs32(VMX_VMCS32_HOST_SYSENTER_CS,    ASMRdMsr_Low(MSR_IA32_SYSENTER_CS));
     2228    rc |= VMXWriteVmcs32(VMX_VMCS32_HOST_SYSENTER_CS,    ASMRdMsr_Low(MSR_IA32_SYSENTER_CS));
    22312229#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
    22322230    if (VMX_IS_64BIT_HOST_MODE())
     
    25912589    rc    |= hmR0VmxLoadGuestRsp(pVM, pVCpu, pCtx);
    25922590    rc    |= hmR0VmxLoadGuestRflags(pVM, pVCpu, pCtx);
    2593     AssertRCReturn(rc, rc);
    25942591    return rc;
    25952592}
     
    27252722
    27262723        /* Write VT-x's view of the guest CR0 into the VMCS and update the exception bitmap. */
    2727         rc |= VMXWriteVmcsGstN(VMX_VMCS_GUEST_CR0, u64GuestCR0);
     2724        rc  = VMXWriteVmcsGstN(VMX_VMCS_GUEST_CR0, u64GuestCR0);
    27282725        rc |= VMXWriteVmcs32(VMX_VMCS32_CTRL_EXCEPTION_BITMAP, pVCpu->hm.s.vmx.u32XcptBitmap);
    27292726        Log2(("VMX_VMCS_GUEST_CR0=%#RX32\n", (uint32_t)u64GuestCR0));
     
    30022999        /* Save the host and load the guest debug registers. This will make the guest debug state active. */
    30033000        rc = CPUMR0LoadGuestDebugState(pVM, pVCpu, pCtx, true /* include DR6 */);
    3004         AssertRCReturn(rc, rc);
     3001        AssertRC(rc);
    30053002        Assert(CPUMIsGuestDebugStateActive(pVCpu));
    30063003        Assert(fInterceptMovDRx == false);
     
    30123009        /* Save the host and load the hypervisor debug registers. This will make the hyper debug state active. */
    30133010        rc = CPUMR0LoadHyperDebugState(pVM, pVCpu, pCtx, true /* include DR6 */);
    3014         AssertRCReturn(rc, rc);
     3011        AssertRC(rc);
    30153012        Assert(CPUMIsHyperDebugStateActive(pVCpu));
    30163013        fInterceptMovDRx = true;
     
    47874784    rc    |= hmR0VmxSaveGuestRsp(pVM, pVCpu, pMixedCtx);
    47884785    rc    |= hmR0VmxSaveGuestRflags(pVM, pVCpu, pMixedCtx);
    4789     AssertRCReturn(rc, rc);
    47904786    return rc;
    47914787}
     
    50065002    /* Guest CR0. Guest FPU. */
    50075003    rc = hmR0VmxSaveGuestCR0(pVM, pVCpu, pMixedCtx);
    5008     AssertRCReturn(rc, rc);
    50095004
    50105005    /* Guest CR4. */
    5011     rc = hmR0VmxSaveGuestCR4(pVM, pVCpu, pMixedCtx);
     5006    rc |= hmR0VmxSaveGuestCR4(pVM, pVCpu, pMixedCtx);
    50125007    AssertRCReturn(rc, rc);
    50135008
     
    50195014        {
    50205015            rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_CR3, &uVal);
    5021             AssertRCReturn(rc, rc);
    50225016            if (pMixedCtx->cr3 != uVal)
    50235017            {
     
    50285022
    50295023            /* We require EFER to check PAE mode. */
    5030             rc = hmR0VmxSaveGuestAutoLoadStoreMsrs(pVM, pVCpu, pMixedCtx);
    5031             AssertRCReturn(rc, rc);
     5024            rc |= hmR0VmxSaveGuestAutoLoadStoreMsrs(pVM, pVCpu, pMixedCtx);
    50325025
    50335026            /* If the guest is in PAE mode, sync back the PDPE's into the guest state. */
    50345027            if (CPUMIsGuestInPAEModeEx(pMixedCtx))  /* Reads CR0, CR4 and EFER MSR. */
    50355028            {
    5036                 rc  = VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE0_FULL, &pVCpu->hm.s.aPdpes[0].u);
     5029                rc |= VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE0_FULL, &pVCpu->hm.s.aPdpes[0].u);
    50375030                rc |= VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE1_FULL, &pVCpu->hm.s.aPdpes[1].u);
    50385031                rc |= VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE2_FULL, &pVCpu->hm.s.aPdpes[2].u);
    50395032                rc |= VMXReadVmcs64(VMX_VMCS64_GUEST_PDPTE3_FULL, &pVCpu->hm.s.aPdpes[3].u);
    5040                 AssertRCReturn(rc, rc);
    50415033                /* Set the force flag to inform PGM about it when necessary. It is cleared by PGMGstUpdatePaePdpes(). */
    50425034                VMCPU_FF_SET(pVCpu, VMCPU_FF_HM_UPDATE_PAE_PDPES);
    50435035            }
     5036            AssertRCReturn(rc, rc);
    50445037        }
    50455038        pVCpu->hm.s.vmx.fUpdatedGuestState |= VMX_UPDATED_GUEST_CR3;
     
    50665059{
    50675060    uint32_t u32Val = 0;
    5068     int rc = VMXReadVmcs32(idxSel, &u32Val);         AssertRCReturn(rc, rc);
     5061    int rc = VMXReadVmcs32(idxSel, &u32Val);
    50695062    pSelReg->Sel      = (uint16_t)u32Val;
    50705063    pSelReg->ValidSel = (uint16_t)u32Val;
    50715064    pSelReg->fFlags   = CPUMSELREG_FLAGS_VALID;
    50725065
    5073     rc = VMXReadVmcs32(idxLimit, &u32Val);           AssertRCReturn(rc, rc);
     5066    rc |= VMXReadVmcs32(idxLimit, &u32Val);
    50745067    pSelReg->u32Limit = u32Val;
    50755068
    50765069    RTGCUINTREG uGCVal = 0;
    5077     rc = VMXReadVmcsGstN(idxBase, &uGCVal);          AssertRCReturn(rc, rc);
     5070    rc |= VMXReadVmcsGstN(idxBase, &uGCVal);
    50785071    pSelReg->u64Base = uGCVal;
    50795072
    5080     rc = VMXReadVmcs32(idxAccess, &u32Val);          AssertRCReturn(rc, rc);
     5073    rc |= VMXReadVmcs32(idxAccess, &u32Val);
    50815074    pSelReg->Attr.u  = u32Val;
     5075    AssertRCReturn(rc, rc);
    50825076
    50835077    /*
     
    51155109    {
    51165110        rc = hmR0VmxSaveGuestCR0(pVM, pVCpu, pMixedCtx);
    5117         AssertRCReturn(rc, rc);
    5118 
    5119         rc  = hmR0VmxReadSegmentReg(VMX_VMCS16_GUEST_FIELD_CS, VMX_VMCS32_GUEST_CS_LIMIT, VMX_VMCS_GUEST_CS_BASE,
     5111
     5112        rc |= hmR0VmxReadSegmentReg(VMX_VMCS16_GUEST_FIELD_CS, VMX_VMCS32_GUEST_CS_LIMIT, VMX_VMCS_GUEST_CS_BASE,
    51205113                                    VMX_VMCS32_GUEST_CS_ACCESS_RIGHTS, &pMixedCtx->cs);
    51215114        rc |= hmR0VmxReadSegmentReg(VMX_VMCS16_GUEST_FIELD_SS, VMX_VMCS32_GUEST_SS_LIMIT, VMX_VMCS_GUEST_SS_BASE,
     
    51805173    {
    51815174        rc = hmR0VmxSaveGuestCR0(pVM, pVCpu, pMixedCtx);
    5182         AssertRCReturn(rc, rc);
    51835175
    51845176        /* For real-mode emulation using virtual-8086 mode we have the fake TSS (pRealModeTSS) in TR, don't sync the fake one. */
    51855177        if (!pVCpu->hm.s.vmx.RealMode.fRealOnV86Active)
    51865178        {
    5187             rc  = hmR0VmxReadSegmentReg(VMX_VMCS16_GUEST_FIELD_TR, VMX_VMCS32_GUEST_TR_LIMIT, VMX_VMCS_GUEST_TR_BASE,
     5179            rc |= hmR0VmxReadSegmentReg(VMX_VMCS16_GUEST_FIELD_TR, VMX_VMCS32_GUEST_TR_LIMIT, VMX_VMCS_GUEST_TR_BASE,
    51885180                                        VMX_VMCS32_GUEST_TR_ACCESS_RIGHTS, &pMixedCtx->tr);
    5189             AssertRCReturn(rc, rc);
    5190         }
     5181        }
     5182        AssertRCReturn(rc, rc);
    51915183        pVCpu->hm.s.vmx.fUpdatedGuestState |= VMX_UPDATED_GUEST_TR;
    51925184    }
     
    53475339        {
    53485340            rc = PGMGstUpdatePaePdpes(pVCpu, &pVCpu->hm.s.aPdpes[0]);
    5349             AssertRCReturn(rc, rc);
     5341            AssertRC(rc);
    53505342        }
    53515343
     
    58845876 * @param   uValue      The value to push to the guest stack.
    58855877 */
    5886 static int hmR0VmxRealModeGuestStackPush(PVM pVM, PCPUMCTX pMixedCtx, uint16_t uValue)
     5878DECLINLINE(int) hmR0VmxRealModeGuestStackPush(PVM pVM, PCPUMCTX pMixedCtx, uint16_t uValue)
    58875879{
    58885880    /*
     
    60035995                pMixedCtx->cs.Sel      = selIdtEntry;
    60045996                pMixedCtx->cs.u64Base  = selIdtEntry << cbIdtEntry;
    6005 
    60065997                pVCpu->hm.s.fContextUseFlags |=   HM_CHANGED_GUEST_SEGMENT_REGS
    60075998                                                | HM_CHANGED_GUEST_RIP
    60085999                                                | HM_CHANGED_GUEST_RFLAGS
    60096000                                                | HM_CHANGED_GUEST_RSP;
    6010                 AssertRCReturn(rc, rc);
    60116001            }
    60126002            Assert(rc == VINF_SUCCESS || rc == VINF_EM_RESET);
     
    60356025    rc |= VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INSTR_LENGTH, cbInstr);
    60366026    AssertRCReturn(rc, rc);
    6037 
    60386027    return rc;
    60396028}
     
    71987187{
    71997188    VMX_VALIDATE_EXIT_HANDLER_PARAMS();
    7200     int rc = hmR0VmxInjectXcptUD(pVM, pVCpu, pMixedCtx);
    7201     AssertRCReturn(rc, rc);
    7202     return rc;
     7189    return hmR0VmxInjectXcptUD(pVM, pVCpu, pMixedCtx);
    72037190}
    72047191
     
    79727959        /* Save the host & load the guest debug state, restart execution of the MOV DRx instruction. */
    79737960        rc = CPUMR0LoadGuestDebugState(pVM, pVCpu, pMixedCtx, true /* include DR6 */);
    7974         AssertRCReturn(rc, rc);
     7961        AssertRC(rc);
    79757962        Assert(CPUMIsGuestDebugStateActive(pVCpu));
    79767963
     
    80458032    RTGCPHYS GCPhys = 0;
    80468033    rc = VMXReadVmcs64(VMX_VMCS64_EXIT_GUEST_PHYS_ADDR_FULL, &GCPhys);
    8047     AssertRCReturn(rc, rc);
    80488034
    80498035#if 0
     
    80518037#else
    80528038    /* Aggressive state sync. for now. */
    8053     rc  = hmR0VmxSaveGuestGprs(pVM, pVCpu, pMixedCtx);
     8039    rc |= hmR0VmxSaveGuestGprs(pVM, pVCpu, pMixedCtx);
    80548040    rc |= hmR0VmxSaveGuestControlRegs(pVM, pVCpu, pMixedCtx);
    80558041    rc |= hmR0VmxSaveGuestSegmentRegs(pVM, pVCpu, pMixedCtx);
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