VirtualBox

Changeset 45503 in vbox for trunk


Ignore:
Timestamp:
Apr 12, 2013 1:17:01 AM (12 years ago)
Author:
vboxsync
Message:

HM: Alignment fixes. s/u32InstrLen/cbInstr/g. A couple of doxygen fixes. Changed a few 'unsigned' structure members to 'uint32_t' - we stopped believing in 'unsigned' 6-7 years ago.

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

Legend:

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

    r45502 r45503  
    12361236            if (pVM->hm.s.vmx.msr.vmx_ept_vpid_caps & MSR_IA32_VMX_EPT_VPID_CAP_INVVPID_INDIV_ADDR)
    12371237            {
    1238                 for (unsigned i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
     1238                for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
    12391239                    hmR0VmxFlushVpid(pVM, pVCpu, VMX_FLUSH_VPID_INDIV_ADDR, pVCpu->hm.s.TlbShootdown.aPages[i]);
    12401240            }
     
    13221322    }
    13231323
    1324     pVCpu->hm.s.TlbShootdown.cPages= 0;
     1324    pVCpu->hm.s.TlbShootdown.cPages = 0;
    13251325    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
    13261326}
     
    14021402            if (pVM->hm.s.vmx.msr.vmx_ept_vpid_caps & MSR_IA32_VMX_EPT_VPID_CAP_INVVPID_INDIV_ADDR)
    14031403            {
    1404                 for (unsigned i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
     1404                for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
    14051405                    hmR0VmxFlushVpid(pVM, pVCpu, VMX_FLUSH_VPID_INDIV_ADDR, pVCpu->hm.s.TlbShootdown.aPages[i]);
    14061406            }
     
    46524652    pVCpu->hm.s.Event.u64IntrInfo = u32IntrInfo;
    46534653    pVCpu->hm.s.Event.u32ErrCode  = u32ErrCode;
    4654     pVCpu->hm.s.Event.u32InstrLen = cbInstr;
     4654    pVCpu->hm.s.Event.cbInstr    = cbInstr;
    46554655}
    46564656
     
    58165816    {
    58175817        Log(("Injecting pending event\n"));
    5818         int rc = hmR0VmxInjectEventVmcs(pVCpu, pMixedCtx, pVCpu->hm.s.Event.u64IntrInfo, pVCpu->hm.s.Event.u32InstrLen,
     5818        int rc = hmR0VmxInjectEventVmcs(pVCpu, pMixedCtx, pVCpu->hm.s.Event.u64IntrInfo, pVCpu->hm.s.Event.cbInstr,
    58195819                                        pVCpu->hm.s.Event.u32ErrCode);
    58205820        AssertRCReturn(rc, rc);
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r45387 r45503  
    11811181            /* Deal with pending TLB shootdown actions which were queued when we were not executing code. */
    11821182            STAM_COUNTER_INC(&pVCpu->hm.s.StatTlbShootdown);
    1183             for (unsigned i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
     1183            for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
    11841184                SVMR0InvlpgA(pVCpu->hm.s.TlbShootdown.aPages[i], pvVMCB->ctrl.TLBCtrl.n.u32ASID);
    11851185        }
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r45478 r45503  
    26102610    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
    26112611    pVCpu->hm.s.TlbShootdown.cPages = 0;
    2612     return;
    26132612}
    26142613
     
    26972696            if (pVM->hm.s.vmx.msr.vmx_ept_vpid_caps & MSR_IA32_VMX_EPT_VPID_CAP_INVVPID_INDIV_ADDR)
    26982697            {
    2699                 for (unsigned i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
     2698                for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
    27002699                    hmR0VmxFlushVPID(pVM, pVCpu, VMX_FLUSH_VPID_INDIV_ADDR, pVCpu->hm.s.TlbShootdown.aPages[i]);
    27012700            }
     
    27752774        }
    27762775    }
    2777     pVCpu->hm.s.TlbShootdown.cPages= 0;
     2776    pVCpu->hm.s.TlbShootdown.cPages = 0;
    27782777    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
    27792778
     
    28602859            if (pVM->hm.s.vmx.msr.vmx_ept_vpid_caps & MSR_IA32_VMX_EPT_VPID_CAP_INVVPID_INDIV_ADDR)
    28612860            {
    2862                 for (unsigned i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
     2861                for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
    28632862                    hmR0VmxFlushVPID(pVM, pVCpu, VMX_FLUSH_VPID_INDIV_ADDR, pVCpu->hm.s.TlbShootdown.aPages[i]);
    28642863            }
  • trunk/src/VBox/VMM/include/HMInternal.h

    r45502 r45503  
    582582    uint32_t                    u32Alignment;
    583583
    584     /* Host's TSC_AUX MSR (used when RDTSCP doesn't cause VM-exits). */
     584    /** Host's TSC_AUX MSR (used when RDTSCP doesn't cause VM-exits). */
    585585    uint64_t                    u64HostTscAux;
    586586
     
    655655        R0PTRTYPE(void *)           pvHostMsr;
    656656
    657         /* Number of automatically loaded/restored guest MSRs during the world switch. */
     657        /** Number of automatically loaded/restored guest MSRs during the world switch. */
    658658        uint32_t                    cGuestMsrs;
    659659        uint32_t                    uAlignment;
    660660#endif /* VBOX_WITH_AUTO_MSR_LOAD_RESTORE */
    661661
    662         /* The cached APIC-base MSR used for identifying when to map the HC physical APIC-access page. */
     662        /** The cached APIC-base MSR used for identifying when to map the HC physical APIC-access page. */
    663663        uint64_t                    u64MsrApicBase;
    664         /* Last use TSC offset value. (cached) */
     664        /** Last use TSC offset value. (cached) */
    665665        uint64_t                    u64TSCOffset;
    666666        /** VMCS cache. */
     
    731731        uint32_t                    fPending;
    732732        uint32_t                    u32ErrCode;
    733         uint32_t                    u32InstrLen;
     733        uint32_t                    cbInstr;
     734        uint32_t                    u32Padding; /**< Explicit alignment padding. */
    734735        uint64_t                    u64IntrInfo;
    735736    } Event;
     
    749750    struct
    750751    {
    751         /* Pending IO operation type. */
    752         HMPENDINGIO         enmType;
     752        /** Pending IO operation type. */
     753        HMPENDINGIO             enmType;
    753754        uint32_t                uPadding;
    754755        RTGCPTR                 GCPtrRip;
     
    758759            struct
    759760            {
    760                 unsigned        uPort;
    761                 unsigned        uAndVal;
    762                 unsigned        cbSize;
     761                uint32_t        uPort;
     762                uint32_t        uAndVal;
     763                uint32_t        cbSize;
    763764            } Port;
    764765            uint64_t            aRaw[2];
     
    781782    {
    782783        RTGCPTR             aPages[HM_MAX_TLB_SHOOTDOWN_PAGES];
    783         unsigned            cPages;
     784        uint32_t            cPages;
     785        uint32_t            u32Padding; /**< Explicit alignment padding. */
    784786    } TlbShootdown;
    785787
     
    788790    DISCPUSTATE             DisState;
    789791
    790     uint32_t                padding2[1];
    791 
    792792    STAMPROFILEADV          StatEntry;
    793793    STAMPROFILEADV          StatExit1;
    794794    STAMPROFILEADV          StatExit2;
    795 #ifdef VBOX_WITH_OLD_VTX_CODE /* temporary for tracking down darwin issues. */
     795#ifdef VBOX_WITH_OLD_VTX_CODE /* "temporary" for tracking down darwin issues. */
    796796    STAMPROFILEADV          StatExit2Sub1;
    797797    STAMPROFILEADV          StatExit2Sub2;
  • trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp

    r45152 r45503  
    403403    CHECK_MEMBER_ALIGNMENT(HMCPU, vmx.HCPhysVmcs, sizeof(RTHCPHYS));
    404404    CHECK_MEMBER_ALIGNMENT(HMCPU, vmx.u32PinCtls, 8);
     405    CHECK_MEMBER_ALIGNMENT(HMCPU, DisState, 8);
    405406    CHECK_MEMBER_ALIGNMENT(HMCPU, Event.u64IntrInfo, 8);
    406407
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