VirtualBox

Changeset 80253 in vbox for trunk/include


Ignore:
Timestamp:
Aug 13, 2019 3:49:33 PM (5 years ago)
Author:
vboxsync
Message:

VMM: Started refactoring VMMAll/* for bugref:9217

Location:
trunk/include/VBox
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/types.h

    r80239 r80253  
    117117/** Pointer to a context specific VM derived structure.
    118118 * This is PGVM in ring-0 and plain PVM in ring-3. */
    119 #if defined(IN_RING0) && defined(VBOX_BUGREF_9217_PART_I)
     119#if defined(IN_RING0) && defined(VBOX_BUGREF_9217)
    120120typedef PGVM                        PVMCC;
    121121#else
     
    124124/** Pointer to a const context specific VM derived structure.
    125125 * This is PCGVM in ring-0 and plain PCVM in ring-3. */
    126 #if defined(IN_RING0) && defined(VBOX_BUGREF_9217_PART_I)
     126#if defined(IN_RING0) && defined(VBOX_BUGREF_9217)
    127127typedef PCGVM                       PCVMCC;
    128128#else
     
    131131/** Pointer to a context specific VMCPUM derived structure.
    132132 * This is PGVMCPU in ring-0 and plain PVMCPU in ring-3. */
    133 #if defined(IN_RING0) && defined(VBOX_BUGREF_9217_PART_I)
     133#if defined(IN_RING0) && defined(VBOX_BUGREF_9217)
    134134typedef PGVMCPU                     PVMCPUCC;
    135135#else
     
    138138/** Pointer to a const context specific VMCPU derived structure.
    139139 * This is PCGVMCPU in ring-0 and plain PCVMCPU in ring-3. */
    140 #if defined(IN_RING0) && defined(VBOX_BUGREF_9217_PART_I)
     140#if defined(IN_RING0) && defined(VBOX_BUGREF_9217)
    141141typedef PCGVMCPU                    PCVMCPUCC;
    142142#else
  • trunk/include/VBox/vmm/apic.h

    r80062 r80253  
    168168
    169169/* These functions are exported as they are called from external modules (recompiler). */
    170 VMMDECL(void)               APICUpdatePendingInterrupts(PVMCPU pVCpu);
    171 VMMDECL(int)                APICGetTpr(PCVMCPU pVCpu, uint8_t *pu8Tpr, bool *pfPending, uint8_t *pu8PendingIntr);
    172 VMMDECL(int)                APICSetTpr(PVMCPU pVCpu, uint8_t u8Tpr);
     170VMMDECL(void)               APICUpdatePendingInterrupts(PVMCPUCC pVCpu);
     171VMMDECL(int)                APICGetTpr(PCVMCPUCC pVCpu, uint8_t *pu8Tpr, bool *pfPending, uint8_t *pu8PendingIntr);
     172VMMDECL(int)                APICSetTpr(PVMCPUCC pVCpu, uint8_t u8Tpr);
    173173
    174174/* These functions are VMM internal. */
    175 VMM_INT_DECL(bool)          APICIsEnabled(PCVMCPU pVCpu);
    176 VMM_INT_DECL(bool)          APICGetHighestPendingInterrupt(PVMCPU pVCpu, uint8_t *pu8PendingIntr);
    177 VMM_INT_DECL(bool)          APICQueueInterruptToService(PVMCPU pVCpu, uint8_t u8PendingIntr);
    178 VMM_INT_DECL(void)          APICDequeueInterruptFromService(PVMCPU pVCpu, uint8_t u8PendingIntr);
    179 VMM_INT_DECL(VBOXSTRICTRC)  APICReadMsr(PVMCPU pVCpu, uint32_t u32Reg, uint64_t *pu64Value);
    180 VMM_INT_DECL(VBOXSTRICTRC)  APICWriteMsr(PVMCPU pVCpu, uint32_t u32Reg, uint64_t u64Value);
    181 VMM_INT_DECL(int)           APICGetTimerFreq(PVM pVM, uint64_t *pu64Value);
    182 VMM_INT_DECL(VBOXSTRICTRC)  APICLocalInterrupt(PVMCPU pVCpu, uint8_t u8Pin, uint8_t u8Level, int rcRZ);
    183 VMM_INT_DECL(uint64_t)      APICGetBaseMsrNoCheck(PCVMCPU pVCpu);
    184 VMM_INT_DECL(VBOXSTRICTRC)  APICGetBaseMsr(PVMCPU pVCpu, uint64_t *pu64Value);
    185 VMM_INT_DECL(int)           APICSetBaseMsr(PVMCPU pVCpu, uint64_t u64BaseMsr);
    186 VMM_INT_DECL(int)           APICGetInterrupt(PVMCPU pVCpu, uint8_t *pu8Vector, uint32_t *pu32TagSrc);
     175VMM_INT_DECL(bool)          APICIsEnabled(PCVMCPUCC pVCpu);
     176VMM_INT_DECL(bool)          APICGetHighestPendingInterrupt(PVMCPUCC pVCpu, uint8_t *pu8PendingIntr);
     177VMM_INT_DECL(bool)          APICQueueInterruptToService(PVMCPUCC pVCpu, uint8_t u8PendingIntr);
     178VMM_INT_DECL(void)          APICDequeueInterruptFromService(PVMCPUCC pVCpu, uint8_t u8PendingIntr);
     179VMM_INT_DECL(VBOXSTRICTRC)  APICReadMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t *pu64Value);
     180VMM_INT_DECL(VBOXSTRICTRC)  APICWriteMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t u64Value);
     181VMM_INT_DECL(int)           APICGetTimerFreq(PVMCC pVM, uint64_t *pu64Value);
     182VMM_INT_DECL(VBOXSTRICTRC)  APICLocalInterrupt(PVMCPUCC pVCpu, uint8_t u8Pin, uint8_t u8Level, int rcRZ);
     183VMM_INT_DECL(uint64_t)      APICGetBaseMsrNoCheck(PCVMCPUCC pVCpu);
     184VMM_INT_DECL(VBOXSTRICTRC)  APICGetBaseMsr(PVMCPUCC pVCpu, uint64_t *pu64Value);
     185VMM_INT_DECL(int)           APICSetBaseMsr(PVMCPUCC pVCpu, uint64_t u64BaseMsr);
     186VMM_INT_DECL(int)           APICGetInterrupt(PVMCPUCC pVCpu, uint8_t *pu8Vector, uint32_t *pu32TagSrc);
    187187VMM_INT_DECL(int)           APICBusDeliver(PVM pVM, uint8_t uDest, uint8_t uDestMode, uint8_t uDeliveryMode, uint8_t uVector,
    188188                                           uint8_t uPolarity, uint8_t uTriggerMode, uint32_t uTagSrc);
    189 VMM_INT_DECL(int)           APICGetApicPageForCpu(PCVMCPU pVCpu, PRTHCPHYS pHCPhys, PRTR0PTR pR0Ptr, PRTR3PTR pR3Ptr);
     189VMM_INT_DECL(int)           APICGetApicPageForCpu(PCVMCPUCC pVCpu, PRTHCPHYS pHCPhys, PRTR0PTR pR0Ptr, PRTR3PTR pR3Ptr);
    190190
    191191/** @name Hyper-V interface (Ring-3 and all-context API).
     
    194194VMMR3_INT_DECL(void)        APICR3HvSetCompatMode(PVM pVM, bool fHyperVCompatMode);
    195195#endif
    196 VMM_INT_DECL(void)          APICHvSendInterrupt(PVMCPU pVCpu, uint8_t uVector, bool fAutoEoi, XAPICTRIGGERMODE enmTriggerMode);
    197 VMM_INT_DECL(VBOXSTRICTRC)  APICHvSetTpr(PVMCPU pVCpu, uint8_t uTpr);
    198 VMM_INT_DECL(uint8_t)       APICHvGetTpr(PVMCPU pVCpu);
    199 VMM_INT_DECL(VBOXSTRICTRC)  APICHvSetIcr(PVMCPU pVCpu, uint64_t uIcr);
    200 VMM_INT_DECL(uint64_t)      APICHvGetIcr(PVMCPU pVCpu);
    201 VMM_INT_DECL(VBOXSTRICTRC)  APICHvSetEoi(PVMCPU pVCpu, uint32_t uEoi);
     196VMM_INT_DECL(void)          APICHvSendInterrupt(PVMCPUCC pVCpu, uint8_t uVector, bool fAutoEoi, XAPICTRIGGERMODE enmTriggerMode);
     197VMM_INT_DECL(VBOXSTRICTRC)  APICHvSetTpr(PVMCPUCC pVCpu, uint8_t uTpr);
     198VMM_INT_DECL(uint8_t)       APICHvGetTpr(PVMCPUCC pVCpu);
     199VMM_INT_DECL(VBOXSTRICTRC)  APICHvSetIcr(PVMCPUCC pVCpu, uint64_t uIcr);
     200VMM_INT_DECL(uint64_t)      APICHvGetIcr(PVMCPUCC pVCpu);
     201VMM_INT_DECL(VBOXSTRICTRC)  APICHvSetEoi(PVMCPUCC pVCpu, uint32_t uEoi);
    202202/** @} */
    203203
  • trunk/include/VBox/vmm/cpum.h

    r80069 r80253  
    13761376VMMDECL(uint64_t)       CPUMGetGuestCR3(PCVMCPU pVCpu);
    13771377VMMDECL(uint64_t)       CPUMGetGuestCR4(PCVMCPU pVCpu);
    1378 VMMDECL(uint64_t)       CPUMGetGuestCR8(PCVMCPU pVCpu);
    1379 VMMDECL(int)            CPUMGetGuestCRx(PCVMCPU pVCpu, unsigned iReg, uint64_t *pValue);
     1378VMMDECL(uint64_t)       CPUMGetGuestCR8(PCVMCPUCC pVCpu);
     1379VMMDECL(int)            CPUMGetGuestCRx(PCVMCPUCC pVCpu, unsigned iReg, uint64_t *pValue);
    13801380VMMDECL(uint32_t)       CPUMGetGuestEFlags(PCVMCPU pVCpu);
    13811381VMMDECL(uint32_t)       CPUMGetGuestEIP(PCVMCPU pVCpu);
     
    14041404VMMDECL(uint64_t)       CPUMGetGuestDR7(PCVMCPU pVCpu);
    14051405VMMDECL(int)            CPUMGetGuestDRx(PCVMCPU pVCpu, uint32_t iReg, uint64_t *pValue);
    1406 VMMDECL(void)           CPUMGetGuestCpuId(PVMCPU pVCpu, uint32_t iLeaf, uint32_t iSubLeaf,
     1406VMMDECL(void)           CPUMGetGuestCpuId(PVMCPUCC pVCpu, uint32_t iLeaf, uint32_t iSubLeaf,
    14071407                                          uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx);
    14081408VMMDECL(uint64_t)       CPUMGetGuestEFER(PCVMCPU pVCpu);
     
    14211421VMMDECL(int)           CPUMSetGuestTR(PVMCPU pVCpu, uint16_t tr);
    14221422VMMDECL(int)           CPUMSetGuestLDTR(PVMCPU pVCpu, uint16_t ldtr);
    1423 VMMDECL(int)           CPUMSetGuestCR0(PVMCPU pVCpu, uint64_t cr0);
     1423VMMDECL(int)           CPUMSetGuestCR0(PVMCPUCC pVCpu, uint64_t cr0);
    14241424VMMDECL(int)           CPUMSetGuestCR2(PVMCPU pVCpu, uint64_t cr2);
    14251425VMMDECL(int)           CPUMSetGuestCR3(PVMCPU pVCpu, uint64_t cr3);
    14261426VMMDECL(int)           CPUMSetGuestCR4(PVMCPU pVCpu, uint64_t cr4);
    1427 VMMDECL(int)           CPUMSetGuestDR0(PVMCPU pVCpu, uint64_t uDr0);
    1428 VMMDECL(int)           CPUMSetGuestDR1(PVMCPU pVCpu, uint64_t uDr1);
    1429 VMMDECL(int)           CPUMSetGuestDR2(PVMCPU pVCpu, uint64_t uDr2);
    1430 VMMDECL(int)           CPUMSetGuestDR3(PVMCPU pVCpu, uint64_t uDr3);
     1427VMMDECL(int)           CPUMSetGuestDR0(PVMCPUCC pVCpu, uint64_t uDr0);
     1428VMMDECL(int)           CPUMSetGuestDR1(PVMCPUCC pVCpu, uint64_t uDr1);
     1429VMMDECL(int)           CPUMSetGuestDR2(PVMCPUCC pVCpu, uint64_t uDr2);
     1430VMMDECL(int)           CPUMSetGuestDR3(PVMCPUCC pVCpu, uint64_t uDr3);
    14311431VMMDECL(int)           CPUMSetGuestDR6(PVMCPU pVCpu, uint64_t uDr6);
    1432 VMMDECL(int)           CPUMSetGuestDR7(PVMCPU pVCpu, uint64_t uDr7);
    1433 VMMDECL(int)           CPUMSetGuestDRx(PVMCPU pVCpu, uint32_t iReg, uint64_t Value);
    1434 VMM_INT_DECL(int)      CPUMSetGuestXcr0(PVMCPU pVCpu, uint64_t uNewValue);
     1432VMMDECL(int)           CPUMSetGuestDR7(PVMCPUCC pVCpu, uint64_t uDr7);
     1433VMMDECL(int)           CPUMSetGuestDRx(PVMCPUCC pVCpu, uint32_t iReg, uint64_t Value);
     1434VMM_INT_DECL(int)      CPUMSetGuestXcr0(PVMCPUCC pVCpu, uint64_t uNewValue);
    14351435VMMDECL(int)           CPUMSetGuestEFlags(PVMCPU pVCpu, uint32_t eflags);
    14361436VMMDECL(int)           CPUMSetGuestEIP(PVMCPU pVCpu, uint32_t eip);
     
    14891489VMM_INT_DECL(bool)      CPUMIsGuestSvmVirtIntrEnabled(PCVMCPU pVCpu, PCCPUMCTX pCtx);
    14901490VMM_INT_DECL(uint8_t)   CPUMGetGuestSvmVirtIntrVector(PCCPUMCTX pCtx);
    1491 VMM_INT_DECL(void)      CPUMSvmVmExitRestoreHostState(PVMCPU pVCpu, PCPUMCTX pCtx);
     1491VMM_INT_DECL(void)      CPUMSvmVmExitRestoreHostState(PVMCPUCC pVCpu, PCPUMCTX pCtx);
    14921492VMM_INT_DECL(void)      CPUMSvmVmRunSaveHostState(PCPUMCTX pCtx, uint8_t cbInstr);
    14931493VMM_INT_DECL(bool)      CPUMIsSvmIoInterceptSet(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,
     
    14971497
    14981498/* VMX helpers. */
    1499 VMM_INT_DECL(bool)      CPUMIsGuestVmxVmcsFieldValid(PVM pVM, uint64_t u64VmcsField);
     1499VMM_INT_DECL(bool)      CPUMIsGuestVmxVmcsFieldValid(PVMCC pVM, uint64_t u64VmcsField);
    15001500VMM_INT_DECL(bool)      CPUMIsGuestVmxIoInterceptSet(PCVMCPU pVCpu, uint16_t u16Port, uint8_t cbAccess);
    15011501VMM_INT_DECL(bool)      CPUMIsGuestVmxMovToCr3InterceptSet(PVMCPU pVCpu, uint64_t uNewCr3);
     
    15671567    } while (0)
    15681568
    1569 VMM_INT_DECL(int) CPUMImportGuestStateOnDemand(PVMCPU pVCpu, uint64_t fExtrnImport);
     1569VMM_INT_DECL(int) CPUMImportGuestStateOnDemand(PVMCPUCC pVCpu, uint64_t fExtrnImport);
    15701570/** @} */
    15711571
     
    25142514VMMDECL(void)           CPUMSetHyperDR6(PVMCPU pVCpu, RTGCUINTREG uDr6);
    25152515VMMDECL(void)           CPUMSetHyperDR7(PVMCPU pVCpu, RTGCUINTREG uDr7);
    2516 VMMDECL(int)            CPUMRecalcHyperDRx(PVMCPU pVCpu, uint8_t iGstReg, bool fForceHyper);
     2516VMMDECL(int)            CPUMRecalcHyperDRx(PVMCPUCC pVCpu, uint8_t iGstReg, bool fForceHyper);
    25172517/** @} */
    25182518
  • trunk/include/VBox/vmm/em.h

    r80074 r80253  
    246246typedef EMEXITREC const *PCEMEXITREC;
    247247
    248 VMM_INT_DECL(PCEMEXITREC)       EMHistoryAddExit(PVMCPU pVCpu, uint32_t uFlagsAndType, uint64_t uFlatPC, uint64_t uTimestamp);
     248VMM_INT_DECL(PCEMEXITREC)       EMHistoryAddExit(PVMCPUCC pVCpu, uint32_t uFlagsAndType, uint64_t uFlatPC, uint64_t uTimestamp);
    249249#ifdef IN_RC
    250250VMMRC_INT_DECL(void)            EMRCHistoryAddExitCsEip(PVMCPU pVCpu, uint32_t uFlagsAndType, uint16_t uCs, uint32_t uEip,
     
    254254VMMR0_INT_DECL(void)            EMR0HistoryUpdatePC(PVMCPU pVCpu, uint64_t uFlatPC, bool fFlattened);
    255255#endif
    256 VMM_INT_DECL(PCEMEXITREC)       EMHistoryUpdateFlagsAndType(PVMCPU pVCpu, uint32_t uFlagsAndType);
    257 VMM_INT_DECL(PCEMEXITREC)       EMHistoryUpdateFlagsAndTypeAndPC(PVMCPU pVCpu, uint32_t uFlagsAndType, uint64_t uFlatPC);
    258 VMM_INT_DECL(VBOXSTRICTRC)      EMHistoryExec(PVMCPU pVCpu, PCEMEXITREC pExitRec, uint32_t fWillExit);
     256VMM_INT_DECL(PCEMEXITREC)       EMHistoryUpdateFlagsAndType(PVMCPUCC pVCpu, uint32_t uFlagsAndType);
     257VMM_INT_DECL(PCEMEXITREC)       EMHistoryUpdateFlagsAndTypeAndPC(PVMCPUCC pVCpu, uint32_t uFlagsAndType, uint64_t uFlatPC);
     258VMM_INT_DECL(VBOXSTRICTRC)      EMHistoryExec(PVMCPUCC pVCpu, PCEMEXITREC pExitRec, uint32_t fWillExit);
    259259
    260260
     
    269269                                                                 RTGCPTR pvFault, EMCODETYPE enmCodeType);
    270270VMM_INT_DECL(int)               EMInterpretRdpmc(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
    271 VMM_INT_DECL(int)               EMInterpretDRxWrite(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen);
     271VMM_INT_DECL(int)               EMInterpretDRxWrite(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen);
    272272VMM_INT_DECL(int)               EMInterpretDRxRead(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, uint32_t DestRegGen, uint32_t SrcRegDrx);
    273273/** @} */
  • trunk/include/VBox/vmm/gvm.h

    r78438 r80253  
    3535# include <VBox/vmm/vm.h>
    3636#endif
     37#include <VBox/param.h>
    3738#include <iprt/thread.h>
    3839#include <iprt/assertcompile.h>
     
    7374    /** Pointer to the corresponding cross context VM structure. */
    7475    PVM             pVM;
     76#else
     77    /** Pointer to the GVM structure, for CTX_SUFF use in VMMAll code.  */
     78    PGVM            pVMR0;
    7579#endif
    7680
    7781    /** Padding so gvmm starts on a 64 byte boundrary. */
    7882#ifdef VBOX_BUGREF_9217
    79     uint8_t         abPadding[HC_ARCH_BITS == 32 ? 48 : 40];
    80 #else
    81     uint8_t         abPadding[HC_ARCH_BITS == 32 ? 4*4 + 24 : 24];
     83    uint8_t         abPadding[32];
     84#else
     85    uint8_t         abPadding[24];
    8286#endif
    8387
     
    225229    /** Padding so aCpus starts on a page boundrary.  */
    226230# ifdef VBOX_WITH_NEM_R0
    227     uint8_t         abPadding2[4096 - 64 - 256 - 512 - 256 - 64];
    228 # else
    229     uint8_t         abPadding2[4096 - 64 - 256 - 512 - 64];
    230 # endif
    231 #endif
     231    uint8_t         abPadding2[4096 - 64 - 256 - 512 - 256 - 64 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
     232# else
     233    uint8_t         abPadding2[4096 - 64 - 256 - 512       - 64 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
     234# endif
     235#endif
     236    /** For simplifying CPU enumeration in VMMAll code. */
     237    PGVMCPU         apCpusR0[VMM_MAX_CPU_COUNT];
    232238
    233239    /** GVMCPU array for the configured number of virtual CPUs. */
     
    249255AssertCompileMemberOffset(GVM, nem,         64 + 256 + 512);
    250256AssertCompileMemberOffset(GVM, rawpci,      64 + 256 + 512 + 256);
    251 AssertCompileMemberOffset(GVM, aCpus,       64 + 256 + 512 + 256 + 64);
     257AssertCompileMemberOffset(GVM, aCpus,       64 + 256 + 512 + 256 + 64 + sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT);
    252258# else
    253259AssertCompileMemberOffset(GVM, rawpci,      64 + 256 + 512);
    254 AssertCompileMemberOffset(GVM, aCpus,       64 + 256 + 512 + 64);
     260AssertCompileMemberOffset(GVM, aCpus,       64 + 256 + 512 + 64 + sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT);
    255261# endif
    256262#endif
  • trunk/include/VBox/vmm/pdmdev.h

    r80153 r80253  
    34483448     * @param   pDevIns             The device instance.
    34493449     */
    3450     DECLR3CALLBACKMEMBER(PVM, pfnGetVM,(PPDMDEVINS pDevIns));
     3450    DECLR3CALLBACKMEMBER(PVMCC, pfnGetVM,(PPDMDEVINS pDevIns));
    34513451
    34523452    /**
     
    38153815     * @param   pDevIns         Device instance.
    38163816     */
    3817     DECLRCCALLBACKMEMBER(PVM, pfnGetVM,(PPDMDEVINS pDevIns));
     3817    DECLRCCALLBACKMEMBER(PVMCC, pfnGetVM,(PPDMDEVINS pDevIns));
    38183818
    38193819    /**
     
    38233823     * @param   pDevIns             The device instance.
    38243824     */
    3825     DECLRCCALLBACKMEMBER(PVMCPU, pfnGetVMCPU,(PPDMDEVINS pDevIns));
     3825    DECLRCCALLBACKMEMBER(PVMCPUCC, pfnGetVMCPU,(PPDMDEVINS pDevIns));
    38263826
    38273827    /**
     
    40764076     * @param   pDevIns         Device instance.
    40774077     */
    4078     DECLR0CALLBACKMEMBER(PVM, pfnGetVM,(PPDMDEVINS pDevIns));
     4078    DECLR0CALLBACKMEMBER(PVMCC, pfnGetVM,(PPDMDEVINS pDevIns));
    40794079
    40804080    /**
     
    40844084     * @param   pDevIns             The device instance.
    40854085     */
    4086     DECLR0CALLBACKMEMBER(PVMCPU, pfnGetVMCPU,(PPDMDEVINS pDevIns));
     4086    DECLR0CALLBACKMEMBER(PVMCPUCC, pfnGetVMCPU,(PPDMDEVINS pDevIns));
    40874087
    40884088    /**
     
    54055405 * @copydoc PDMDEVHLPR3::pfnGetVM
    54065406 */
    5407 DECLINLINE(PVM) PDMDevHlpGetVM(PPDMDEVINS pDevIns)
     5407DECLINLINE(PVMCC) PDMDevHlpGetVM(PPDMDEVINS pDevIns)
    54085408{
    54095409    return pDevIns->CTX_SUFF(pHlp)->pfnGetVM(pDevIns);
     
    54135413 * @copydoc PDMDEVHLPR3::pfnGetVMCPU
    54145414 */
    5415 DECLINLINE(PVMCPU) PDMDevHlpGetVMCPU(PPDMDEVINS pDevIns)
     5415DECLINLINE(PVMCPUCC) PDMDevHlpGetVMCPU(PPDMDEVINS pDevIns)
    54165416{
    54175417    return pDevIns->CTX_SUFF(pHlp)->pfnGetVMCPU(pDevIns);
  • trunk/include/VBox/vmm/vm.h

    r80191 r80253  
    149149    /** Ring-3 Host Context VM Pointer. */
    150150    PVMR3                   pVMR3;
     151#ifndef VBOX_BUGREF_9217
    151152    /** Ring-0 Host Context VM Pointer. */
    152153    PVMR0                   pVMR0;
     154#else
     155    RTR0PTR                 R0PtrUnused1;
     156#endif
    153157    /** Raw-mode Context VM Pointer. */
    154158    uint32_t                pVMRC;
     
    14311435    /** Padding for aligning the structure size on a page boundrary. */
    14321436#ifdef VBOX_WITH_REM
    1433     uint8_t         abAlignment2[2520];
    1434 #else
    1435     uint8_t         abAlignment2[2520 + 256];
     1437    uint8_t         abAlignment2[2520       - sizeof(PVMCPUR0) * VMM_MAX_CPU_COUNT];
     1438#else
     1439    uint8_t         abAlignment2[2520 + 256 - sizeof(PVMCPUR0) * VMM_MAX_CPU_COUNT];
    14361440#endif
    14371441
    14381442    /* ---- end small stuff ---- */
    1439 
    1440     /** Array of VMCPU pointers. */
     1443#if !defined(VBOX_BUGREF_9217)
     1444    /** Array of VMCPU ring-0 pointers.  This is temporary as these will
     1445     * live in GVM. */
     1446    PVMCPUR0        apCpusR0[VMM_MAX_CPU_COUNT];
     1447#else
     1448    PVMCPUR0        apPaddingR0[VMM_MAX_CPU_COUNT];
     1449#endif
     1450
     1451    /** Array of VMCPU ring-3 pointers. */
    14411452    PVMCPUR3        apCpusR3[VMM_MAX_CPU_COUNT];
    14421453#if !defined(VBOX_BUGREF_9217) && !defined(VBOX_BUGREF_9217_PART_I)
  • trunk/include/VBox/vmm/vm.mac

    r80135 r80253  
    2828
    2929%include "VBox/vmm/stam.mac"
     30%include "VBox/param.mac"
    3031
    3132;/** This action forces the VM to service check and pending interrups on the APIC. */
     
    139140    .vm                     resb 32
    140141    .cfgm                   resb 8
     142
     143%ifdef VBOX_WITH_REM
     144    .abAlignment2           resb 2520       - RTR0PTR_CB * VMM_MAX_CPU_COUNT
     145%else                       
     146    .abAlignment2           resb 2520 + 256 - RTR0PTR_CB * VMM_MAX_CPU_COUNT
     147%endif
     148
     149    alignb RTR0PTR_CB * VMM_MAX_CPU_COUNT ; ASSUMES VMM_MAX_CPU_COUNT is a power of two.
     150%ifndef VBOX_BUGREF_9217
     151    .apCpusR0               RTR0PTR_RES VMM_MAX_CPU_COUNT
     152%else
     153    .apPaddingR0            RTR0PTR_RES VMM_MAX_CPU_COUNT
     154%endif
     155    .apCpusR3               RTR3PTR_RES VMM_MAX_CPU_COUNT
     156%ifndef VBOX_BUGREF_9217
     157 %ifndef VBOX_BUGREF_9217_PART_I
    141158    alignb 4096
    142159    .aCpus                  resb VMCPU_size
     160 %endif
     161%endif
     162
    143163endstruc
    144164
  • trunk/include/VBox/vmm/vmcc.h

    r80239 r80253  
    5252#endif
    5353
     54/** @def VMCC_FOR_EACH_VMCPU
     55 * For enumerating VCpus in ascending order, avoiding unnecessary apCpusR0
     56 * access in ring-0.
     57 * @note Close loop with VMCC_FOR_EACH_VMCPU_END. */
     58#ifdef IN_RING0
     59# define VMCC_FOR_EACH_VMCPU(a_pVM) \
     60            for (VMCPUID idCpu = 0; idCpu < (a_pVM)->cCpus; idCpu++) \
     61            { \
     62                PVMCPU pVCpu = &(a_pVM)->aCpus[idCpu];
     63#else
     64# define VMCC_FOR_EACH_VMCPU(a_pVM) \
     65            for (VMCPUID idCpu = 0; idCpu < (a_pVM)->cCpus; idCpu++) \
     66            { \
     67                PVMCPU pVCpu = (a_pVM)->apCpusR3[idCpu];
     68#endif
     69/** Ends a VMCC_FOR_EACH_VMCPU loop. */
     70#define VMCC_FOR_EACH_VMCPU_END() } do { } while (0)
     71
     72
    5473#endif /* !VBOX_INCLUDED_vmm_vmcc_h */
    5574
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