VirtualBox

Changeset 4958 in vbox


Ignore:
Timestamp:
Sep 21, 2007 2:54:04 PM (17 years ago)
Author:
vboxsync
Message:

Added hSelf and removed pVMHC from the VM structure.

Location:
trunk
Files:
8 edited

Legend:

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

    r4787 r4958  
    235235     */
    236236    R3PTRTYPE(struct VM *)      pNext;
    237     /** Host Context VM Pointer.
    238      * @obsolete don't use in new code! */
    239     R3PTRTYPE(struct VM *)      pVMHC;
    240237    /** Ring-3 Host Context VM Pointer. */
    241238    R3PTRTYPE(struct VM *)      pVMR3;
     
    244241    /** Guest Context VM Pointer. */
    245242    GCPTRTYPE(struct VM *)      pVMGC;
     243
     244    /** The GVM VM handle. Only the GVM should modify this field. */
     245    uint32_t                    hSelf;
     246    /** Reserved / padding. */
     247    uint32_t                    u32Reserved;
    246248
    247249    /** @name Public VMM Switcher APIs
     
    317319
    318320    /* padding to make gnuc put the StatQemuToGC where msc does. */
    319 /*#if HC_ARCH_BITS == 32
     321#if HC_ARCH_BITS == 32
    320322    uint32_t            padding0;
    321 #endif */
     323#endif
    322324
    323325    /** Profiling the total time from Qemu to GC. */
     
    346348
    347349    /* padding - the unions must be aligned on 32 bytes boundraries. */
    348     uint32_t            padding[HC_ARCH_BITS == 32 ? 6 : 6];
     350    uint32_t            padding[HC_ARCH_BITS == 32 ? 4 : 6];
    349351
    350352    /** CPUM part. */
  • trunk/include/VBox/vm.mac

    r4071 r4958  
    3838    .pSession           RTR3PTR_RES 1
    3939    .pNext              RTHCPTR_RES 1
    40     .pVMHC              RTHCPTR_RES 1
    4140    .pVMR3              RTR3PTR_RES 1
    4241    .pVMR0              RTR0PTR_RES 1
    4342    .pVMGC              RTGCPTR_RES 1
     43    .hSelf              resd 1
     44    .u32Reserved        resd 1
    4445
    4546    .pfnVMMGCGuestToHostAsmGuestCtx RTGCPTR_RES 1
  • trunk/src/VBox/VMM/CPUM.cpp

    r4953 r4958  
    9999    pVM->cpum.s.offVM = RT_OFFSETOF(VM, cpum);
    100100    pVM->cpum.s.pCPUMHC = &pVM->cpum.s;
    101     pVM->cpum.s.pHyperCoreHC = CPUMCTX2CORE(&pVM->cpum.s.Hyper);
     101    pVM->cpum.s.pHyperCoreR3 = CPUMCTX2CORE(&pVM->cpum.s.Hyper);
     102    pVM->cpum.s.pHyperCoreR0 = VM_R0_ADDR(pVM, CPUMCTX2CORE(&pVM->cpum.s.Hyper));
    102103
    103104    /* Hidden selector registers are invalid by default. */
     
    399400     */
    400401    pVM->cpum.s.pCPUMGC = VM_GUEST_ADDR(pVM, &pVM->cpum.s);
    401     pVM->cpum.s.pHyperCoreGC = MMHyperHC2GC(pVM, pVM->cpum.s.pHyperCoreHC);
     402    pVM->cpum.s.pHyperCoreGC = MMHyperCCToGC(pVM, pVM->cpum.s.pHyperCoreR3);
     403    Assert(pVM->cpum.s.pHyperCoreGC != NIL_RTGCPTR);
    402404}
    403405
     
    857859    cpumR3InfoParseArg(pszArgs, &enmType, &pszComment);
    858860    pHlp->pfnPrintf(pHlp, "Hypervisor CPUM state: %s\n", pszComment);
    859     cpumR3InfoOne(&pVM->cpum.s.Hyper, pVM->cpum.s.pHyperCoreHC, pHlp, enmType, ".");
     861    cpumR3InfoOne(&pVM->cpum.s.Hyper, pVM->cpum.s.pHyperCoreR3, pHlp, enmType, ".");
    860862    pHlp->pfnPrintf(pHlp, "CR4OrMask=%#x CR4AndMask=%#x\n", pVM->cpum.s.CR4.OrMask, pVM->cpum.s.CR4.AndMask);
    861863}
  • trunk/src/VBox/VMM/CPUMInternal.h

    r4787 r4958  
    284284
    285285
    286     /** Pointer to the current hypervisor core context - HCPtr. */
    287     R3R0PTRTYPE(PCPUMCTXCORE) pHyperCoreHC;
     286    /** Pointer to the current hypervisor core context - R3Ptr. */
     287    R3PTRTYPE(PCPUMCTXCORE) pHyperCoreR3;
     288    /** Pointer to the current hypervisor core context - R3Ptr. */
     289    R0PTRTYPE(PCPUMCTXCORE) pHyperCoreR0;
    288290    /** Pointer to the current hypervisor core context - GCPtr. */
    289291    GCPTRTYPE(PCPUMCTXCORE) pHyperCoreGC;
     
    324326    /** Have we entered rawmode? */
    325327    bool                    fRawEntered;
    326     uint8_t                 abPadding[3 + (HC_ARCH_BITS == 32) * 4];
     328    uint8_t                 abPadding[3 + (HC_ARCH_BITS == 64) * 4];
    327329
    328330    /** The standard set of CpuId leafs. */
  • trunk/src/VBox/VMM/CPUMInternal.mac

    r4071 r4958  
    357357    alignb 32
    358358    ; hypervisor core context.
    359     .pHyperCoreHC         RTHCPTR_RES 1
     359    .pHyperCoreR3         RTR3PTR_RES 1
     360    .pHyperCoreR0         RTR0PTR_RES 1
    360361    .pHyperCoreGC         RTGCPTR_RES 1
    361362    ;...
     
    373374    .fRawEntered          resb    1
    374375%if RTHCPTR_CB == 8
     376    .abPadding            resb    7
     377%else
    375378    .abPadding            resb    3
    376 %else
    377     .abPadding            resb    7
    378379%endif
    379380
  • trunk/src/VBox/VMM/TM.cpp

    r4787 r4958  
    672672    {
    673673        pTimer->pVMGC = pVM->pVMGC;
    674         pTimer->pVMR0 = (PVMR0)pVM->pVMHC; /// @todo pTimer->pVMR0 = pVM->pVMR0;
     674        pTimer->pVMR0 = pVM->pVMR0;
    675675    }
    676676}
  • trunk/src/VBox/VMM/VM.cpp

    r4900 r4958  
    198198             */
    199199            memset(pVM, 0, sizeof(*pVM));
    200             pVM->pVMHC = pVM;
    201200            pVM->pVMR0 = pVMR0;
    202201            pVM->pVMR3 = pVM;
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r4208 r4958  
    5454CPUMDECL(void) CPUMHyperSetCtxCore(PVM pVM, PCPUMCTXCORE pCtxCore)
    5555{
    56     LogFlow(("CPUMHyperSetCtxCore: %p -> %p\n", pVM->cpum.s.CTXSUFF(pHyperCore), pCtxCore));
     56    LogFlow(("CPUMHyperSetCtxCore: %p/%p/%p -> %p\n", pVM->cpum.s.CTXALLSUFF(pHyperCore), pCtxCore));
    5757    if (!pCtxCore)
    5858    {
    5959        pCtxCore = CPUMCTX2CORE(&pVM->cpum.s.Hyper);
    60 #ifdef IN_GC
    61         pVM->cpum.s.pHyperCoreHC = VM_HOST_ADDR(pVM, pCtxCore);
    62 #else
    63         pVM->cpum.s.pHyperCoreGC = VM_GUEST_ADDR(pVM, pCtxCore);
    64 #endif
     60        pVM->cpum.s.pHyperCoreR3 = (R3PTRTYPE(PCPUMCTXCORE))VM_R3_ADDR(pVM, pCtxCore);
     61        pVM->cpum.s.pHyperCoreR0 = (R0PTRTYPE(PCPUMCTXCORE))VM_R0_ADDR(pVM, pCtxCore);
     62        pVM->cpum.s.pHyperCoreGC = (GCPTRTYPE(PCPUMCTXCORE))VM_GUEST_ADDR(pVM, pCtxCore);
    6563    }
    6664    else
    6765    {
    68 #ifdef IN_GC
    69         pVM->cpum.s.pHyperCoreHC = MMHyperGC2HC(pVM, pCtxCore);
    70 #else
    71         pVM->cpum.s.pHyperCoreGC = MMHyperHC2GC(pVM, pCtxCore);
    72 #endif
     66        pVM->cpum.s.pHyperCoreR3 = (R3PTRTYPE(PCPUMCTXCORE))MMHyperCCToR3(pVM, pCtxCore);
     67        pVM->cpum.s.pHyperCoreR0 = (R0PTRTYPE(PCPUMCTXCORE))MMHyperCCToR0(pVM, pCtxCore);
     68        pVM->cpum.s.pHyperCoreGC = (GCPTRTYPE(PCPUMCTXCORE))MMHyperCCToGC(pVM, pCtxCore);
    7369    }
    74     pVM->cpum.s.CTXSUFF(pHyperCore) = pCtxCore;
    7570}
    7671
     
    8479CPUMDECL(PCCPUMCTXCORE) CPUMGetHyperCtxCore(PVM pVM)
    8580{
    86     return pVM->cpum.s.CTXSUFF(pHyperCore);
     81    return pVM->cpum.s.CTXALLSUFF(pHyperCore);
    8782}
    8883
     
    129124CPUMDECL(void) CPUMSetHyperCS(PVM pVM, RTSEL SelCS)
    130125{
    131     pVM->cpum.s.CTXSUFF(pHyperCore)->cs = SelCS;
     126    pVM->cpum.s.CTXALLSUFF(pHyperCore)->cs = SelCS;
    132127}
    133128
    134129CPUMDECL(void) CPUMSetHyperDS(PVM pVM, RTSEL SelDS)
    135130{
    136     pVM->cpum.s.CTXSUFF(pHyperCore)->ds = SelDS;
     131    pVM->cpum.s.CTXALLSUFF(pHyperCore)->ds = SelDS;
    137132}
    138133
    139134CPUMDECL(void) CPUMSetHyperES(PVM pVM, RTSEL SelES)
    140135{
    141     pVM->cpum.s.CTXSUFF(pHyperCore)->es = SelES;
     136    pVM->cpum.s.CTXALLSUFF(pHyperCore)->es = SelES;
    142137}
    143138
    144139CPUMDECL(void) CPUMSetHyperFS(PVM pVM, RTSEL SelFS)
    145140{
    146     pVM->cpum.s.CTXSUFF(pHyperCore)->fs = SelFS;
     141    pVM->cpum.s.CTXALLSUFF(pHyperCore)->fs = SelFS;
    147142}
    148143
    149144CPUMDECL(void) CPUMSetHyperGS(PVM pVM, RTSEL SelGS)
    150145{
    151     pVM->cpum.s.CTXSUFF(pHyperCore)->gs = SelGS;
     146    pVM->cpum.s.CTXALLSUFF(pHyperCore)->gs = SelGS;
    152147}
    153148
    154149CPUMDECL(void) CPUMSetHyperSS(PVM pVM, RTSEL SelSS)
    155150{
    156     pVM->cpum.s.CTXSUFF(pHyperCore)->ss = SelSS;
     151    pVM->cpum.s.CTXALLSUFF(pHyperCore)->ss = SelSS;
    157152}
    158153
    159154CPUMDECL(void) CPUMSetHyperESP(PVM pVM, uint32_t u32ESP)
    160155{
    161     pVM->cpum.s.CTXSUFF(pHyperCore)->esp = u32ESP;
     156    pVM->cpum.s.CTXALLSUFF(pHyperCore)->esp = u32ESP;
    162157}
    163158
    164159CPUMDECL(int) CPUMSetHyperEFlags(PVM pVM, uint32_t Efl)
    165160{
    166     pVM->cpum.s.CTXSUFF(pHyperCore)->eflags.u32 = Efl;
     161    pVM->cpum.s.CTXALLSUFF(pHyperCore)->eflags.u32 = Efl;
    167162    return VINF_SUCCESS;
    168163}
     
    170165CPUMDECL(void) CPUMSetHyperEIP(PVM pVM, uint32_t u32EIP)
    171166{
    172     pVM->cpum.s.CTXSUFF(pHyperCore)->eip = u32EIP;
     167    pVM->cpum.s.CTXALLSUFF(pHyperCore)->eip = u32EIP;
    173168}
    174169
     
    222217CPUMDECL(RTSEL) CPUMGetHyperCS(PVM pVM)
    223218{
    224     return pVM->cpum.s.CTXSUFF(pHyperCore)->cs;
     219    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->cs;
    225220}
    226221
    227222CPUMDECL(RTSEL) CPUMGetHyperDS(PVM pVM)
    228223{
    229     return pVM->cpum.s.CTXSUFF(pHyperCore)->ds;
     224    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ds;
    230225}
    231226
    232227CPUMDECL(RTSEL) CPUMGetHyperES(PVM pVM)
    233228{
    234     return pVM->cpum.s.CTXSUFF(pHyperCore)->es;
     229    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->es;
    235230}
    236231
    237232CPUMDECL(RTSEL) CPUMGetHyperFS(PVM pVM)
    238233{
    239     return pVM->cpum.s.CTXSUFF(pHyperCore)->fs;
     234    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->fs;
    240235}
    241236
    242237CPUMDECL(RTSEL) CPUMGetHyperGS(PVM pVM)
    243238{
    244     return pVM->cpum.s.CTXSUFF(pHyperCore)->gs;
     239    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->gs;
    245240}
    246241
    247242CPUMDECL(RTSEL) CPUMGetHyperSS(PVM pVM)
    248243{
    249     return pVM->cpum.s.CTXSUFF(pHyperCore)->ss;
     244    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ss;
    250245}
    251246
     
    276271CPUMDECL(uint32_t) CPUMGetHyperEAX(PVM pVM)
    277272{
    278     return pVM->cpum.s.CTXSUFF(pHyperCore)->eax;
     273    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->eax;
    279274}
    280275
    281276CPUMDECL(uint32_t) CPUMGetHyperEBX(PVM pVM)
    282277{
    283     return pVM->cpum.s.CTXSUFF(pHyperCore)->ebx;
     278    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ebx;
    284279}
    285280
    286281CPUMDECL(uint32_t) CPUMGetHyperECX(PVM pVM)
    287282{
    288     return pVM->cpum.s.CTXSUFF(pHyperCore)->ecx;
     283    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ecx;
    289284}
    290285
    291286CPUMDECL(uint32_t) CPUMGetHyperEDX(PVM pVM)
    292287{
    293     return pVM->cpum.s.CTXSUFF(pHyperCore)->edx;
     288    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->edx;
    294289}
    295290
    296291CPUMDECL(uint32_t) CPUMGetHyperESI(PVM pVM)
    297292{
    298     return pVM->cpum.s.CTXSUFF(pHyperCore)->esi;
     293    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->esi;
    299294}
    300295
    301296CPUMDECL(uint32_t) CPUMGetHyperEDI(PVM pVM)
    302297{
    303     return pVM->cpum.s.CTXSUFF(pHyperCore)->edi;
     298    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->edi;
    304299}
    305300
    306301CPUMDECL(uint32_t) CPUMGetHyperEBP(PVM pVM)
    307302{
    308     return pVM->cpum.s.CTXSUFF(pHyperCore)->ebp;
     303    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->ebp;
    309304}
    310305
    311306CPUMDECL(uint32_t) CPUMGetHyperESP(PVM pVM)
    312307{
    313     return pVM->cpum.s.CTXSUFF(pHyperCore)->esp;
     308    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->esp;
    314309}
    315310
    316311CPUMDECL(uint32_t) CPUMGetHyperEFlags(PVM pVM)
    317312{
    318     return pVM->cpum.s.CTXSUFF(pHyperCore)->eflags.u32;
     313    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->eflags.u32;
    319314}
    320315
    321316CPUMDECL(uint32_t) CPUMGetHyperEIP(PVM pVM)
    322317{
    323     return pVM->cpum.s.CTXSUFF(pHyperCore)->eip;
     318    return pVM->cpum.s.CTXALLSUFF(pHyperCore)->eip;
    324319}
    325320
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