VirtualBox

Changeset 79995 in vbox


Ignore:
Timestamp:
Jul 26, 2019 10:04:11 AM (5 years ago)
Author:
vboxsync
Message:

VMM: Started kicking out raw-mode and 32-bit host code. bugref:9517 bugref:9511

Location:
trunk
Files:
6 edited

Legend:

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

    r79165 r79995  
    12011201
    12021202#ifdef VBOX_BUGREF_9217
    1203     /** Structure version number (TBD). */
    1204     uint32_t                    uStructVersion;
    12051203    /** Size of the VM structure. */
    12061204    uint32_t                    cbSelf;
    12071205    /** Size of the VMCPU structure. */
    12081206    uint32_t                    cbVCpu;
     1207    /** Structure version number (TBD). */
     1208    uint32_t                    uStructVersion;
    12091209#else
    12101210    /** Size of the VM structure including the VMCPU array. */
    12111211    uint32_t                    cbSelf;
    1212 #endif
    1213 
    1214 #ifdef VBOX_WITH_RAW_MODE
    1215     /** Offset to the VMCPU array starting from beginning of this structure,
    1216      * for raw-mode assembly code. */
    1217     uint32_t                    offVMCPU;
    1218 #else
    1219     uint32_t                    u32Unused;
    1220 #endif
    1221 
    1222     /**
    1223      * VMMSwitcher assembly entry point returning to host context.
    1224      *
    1225      * Depending on how the host handles the rc status given in @a eax, this may
    1226      * return and let the caller resume whatever it was doing prior to the call.
    1227      *
    1228      * @param   eax         The return code, register.
    1229      * @remark  Assume interrupts disabled.
    1230      * @remark  This method pointer lives here because TRPM needs it.
    1231      */
    1232     RTRCPTR                     pfnVMMRCToHostAsm/*(int32_t eax)*/;
    1233 
    1234     /**
    1235      * VMMSwitcher assembly entry point returning to host context without saving the
    1236      * raw-mode context (hyper) registers.
    1237      *
    1238      * Unlike pfnVMMRC2HCAsm, this will not return to the caller.  Instead it
    1239      * expects the caller to save a RC context in CPUM where one might return if the
    1240      * return code indicate that this is possible.
    1241      *
    1242      * This method pointer lives here because TRPM needs it.
    1243      *
    1244      * @param   eax         The return code, register.
    1245      * @remark  Assume interrupts disabled.
    1246      * @remark  This method pointer lives here because TRPM needs it.
    1247      */
    1248     RTRCPTR                     pfnVMMRCToHostAsmNoReturn/*(int32_t eax)*/;
     1212    uint32_t                    uUnused0;
     1213    uint32_t                    uUnused1;
     1214#endif
    12491215
    12501216    /** @name Various items that are frequently accessed.
     
    12981264    /** @name Debugging
    12991265     * @{ */
    1300     /** Raw-mode Context VM Pointer. */
    1301     RCPTRTYPE(RTTRACEBUF)       hTraceBufRC;
    13021266    /** Ring-3 Host Context VM Pointer. */
    13031267    R3PTRTYPE(RTTRACEBUF)       hTraceBufR3;
     
    13061270    /** @} */
    13071271
    1308 #if HC_ARCH_BITS == 32
    1309     /** Alignment padding. */
    1310     uint32_t                    uPadding2;
    1311 #endif
    1312 
    1313     /** @name Switcher statistics (remove)
    1314      * @{ */
    1315     /** Profiling the total time from Qemu to GC. */
    1316     STAMPROFILEADV              StatTotalQemuToGC;
    1317     /** Profiling the total time from GC to Qemu. */
    1318     STAMPROFILEADV              StatTotalGCToQemu;
    1319     /** Profiling the total time spent in GC. */
    1320     STAMPROFILEADV              StatTotalInGC;
    1321     /** Profiling the total time spent not in Qemu. */
    1322     STAMPROFILEADV              StatTotalInQemu;
    1323     /** Profiling the VMMSwitcher code for going to GC. */
    1324     STAMPROFILEADV              StatSwitcherToGC;
    1325     /** Profiling the VMMSwitcher code for going to HC. */
    1326     STAMPROFILEADV              StatSwitcherToHC;
    1327     STAMPROFILEADV              StatSwitcherSaveRegs;
    1328     STAMPROFILEADV              StatSwitcherSysEnter;
    1329     STAMPROFILEADV              StatSwitcherDebug;
    1330     STAMPROFILEADV              StatSwitcherCR0;
    1331     STAMPROFILEADV              StatSwitcherCR4;
    1332     STAMPROFILEADV              StatSwitcherJmpCR3;
    1333     STAMPROFILEADV              StatSwitcherRstrRegs;
    1334     STAMPROFILEADV              StatSwitcherLgdt;
    1335     STAMPROFILEADV              StatSwitcherLidt;
    1336     STAMPROFILEADV              StatSwitcherLldt;
    1337     STAMPROFILEADV              StatSwitcherTSS;
    1338     /** @} */
    1339 
    1340     /** Padding - the unions must be aligned on a 64 bytes boundary and the unions
    1341      *  must start at the same offset on both 64-bit and 32-bit hosts. */
    1342 #ifdef VBOX_BUGREF_9217
    1343     uint8_t                     abAlignment3[(HC_ARCH_BITS == 32 ? 24 : 0) + 32];
    1344 #else
    1345     uint8_t                     abAlignment3[(HC_ARCH_BITS == 32 ? 24 : 0) + 40];
    1346 #endif
     1272    /** Padding - the unions must be aligned on a 64 bytes boundary. */
     1273    uint8_t                     abAlignment3[24];
    13471274
    13481275    /** CPUM part. */
     
    15201447    } ftm;
    15211448
    1522 #ifdef VBOX_WITH_RAW_MODE
    1523     /** PATM part. */
    1524     union
    1525     {
    1526 # ifdef VMM_INCLUDED_SRC_include_PATMInternal_h
    1527         struct PATM s;
    1528 # endif
    1529         uint8_t     padding[768];       /* multiple of 64 */
    1530     } patm;
    1531 
    1532     /** CSAM part. */
    1533     union
    1534     {
    1535 # ifdef VMM_INCLUDED_SRC_include_CSAMInternal_h
    1536         struct CSAM s;
    1537 # endif
    1538         uint8_t     padding[1088];      /* multiple of 64 */
    1539     } csam;
    1540 #endif
    1541 
    15421449#ifdef VBOX_WITH_REM
    15431450    /** REM part. */
     
    15891496#ifdef VBOX_BUGREF_9217
    15901497    /** Padding for aligning the structure size on a page boundrary. */
    1591 # if defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE)
    1592     uint8_t         abAlignment2[3670 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    1593 # elif defined(VBOX_WITH_REM) && !defined(VBOX_WITH_RAW_MODE)
    1594     uint8_t         abAlignment2[1430 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    1595 # elif !defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE)
    1596     uint8_t         abAlignment2[3926 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
     1498# ifdef VBOX_WITH_REM
     1499    uint8_t         abAlignment2[2134 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    15971500# else
    1598     uint8_t         abAlignment2[1686 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
     1501    uint8_t         abAlignment2[2390 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    15991502# endif
    16001503#else
    16011504    /** Padding for aligning the cpu array on a page boundary. */
    1602 # if defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE)
    1603     uint8_t         abAlignment2[3670];
    1604 # elif defined(VBOX_WITH_REM) && !defined(VBOX_WITH_RAW_MODE)
    1605     uint8_t         abAlignment2[1430];
    1606 # elif !defined(VBOX_WITH_REM) && defined(VBOX_WITH_RAW_MODE)
    1607     uint8_t         abAlignment2[3926];
     1505# ifdef VBOX_WITH_REM
     1506    uint8_t         abAlignment2[2134];
    16081507# else
    1609     uint8_t         abAlignment2[1686];
     1508    uint8_t         abAlignment2[2390];
    16101509# endif
    16111510#endif
  • trunk/include/VBox/vmm/vm.mac

    r78433 r79995  
    101101    .uCpuExecutionCap       resd 1
    102102    .cbSelf                 resd 1
    103 %ifdef VBOX_WITH_RAW_MODE
    104     .offVMCPU               resd 1
     103%ifdef VBOX_BUGREF_9217
     104    .cbVCpu                 resd 1
     105    .uStructVersion         resd 1
    105106%else
    106     .u32Unused              resd 1
     107    .uUnused0               resd 1
     108    .uUnused1               resd 1
    107109%endif
    108     .pfnVMMRCToHostAsm      resd 1
    109     .pfnVMMRCToHostAsmNoReturn resd 1
    110110    .bMainExecutionEngine   resb 1
    111111    .fRecompileUser         resb 1
     
    121121    .uPadding1              resb 2
    122122
    123     .hTraceBufRC            RTRCPTR_RES 1
    124123    .hTraceBufR3            RTR3PTR_RES 1
    125124    .hTraceBufR0            RTR0PTR_RES 1
    126 
    127     alignb 8
    128 
    129     .StatTotalQemuToGC      resb STAMPROFILEADV_size
    130     .StatTotalGCToQemu      resb STAMPROFILEADV_size
    131     .StatTotalInGC          resb STAMPROFILEADV_size
    132     .StatTotalInQemu        resb STAMPROFILEADV_size
    133     .StatSwitcherToGC       resb STAMPROFILEADV_size
    134     .StatSwitcherToHC       resb STAMPROFILEADV_size
    135     .StatSwitcherSaveRegs   resb STAMPROFILEADV_size
    136     .StatSwitcherSysEnter   resb STAMPROFILEADV_size
    137     .StatSwitcherDebug      resb STAMPROFILEADV_size
    138     .StatSwitcherCR0        resb STAMPROFILEADV_size
    139     .StatSwitcherCR4        resb STAMPROFILEADV_size
    140     .StatSwitcherJmpCR3     resb STAMPROFILEADV_size
    141     .StatSwitcherRstrRegs   resb STAMPROFILEADV_size
    142     .StatSwitcherLgdt       resb STAMPROFILEADV_size
    143     .StatSwitcherLidt       resb STAMPROFILEADV_size
    144     .StatSwitcherLldt       resb STAMPROFILEADV_size
    145     .StatSwitcherTSS        resb STAMPROFILEADV_size
    146 
    147 %ifndef HC_ARCH_BITS
    148  %error "Missing HC_ARCH_BITS"
    149 %endif
    150 %if HC_ARCH_BITS == 32
    151     .abAlignment3           resb 16
    152 %else
    153 ;    .abAlignment3           resb 16
    154 %endif
    155125
    156126    alignb 64
     
    170140    .ssm                    resb 128
    171141    .ftm                    resb 512
    172 %ifdef VBOX_WITH_RAW_MODE
    173     .patm                   resb 768
    174     .csam                   resb 1088
    175 %endif
    176142%ifdef VBOX_WITH_REM
    177143    .rem                    resb 0x11100
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Trace.cpp

    r76553 r79995  
    128128    pVM->hTraceBufR3 = hTraceBuf;
    129129    pVM->hTraceBufR0 = MMHyperCCToR0(pVM, hTraceBuf);
    130     pVM->hTraceBufRC = MMHyperCCToRC(pVM, hTraceBuf);
    131130    return VINF_SUCCESS;
    132131}
     
    146145    Assert(NIL_RTTRACEBUF == (RTTRACEBUF)NULL);
    147146    pVM->hTraceBufR3 = NIL_RTTRACEBUF;
    148     pVM->hTraceBufRC = NIL_RTRCPTR;
    149147    pVM->hTraceBufR0 = NIL_RTR0PTR;
    150148
     
    218216void dbgfR3TraceRelocate(PVM pVM)
    219217{
    220     if (pVM->hTraceBufR3 != NIL_RTTRACEBUF)
    221         pVM->hTraceBufRC = MMHyperCCToRC(pVM, pVM->hTraceBufR3);
     218    RT_NOREF(pVM);
    222219}
    223220
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r78431 r79995  
    864864     * Register statistics.
    865865     */
    866     STAM_REG(pVM, &pVM->StatTotalInGC,          STAMTYPE_PROFILE_ADV, "/PROF/VM/InGC",          STAMUNIT_TICKS_PER_CALL,    "Profiling the total time spent in GC.");
    867     STAM_REG(pVM, &pVM->StatSwitcherToGC,       STAMTYPE_PROFILE_ADV, "/PROF/VM/SwitchToGC",    STAMUNIT_TICKS_PER_CALL,    "Profiling switching to GC.");
    868     STAM_REG(pVM, &pVM->StatSwitcherToHC,       STAMTYPE_PROFILE_ADV, "/PROF/VM/SwitchToHC",    STAMUNIT_TICKS_PER_CALL,    "Profiling switching to HC.");
    869     STAM_REG(pVM, &pVM->StatSwitcherSaveRegs,   STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/SaveRegs", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");
    870     STAM_REG(pVM, &pVM->StatSwitcherSysEnter,   STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/SysEnter", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");
    871     STAM_REG(pVM, &pVM->StatSwitcherDebug,      STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Debug",    STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");
    872     STAM_REG(pVM, &pVM->StatSwitcherCR0,        STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/CR0",  STAMUNIT_TICKS_PER_CALL,    "Profiling switching to GC.");
    873     STAM_REG(pVM, &pVM->StatSwitcherCR4,        STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/CR4",  STAMUNIT_TICKS_PER_CALL,    "Profiling switching to GC.");
    874     STAM_REG(pVM, &pVM->StatSwitcherLgdt,       STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Lgdt", STAMUNIT_TICKS_PER_CALL,    "Profiling switching to GC.");
    875     STAM_REG(pVM, &pVM->StatSwitcherLidt,       STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Lidt", STAMUNIT_TICKS_PER_CALL,    "Profiling switching to GC.");
    876     STAM_REG(pVM, &pVM->StatSwitcherLldt,       STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/Lldt", STAMUNIT_TICKS_PER_CALL,    "Profiling switching to GC.");
    877     STAM_REG(pVM, &pVM->StatSwitcherTSS,        STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/TSS",  STAMUNIT_TICKS_PER_CALL,    "Profiling switching to GC.");
    878     STAM_REG(pVM, &pVM->StatSwitcherJmpCR3,     STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/JmpCR3",   STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");
    879     STAM_REG(pVM, &pVM->StatSwitcherRstrRegs,   STAMTYPE_PROFILE_ADV, "/VM/Switcher/ToGC/RstrRegs", STAMUNIT_TICKS_PER_CALL,"Profiling switching to GC.");
    880 
    881866    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    882867    {
  • trunk/src/VBox/VMM/testcase/tstVMStruct.h

    r79718 r79995  
    14381438    GEN_CHECK_OFF(VM, uCpuExecutionCap);
    14391439    GEN_CHECK_OFF(VM, cbSelf);
    1440     GEN_CHECK_OFF(VM, pfnVMMRCToHostAsm);
    1441     GEN_CHECK_OFF(VM, pfnVMMRCToHostAsmNoReturn);
    14421440    GEN_CHECK_OFF(VM, bMainExecutionEngine);
    14431441    GEN_CHECK_OFF(VM, fRecompileUser);
     
    14481446    GEN_CHECK_OFF(VM, fFaultTolerantMaster);
    14491447    GEN_CHECK_OFF(VM, fUseLargePages);
    1450     GEN_CHECK_OFF(VM, hTraceBufRC);
    14511448    GEN_CHECK_OFF(VM, hTraceBufR3);
    14521449    GEN_CHECK_OFF(VM, hTraceBufR0);
    1453     GEN_CHECK_OFF(VM, StatTotalQemuToGC);
    1454     GEN_CHECK_OFF(VM, StatTotalGCToQemu);
    1455     GEN_CHECK_OFF(VM, StatTotalInGC);
    1456     GEN_CHECK_OFF(VM, StatTotalInQemu);
    1457     GEN_CHECK_OFF(VM, StatSwitcherToGC);
    1458     GEN_CHECK_OFF(VM, StatSwitcherToHC);
    1459     GEN_CHECK_OFF(VM, StatSwitcherSaveRegs);
    1460     GEN_CHECK_OFF(VM, StatSwitcherSysEnter);
    1461     GEN_CHECK_OFF(VM, StatSwitcherDebug);
    1462     GEN_CHECK_OFF(VM, StatSwitcherCR0);
    1463     GEN_CHECK_OFF(VM, StatSwitcherCR4);
    1464     GEN_CHECK_OFF(VM, StatSwitcherJmpCR3);
    1465     GEN_CHECK_OFF(VM, StatSwitcherRstrRegs);
    1466     GEN_CHECK_OFF(VM, StatSwitcherLgdt);
    1467     GEN_CHECK_OFF(VM, StatSwitcherLidt);
    1468     GEN_CHECK_OFF(VM, StatSwitcherLldt);
    1469     GEN_CHECK_OFF(VM, StatSwitcherTSS);
    14701450    GEN_CHECK_OFF(VM, cpum);
    14711451    GEN_CHECK_OFF(VM, vmm);
  • trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp

    r78220 r79995  
    271271    }
    272272    PRINT_OFFSET(VM, selm.s.TssTrap08);
     273#if 0 // irrelevant now, remove later.
    273274    if ((RT_UOFFSETOF(VM, selm.s.TssTrap08) & PAGE_OFFSET_MASK) > PAGE_SIZE - sizeof(pVM->selm.s.TssTrap08))
    274275    {
     
    276277        rc++;
    277278    }
     279#endif
    278280    CHECK_MEMBER_ALIGNMENT(VM, trpm.s.aIdt, 16);
    279281    CHECK_MEMBER_ALIGNMENT(VM, aCpus[0], PAGE_SIZE);
     
    299301    CHECK_MEMBER_ALIGNMENT(VM, vmm.s.u64LastYield, 8);
    300302    CHECK_MEMBER_ALIGNMENT(VM, vmm.s.StatRunRC, 8);
    301     CHECK_MEMBER_ALIGNMENT(VM, StatTotalQemuToGC, 8);
    302303#ifdef VBOX_WITH_REM
    303304    CHECK_MEMBER_ALIGNMENT(VM, rem.s.uPendingExcptCR2, 8);
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