VirtualBox

Changeset 99051 in vbox


Ignore:
Timestamp:
Mar 19, 2023 4:40:06 PM (22 months ago)
Author:
vboxsync
Message:

VMM: More ARMv8 x86/amd64 separation work, VBoxVMMArm compiles and links now, bugref:10385

Location:
trunk
Files:
4 added
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum-armv8.h

    r99023 r99051  
    141141typedef CPUMDBENTRY const *PCCPUMDBENTRY;
    142142
     143
     144/** @name Changed flags.
     145 * These flags are used to keep track of which important register that
     146 * have been changed since last they were reset. The only one allowed
     147 * to clear them is REM!
     148 *
     149 * @todo This is obsolete, but remains as it will be refactored for coordinating
     150 *       IEM and NEM/HM later. Probably.
     151 * @{
     152 */
     153#define CPUM_CHANGED_GLOBAL_TLB_FLUSH           RT_BIT(0)
     154#define CPUM_CHANGED_ALL                        ( CPUM_CHANGED_GLOBAL_TLB_FLUSH )
     155/** @} */
     156
    143157/** @} */
    144158RT_C_DECLS_END
  • trunk/include/VBox/vmm/cpum-x86-amd64.h

    r99023 r99051  
    27722772/** @} */
    27732773
    2774 VMMDECL(void)           CPUMSetChangedFlags(PVMCPU pVCpu, uint32_t fChangedAdd);
    27752774VMMDECL(bool)           CPUMSupportsXSave(PVM pVM);
    27762775VMMDECL(bool)           CPUMIsHostUsingSysEnter(PVM pVM);
     
    27832782VMMDECL(bool)           CPUMIsHyperDebugStateActive(PVMCPU pVCpu);
    27842783VMMDECL(uint32_t)       CPUMGetGuestCPL(PVMCPU pVCpu);
    2785 VMMDECL(uint32_t)       CPUMGetGuestCodeBits(PVMCPU pVCpu);
    2786 VMMDECL(DISCPUMODE)     CPUMGetGuestDisMode(PVMCPU pVCpu);
    27872784VMMDECL(uint32_t)       CPUMGetGuestMxCsrMask(PVM pVM);
    27882785VMMDECL(uint64_t)       CPUMGetGuestScalableBusFrequency(PVM pVM);
  • trunk/include/VBox/vmm/cpum.h

    r99025 r99051  
    341341#ifndef VBOX_FOR_DTRACE_LIB
    342342
     343VMMDECL(void)           CPUMSetChangedFlags(PVMCPU pVCpu, uint32_t fChangedAdd);
    343344VMMDECL(PCPUMCTX)       CPUMQueryGuestCtxPtr(PVMCPU pVCpu);
    344345VMMDECL(CPUMMODE)       CPUMGetGuestMode(PVMCPU pVCpu);
     346VMMDECL(uint32_t)       CPUMGetGuestCodeBits(PVMCPU pVCpu);
     347VMMDECL(DISCPUMODE)     CPUMGetGuestDisMode(PVMCPU pVCpu);
    345348
    346349/** @name Guest Register Getters.
  • trunk/include/VBox/vmm/cpumctx-armv8.h

    r98972 r99051  
    145145    /** Floating point status register. */
    146146    uint64_t        fpsr;
    147     /** The internal PSTATE value (accessible in CPSR with AARCH32 and through
    148      * NZCV and DAIF special purpose registers. */
    149     uint32_t        fPState;
     147    /** The internal PSTATE state (as given from SPSR_EL2). */
     148    uint64_t        fPState;
    150149
    151150    uint32_t        fPadding0;
     
    213212#define CPUMCTX_EXTRN_FPCR                      UINT64_C(0x0000000000004000)
    214213/** The FPSR (Floating Point Status Register) is kept externally. */
    215 #define CPUMCTX_EXTRN_FCSR                      UINT64_C(0x0000000000008000)
     214#define CPUMCTX_EXTRN_FPSR                      UINT64_C(0x0000000000008000)
    216215
    217216/** Mask of bits the keepers can use for state tracking. */
  • trunk/src/VBox/VMM/Makefile.kmk

    r98980 r99051  
    354354        VMMR3/DBGFR3Bp.cpp \
    355355        VMMR3/DBGFR3BugCheck.cpp \
     356        VMMR3/DBGFCoreWrite.cpp \
    356357        VMMR3/DBGFCpu.cpp \
    357358        VMMR3/DBGFDisas.cpp \
     
    365366        VMMR3/DBGFStack.cpp \
    366367        VMMR3/DBGFR3Flow.cpp \
     368        VMMR3/DBGFR3FlowTrace.cpp \
    367369        VMMR3/DBGFR3Trace.cpp \
    368370        VMMR3/DBGFR3SampleReport.cpp \
     
    371373        VMMR3/EMR3Dbg.cpp \
    372374        VMMR3/EMR3Nem.cpp \
    373         VMMR3/GCM.cpp \
    374375        VMMR3/GIM.cpp \
    375376        VMMR3/IEMR3.cpp \
     
    392393        VMMR3/PDMR3Task.cpp \
    393394        VMMR3/PDMThread.cpp \
    394         VMMR3/PGM.cpp \
     395        VMMR3/PGM-armv8.cpp \
    395396        VMMR3/PGMDbg.cpp \
    396397        VMMR3/PGMHandler.cpp \
     
    409410        VMMR3/VMMGuruMeditation.cpp \
    410411        VMMR3/VMMTests.cpp \
    411         VMMR3/HM.cpp \
    412         VMMAll/APICAll.cpp \
    413         VMMAll/CPUMAllCpuId.cpp \
    414         VMMAll/CPUMAllRegs.cpp \
    415         VMMAll/CPUMAllMsrs.cpp \
     412        VMMR3/HM-armv8.cpp \
     413        VMMAll/CPUMAllRegs-armv8.cpp \
    416414        VMMAll/DBGFAll.cpp \
    417         VMMAll/DBGFAllBp.cpp \
    418415        $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
     416        VMMAll/IEMAll-armv8.cpp \
    419417        VMMAll/IOMAll.cpp \
    420418        VMMAll/IOMAllMmioNew.cpp \
     
    427425        VMMAll/PDMAllQueue.cpp \
    428426        VMMAll/PDMAllTask.cpp \
    429         VMMAll/PGMAll.cpp \
    430427        VMMAll/PGMAllHandler.cpp \
    431428        VMMAll/PGMAllPhys.cpp \
    432429        VMMAll/PGMAllPool.cpp \
    433430        VMMAll/EMAll.cpp \
    434         VMMAll/GCMAll.cpp \
    435431        VMMAll/GIMAll.cpp \
    436         VMMAll/GIMAllHv.cpp \
    437         VMMAll/GIMAllKvm.cpp \
    438432        VMMAll/TMAll.cpp \
    439433        VMMAll/TMAllCpu.cpp \
     
    460454
    461455 VBoxVMMArm_SOURCES.darwin.arm64 += \
    462         VMMR3/NEMR3Native-darwin.cpp
     456        VMMR3/NEMR3Native-darwin-armv8.cpp
    463457 VBoxVMMArm_DEFS.darwin.arm64   += VBOX_WITH_NATIVE_NEM
     458 VBoxVMMArm_LDFLAGS.darwin.arm64 = -framework Hypervisor
    464459
    465460 VBoxVMMArm_LIBS = \
    466461        $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
    467  #ifdef VBOX_WITH_DEBUGGER
    468  # VBoxVMMArm_LIBS += \
    469  #      $(PATH_STAGE_LIB)/Debugger$(VBOX_SUFF_LIB)
    470  #endif
     462 ifdef VBOX_WITH_DEBUGGER
     463  VBoxVMMArm_LIBS += \
     464        $(PATH_STAGE_LIB)/Debugger-armv8$(VBOX_SUFF_LIB)
     465 endif
    471466 VBoxVMMArm_LIBS += \
    472467        $(LIB_RUNTIME)
  • trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp

    r98103 r99051  
    5353
    5454
     55#if !defined(VBOX_VMM_TARGET_ARMV8)
    5556/**
    5657 * Gets the hardware breakpoint configuration as DR7.
     
    444445    return 0;
    445446}
     447#endif /* VBOX_VMM_TARGET_ARMV8 */
    446448
    447449
     
    524526         * Any events on the stack. Should the incoming event be ignored?
    525527         */
     528#if defined(VBOX_VMM_TARGET_ARMV8)
     529        uint64_t const rip = CPUMGetGuestFlatPC(pVCpu); /* rip is a misnomer but saves us #ifdef's later on. */
     530#else
    526531        uint64_t const rip = CPUMGetGuestRIP(pVCpu);
     532#endif
    527533        uint32_t i = pVCpu->dbgf.s.cEvents;
    528534        if (i > 0)
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r98103 r99051  
    110110
    111111
     112#if !defined(VBOX_VMM_TARGET_ARMV8)
    112113/**
    113114 * Prepare an MWAIT - essentials of the MONITOR instruction.
     
    251252    return false;
    252253}
     254#endif
    253255
    254256
     
    876878        if (RT_FAILURE(rc))
    877879        {
     880#if defined(VBOX_VMM_TARGET_ARMV8)
     881            AssertReleaseFailed();
     882#else
    878883            /*
    879884             * If we fail to find the page via the guest's page tables
     
    887892                    HMInvalidatePage(pVCpu, uSrcAddr + cbToRead - 1);
    888893            }
     894#endif
    889895        }
    890896    }
     
    907913VMM_INT_DECL(int) EMInterpretDisasCurrent(PVMCPUCC pVCpu, PDISCPUSTATE pDis, unsigned *pcbInstr)
    908914{
     915#if defined(VBOX_VMM_TARGET_ARMV8)
     916    return EMInterpretDisasOneEx(pVCpu, (RTGCUINTPTR)CPUMGetGuestFlatPC(pVCpu), pDis, pcbInstr);
     917#else
    909918    PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    910919    RTGCPTR  GCPtrInstr;
    911 #if 0
     920
     921# if 0
    912922    int rc = SELMToFlatEx(pVCpu, DISSELREG_CS, pCtx, pCtx->rip, 0, &GCPtrInstr);
    913 #else
     923# else
    914924/** @todo Get the CPU mode as well while we're at it! */
    915925    int rc = SELMValidateAndConvertCSAddr(pVCpu, pCtx->eflags.u, pCtx->ss.Sel, pCtx->cs.Sel, &pCtx->cs, pCtx->rip, &GCPtrInstr);
    916 #endif
     926# endif
    917927    if (RT_SUCCESS(rc))
    918928        return EMInterpretDisasOneEx(pVCpu, (RTGCUINTPTR)GCPtrInstr, pDis, pcbInstr);
     
    921931         pCtx->cs.Sel, (RTGCPTR)pCtx->rip, pCtx->ss.Sel & X86_SEL_RPL, rc));
    922932    return rc;
     933#endif
    923934}
    924935
     
    965976VMM_INT_DECL(VBOXSTRICTRC) EMInterpretInstruction(PVMCPUCC pVCpu)
    966977{
     978#if defined(VBOX_VMM_TARGET_ARMV8)
     979    LogFlow(("EMInterpretInstruction %RGv\n", (RTGCPTR)CPUMGetGuestFlatPC(pVCpu)));
     980#else
    967981    LogFlow(("EMInterpretInstruction %RGv\n", (RTGCPTR)CPUMGetGuestRIP(pVCpu)));
     982#endif
    968983
    969984    VBOXSTRICTRC rc = IEMExecOneBypassEx(pVCpu, NULL /*pcbWritten*/);
  • trunk/src/VBox/VMM/VMMAll/GIMAll.cpp

    r98103 r99051  
    9191    switch (pVM->gim.s.enmProviderId)
    9292    {
     93#if !defined(VBOX_VMM_TARGET_ARMV8)
    9394        case GIMPROVIDERID_HYPERV:
    9495            return gimHvGetMmio2Regions(pVM, pcRegions);
    95 
     96#endif
    9697        default:
    9798            break;
     
    116117    switch (pVM->gim.s.enmProviderId)
    117118    {
     119#if !defined(VBOX_VMM_TARGET_ARMV8)
    118120        case GIMPROVIDERID_HYPERV:
    119121            return gimHvAreHypercallsEnabled(pVM);
     
    121123        case GIMPROVIDERID_KVM:
    122124            return gimKvmAreHypercallsEnabled(pVCpu);
    123 
     125#endif
    124126        default:
    125127            return false;
     
    161163    switch (pVM->gim.s.enmProviderId)
    162164    {
     165#if !defined(VBOX_VMM_TARGET_ARMV8)
    163166        case GIMPROVIDERID_HYPERV:
    164167            return gimHvHypercall(pVCpu, pCtx);
     
    166169        case GIMPROVIDERID_KVM:
    167170            return gimKvmHypercall(pVCpu, pCtx);
    168 
     171#endif
    169172        default:
    170173            AssertMsgFailed(("GIMHypercall: for provider %u not available/implemented\n", pVM->gim.s.enmProviderId));
     
    212215    switch (pVM->gim.s.enmProviderId)
    213216    {
     217#if !defined(VBOX_VMM_TARGET_ARMV8)
    214218        case GIMPROVIDERID_HYPERV:
    215219            return gimHvHypercallEx(pVCpu, pCtx, uDisOpcode, cbInstr);
     
    217221        case GIMPROVIDERID_KVM:
    218222            return gimKvmHypercallEx(pVCpu, pCtx, uDisOpcode, cbInstr);
    219 
     223#endif
    220224        default:
    221225            AssertMsgFailedReturn(("enmProviderId=%u\n", pVM->gim.s.enmProviderId), VERR_GIM_HYPERCALLS_NOT_AVAILABLE);
     
    254258        switch (pVM->gim.s.enmProviderId)
    255259        {
     260#if !defined(VBOX_VMM_TARGET_ARMV8)
    256261            case GIMPROVIDERID_HYPERV:
    257262                return gimHvHypercallEx(pVCpu, pCtx, Dis.pCurInstr->uOpcode, Dis.cbInstr);
     
    259264            case GIMPROVIDERID_KVM:
    260265                return gimKvmHypercallEx(pVCpu, pCtx, Dis.pCurInstr->uOpcode, Dis.cbInstr);
    261 
     266#endif
    262267            default:
    263268                AssertMsgFailed(("GIMExecHypercallInstr: for provider %u not available/implemented\n", pVM->gim.s.enmProviderId));
     
    266271    }
    267272
     273#if !defined(VBOX_VMM_TARGET_ARMV8)
    268274    Log(("GIM: GIMExecHypercallInstr: Failed to disassemble CS:RIP=%04x:%08RX64. rc=%Rrc\n", pCtx->cs.Sel, pCtx->rip, rc));
     275#endif
    269276    return rc;
    270277}
     
    285292    switch (pVM->gim.s.enmProviderId)
    286293    {
     294#if !defined(VBOX_VMM_TARGET_ARMV8)
    287295        case GIMPROVIDERID_HYPERV:
    288296            return gimHvIsParavirtTscEnabled(pVM);
     
    290298        case GIMPROVIDERID_KVM:
    291299            return gimKvmIsParavirtTscEnabled(pVM);
    292 
     300#endif
    293301        default:
    294302            break;
     
    318326    switch (pVM->gim.s.enmProviderId)
    319327    {
     328#if !defined(VBOX_VMM_TARGET_ARMV8)
    320329        case GIMPROVIDERID_KVM:
    321330            return gimKvmShouldTrapXcptUD(pVM);
     
    323332        case GIMPROVIDERID_HYPERV:
    324333            return gimHvShouldTrapXcptUD(pVCpu);
    325 
     334#endif
    326335        default:
    327336            return false;
     
    362371    switch (pVM->gim.s.enmProviderId)
    363372    {
     373#if !defined(VBOX_VMM_TARGET_ARMV8)
    364374        case GIMPROVIDERID_KVM:
    365375            return gimKvmXcptUD(pVM, pVCpu, pCtx, pDis, pcbInstr);
     
    367377        case GIMPROVIDERID_HYPERV:
    368378            return gimHvXcptUD(pVCpu, pCtx, pDis, pcbInstr);
    369 
     379#endif
    370380        default:
    371381            return VERR_GIM_OPERATION_FAILED;
     
    374384
    375385
     386#if !defined(VBOX_VMM_TARGET_ARMV8)
    376387/**
    377388 * Invokes the read-MSR handler for the GIM provider configured for the VM.
     
    504515    return VERR_BUFFER_OVERFLOW;
    505516}
    506 
     517#endif
     518
  • trunk/src/VBox/VMM/VMMAll/IOMAllMmioNew.cpp

    r98103 r99051  
    10881088    AssertReturn(pDevIns, VERR_INVALID_POINTER);
    10891089
     1090#if defined(VBOX_VMM_TARGET_ARMV8)
     1091    /** @todo NEM: MMIO page aliasing. */
     1092    return VINF_SUCCESS;    /* ignore */ /** @todo return some indicator if we fail here */
     1093#else
    10901094/** @todo Why is this restricted to protected mode???  Try it in all modes! */
    10911095    PVMCPUCC pVCpu = VMMGetCpu(pVM);
     
    11021106     */
    11031107    AssertReturn(hRegion < RT_MIN(pVM->iom.s.cMmioRegs, pVM->iom.s.cMmioAlloc), VERR_IOM_INVALID_MMIO_HANDLE);
    1104 #ifdef IN_RING0
     1108# ifdef IN_RING0
    11051109    AssertReturn(hRegion < pVM->iomr0.s.cMmioAlloc, VERR_IOM_INVALID_MMIO_HANDLE);
    11061110    PIOMMMIOENTRYR3 const pRegEntry = &pVM->iomr0.s.paMmioRing3Regs[hRegion];
     
    11101114                 || (   pVM->iomr0.s.paMmioRegs[hRegion].pDevIns == NULL
    11111115                     && pRegEntry->pDevIns == pDevIns->pDevInsForR3), VERR_ACCESS_DENIED);
    1112 #else
     1116# else
    11131117    PIOMMMIOENTRYR3 const pRegEntry = &pVM->iom.s.paMmioRegs[hRegion];
    11141118    AssertReturn(pRegEntry->cbRegion > 0, VERR_IOM_INVALID_MMIO_HANDLE);
    11151119    AssertReturn(pRegEntry->pDevIns == pDevIns, VERR_ACCESS_DENIED);
    1116 #endif
     1120# endif
    11171121    AssertReturn(offRegion < pRegEntry->cbRegion, VERR_OUT_OF_RANGE);
    11181122    Assert((pRegEntry->cbRegion & GUEST_PAGE_OFFSET_MASK) == 0);
     
    11441148/** @todo either ditch this or replace it with something that works in the
    11451149 *        nested case, since we really only care about nested paging! */
    1146 #if 0
     1150# if 0
    11471151    /*
    11481152     * Modify the shadow page table. Since it's an MMIO page it won't be present and we
     
    11511155     * Note: This is a NOP in the EPT case; we'll just let it fault again to resync the page.
    11521156     */
    1153 # if 0 /* The assertion is wrong for the PGM_SYNC_CLEAR_PGM_POOL and VINF_PGM_HANDLER_ALREADY_ALIASED cases. */
    1154 ifdef VBOX_STRICT
     1157#  if 0 /* The assertion is wrong for the PGM_SYNC_CLEAR_PGM_POOL and VINF_PGM_HANDLER_ALREADY_ALIASED cases. */
     1158 ifdef VBOX_STRICT
    11551159    uint64_t fFlags;
    11561160    RTHCPHYS HCPhys;
    11571161    rc = PGMShwGetPage(pVCpu, (RTGCPTR)GCPhys, &fFlags, &HCPhys);
    11581162    Assert(rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
     1163#   endif
    11591164#  endif
    1160 # endif
    11611165    rc = PGMPrefetchPage(pVCpu, (RTGCPTR)GCPhys);
    11621166    Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
    1163 #endif
     1167# endif
    11641168    return rc;
     1169#endif
    11651170}
    11661171
     
    12531258    AssertReturn(pDevIns, VERR_INVALID_POINTER);
    12541259
     1260#if defined(VBOX_VMM_TARGET_ARMV8)
     1261    /** @todo NEM: MMIO page aliasing. */
     1262    return VINF_SUCCESS;    /* ignore */ /** @todo return some indicator if we fail here */
     1263#else
    12551264/** @todo Get rid of this this real/protected or nested paging restriction,
    12561265 *        it probably shouldn't be here and would be nasty when the CPU
     
    12701279     */
    12711280    AssertReturn(hRegion < RT_MIN(pVM->iom.s.cMmioRegs, pVM->iom.s.cMmioAlloc), VERR_IOM_INVALID_MMIO_HANDLE);
    1272 #ifdef IN_RING0
     1281# ifdef IN_RING0
    12731282    AssertReturn(hRegion < pVM->iomr0.s.cMmioAlloc, VERR_IOM_INVALID_MMIO_HANDLE);
    12741283    PIOMMMIOENTRYR3 const pRegEntry = &pVM->iomr0.s.paMmioRing3Regs[hRegion];
     
    12771286                 || (   pVM->iomr0.s.paMmioRegs[hRegion].pDevIns == NULL
    12781287                     && pRegEntry->pDevIns == pDevIns->pDevInsForR3), VERR_ACCESS_DENIED);
    1279 #else
     1288# else
    12801289    PIOMMMIOENTRYR3 const pRegEntry = &pVM->iom.s.paMmioRegs[hRegion];
    12811290    AssertReturn(pRegEntry->cbRegion > 0, VERR_IOM_INVALID_MMIO_HANDLE);
    12821291    AssertReturn(pRegEntry->pDevIns == pDevIns, VERR_ACCESS_DENIED);
    1283 #endif
     1292# endif
    12841293    Assert((pRegEntry->cbRegion & GUEST_PAGE_OFFSET_MASK) == 0);
    12851294
     
    13171326# endif
    13181327    return rc;
    1319 }
    1320 
     1328#endif
     1329}
     1330
  • trunk/src/VBox/VMM/VMMAll/PDMAll.cpp

    r98103 r99051  
    7070    {
    7171        VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INTERRUPT_APIC);
     72#if defined(VBOX_VMM_TARGET_ARMV8)
     73        AssertReleaseFailed();
     74#else
    7275        uint32_t uTagSrc;
    7376        rc = APICGetInterrupt(pVCpu, pu8Interrupt, &uTagSrc);
     
    8083        /* else if it's masked by TPR/PPR/whatever, go ahead checking the PIC. Such masked
    8184           interrupts shouldn't prevent ExtINT from being delivered. */
     85#endif
    8286    }
    8387
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r98103 r99051  
    757757    int rc = pgmPoolTrackUpdateGCPhys(pVM, GCPhysPage, pPage, true /*fFlushPTEs*/, &fFlushTLBs);
    758758    AssertLogRelRCReturnVoid(rc);
     759#if defined(VBOX_VMM_TARGET_ARMV8)
     760    AssertReleaseFailed();
     761#else
    759762    HMFlushTlbOnAllVCpus(pVM);
     763#endif
    760764
    761765    /*
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r98103 r99051  
    51805180    if (pgmPoolIsPageLocked(pPage))
    51815181    {
     5182#if !defined(VBOX_VMM_TARGET_ARMV8)
    51825183        AssertMsg(   pPage->enmKind == PGMPOOLKIND_64BIT_PML4
    51835184                  || pPage->enmKind == PGMPOOLKIND_PAE_PDPT
     
    51915192                  || pPage->enmKind == PGMPOOLKIND_ROOT_NESTED,
    51925193                  ("Can't free the shadow CR3! (%RHp vs %RHp kind=%d\n", PGMGetHyperCR3(VMMGetCpu(pVM)), pPage->Core.Key, pPage->enmKind));
     5194#endif
    51935195        Log(("pgmPoolFlushPage: current active shadow CR3, rejected. enmKind=%s idx=%d\n", pgmPoolPoolKindToStr(pPage->enmKind), pPage->idx));
    51945196        PGM_UNLOCK(pVM);
  • trunk/src/VBox/VMM/VMMR3/CPUM-armv8.cpp

    r99026 r99051  
    6767#include <iprt/mp.h>
    6868#include <iprt/string.h>
     69#include <iprt/armv8.h>
    6970
    7071
     
    298299     */
    299300    RT_BZERO(pCtx, sizeof(*pCtx));
     301
     302    /* Start in Supervisor mode. */
     303    /** @todo Differentiate between Aarch64 and Aarch32 configuation. */
     304    pCtx->fPState =   ARMV8_SPSR_EL2_AARCH64_SET_EL(ARMV8_AARCH64_EL_1)
     305                    | ARMV8_SPSR_EL2_AARCH64_SP
     306                    | ARMV8_SPSR_EL2_AARCH64_D
     307                    | ARMV8_SPSR_EL2_AARCH64_A
     308                    | ARMV8_SPSR_EL2_AARCH64_I
     309                    | ARMV8_SPSR_EL2_AARCH64_F;
    300310    /** @todo */
    301311}
  • trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp

    r98103 r99051  
    337337    } while (0)
    338338
     339#if defined(VBOX_VMM_TARGET_ARMV8)
     340    AssertReleaseFailed();
     341    RT_NOREF(pVCpu, pDbgfCpu);
     342#else
    339343    PVM       pVM  = pVCpu->CTX_SUFF(pVM);
    340344    PCCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
     
    394398    if (RT_LIKELY(pDbgfCpu->cbExt))
    395399        memcpy(&pDbgfCpu->ext, &pCtx->XState, pDbgfCpu->cbExt);
     400#endif
    396401
    397402#undef DBGFCOPYSEL
  • trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp

    r98972 r99051  
    365365
    366366
     367#if !defined(VBOX_VMM_TARGET_ARMV8)
    367368/**
    368369 * Worker for DBGFR3SelQueryInfo that calls into SELM.
     
    414415    return rc;
    415416}
     417#endif
    416418
    417419
     
    451453    memset(pSelInfo, 0, sizeof(*pSelInfo));
    452454
     455#if defined(VBOX_VMM_TARGET_ARMV8)
     456    RT_NOREF(Sel);
     457    return VERR_NOT_SUPPORTED;
     458#else
    453459    /*
    454460     * Dispatch the request to a worker running on the target CPU.
    455461     */
    456462    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pUVM, idCpu, Sel, fFlags, pSelInfo);
     463#endif
    457464}
    458465
     
    579586            }
    580587
     588#if !defined(VBOX_VMM_TARGET_ARMV8)
    581589            if (fFlags & DBGFPGDMP_FLAGS_CURRENT_CR3)
    582590                cr3 = PGMGetHyperCR3(pVCpu);
     591#endif
    583592            if (fFlags & DBGFPGDMP_FLAGS_CURRENT_MODE)
    584593                fFlags |= dbgfR3PagingDumpModeToFlags(PGMGetShadowMode(pVCpu));
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r98980 r99051  
    119119
    120120    int rc = CFGMR3QueryBoolDef(pCfgEM, "IemExecutesAll", &pVM->em.s.fIemExecutesAll,
    121 #if defined(RT_ARCH_ARM64) && defined(RT_OS_DARWIN)
     121#if defined(RT_ARCH_ARM64) && defined(RT_OS_DARWIN) && !defined(VBOX_VMM_TARGET_ARMV8)
    122122                                true
    123123#else
     
    869869                    || pVCpu->em.s.enmState == EMSTATE_DEBUG_HYPER)
    870870                    AssertLogRelMsgFailedStmt(("Bad EM state."), VERR_EM_INTERNAL_ERROR);
     871#if !defined(VBOX_VMM_TARGET_ARMV8)
    871872                else if (pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_HM)
    872873                    rc = EMR3HmSingleInstruction(pVM, pVCpu, 0 /*fFlags*/);
     874#endif
    873875                else if (pVCpu->em.s.enmState == EMSTATE_DEBUG_GUEST_NEM)
    874876                    rc = VBOXSTRICTRC_TODO(emR3NemSingleInstruction(pVM, pVCpu, 0 /*fFlags*/));
     
    13241326        return EMSTATE_IEM;
    13251327
     1328#if !defined(VBOX_VMM_TARGET_ARMV8)
    13261329    if (VM_IS_HM_ENABLED(pVM))
    13271330    {
     
    13291332            return EMSTATE_HM;
    13301333    }
    1331     else if (NEMR3CanExecuteGuest(pVM, pVCpu))
     1334    else
     1335#endif
     1336    if (NEMR3CanExecuteGuest(pVM, pVCpu))
    13321337        return EMSTATE_NEM;
    13331338
     
    22742279                case VINF_EM_RESCHEDULE_HM:
    22752280                    Assert(!pVM->em.s.fIemExecutesAll || pVCpu->em.s.enmState != EMSTATE_IEM);
     2281#if !defined(VBOX_VMM_TARGET_ARMV8)
    22762282                    if (VM_IS_HM_ENABLED(pVM))
    22772283                    {
     
    22872293                        }
    22882294                    }
    2289                     else if (VM_IS_NEM_ENABLED(pVM))
     2295                    else
     2296#endif
     2297                    if (VM_IS_NEM_ENABLED(pVM))
    22902298                    {
    22912299                        Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HM: %d -> %d (EMSTATE_NEM)\n", enmOldState, EMSTATE_NEM));
     
    25772585                 */
    25782586                case EMSTATE_HM:
     2587#if defined(VBOX_VMM_TARGET_ARMV8)
     2588                    AssertReleaseFailed(); /* Should never get here. */
     2589#else
    25792590                    rc = emR3HmExecute(pVM, pVCpu, &fFFDone);
     2591#endif
    25802592                    break;
    25812593
     
    26612673                        if (rc == VINF_SUCCESS)
    26622674                        {
     2675#if defined(VBOX_VMM_TARGET_ARMV8)
     2676                            AssertReleaseFailed();
     2677#else
    26632678                            if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_UPDATE_APIC))
    26642679                                APICUpdatePendingInterrupts(pVCpu);
     2680#endif
    26652681
    26662682                            if (VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC
  • trunk/src/VBox/VMM/VMMR3/EMR3Dbg.cpp

    r98103 r99051  
    141141            break;
    142142
     143#if !defined(VBOX_VMM_TARGET_ARMV8)
    143144        case EMEXIT_F_KIND_VMX:
    144145            pszExitName = HMGetVmxExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);
     
    148149            pszExitName = HMGetSvmExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);
    149150            break;
     151#endif
    150152
    151153        case EMEXIT_F_KIND_NEM:
     
    154156
    155157        case EMEXIT_F_KIND_XCPT:
     158#if defined(VBOX_VMM_TARGET_ARMV8)
     159            pszExitName = NULL;
     160            AssertReleaseFailed();
     161#else
    156162            switch (uFlagsAndType & EMEXIT_F_TYPE_MASK)
    157163            {
     
    181187                    break;
    182188            }
     189#endif
    183190            break;
    184191
  • trunk/src/VBox/VMM/VMMR3/GIM.cpp

    r98103 r99051  
    7474#include <iprt/string.h>
    7575
     76#if !defined(VBOX_VMM_TARGET_ARMV8)
    7677/* Include all GIM providers. */
    77 #include "GIMMinimalInternal.h"
    78 #include "GIMHvInternal.h"
    79 #include "GIMKvmInternal.h"
     78# include "GIMMinimalInternal.h"
     79# include "GIMHvInternal.h"
     80# include "GIMKvmInternal.h"
     81#endif
    8082
    8183
     
    161163         *        'most up-to-date implementation' version number when 0. Otherwise,
    162164         *        we'll have abiguities when loading the state of older VMs. */
     165#if !defined(VBOX_VMM_TARGET_ARMV8)
    163166        if (!RTStrCmp(szProvider, "Minimal"))
    164167        {
     
    177180        }
    178181        else
     182#endif
    179183            rc = VMR3SetError(pVM->pUVM, VERR_GIM_INVALID_PROVIDER, RT_SRC_POS, "Provider '%s' unknown.", szProvider);
    180184    }
     
    206210    switch (pVM->gim.s.enmProviderId)
    207211    {
     212#if !defined(VBOX_VMM_TARGET_ARMV8)
    208213        case GIMPROVIDERID_MINIMAL:
    209214            return gimR3MinimalInitCompleted(pVM);
     
    214219        case GIMPROVIDERID_KVM:
    215220            return gimR3KvmInitCompleted(pVM);
    216 
     221#endif
    217222        default:
    218223            break;
     
    256261    switch (pVM->gim.s.enmProviderId)
    257262    {
     263#if !defined(VBOX_VMM_TARGET_ARMV8)
    258264        case GIMPROVIDERID_HYPERV:
    259265            rc = gimR3HvSave(pVM, pSSM);
     
    265271            AssertRCReturn(rc, rc);
    266272            break;
    267 
     273#endif
    268274        default:
    269275            break;
     
    320326    switch (pVM->gim.s.enmProviderId)
    321327    {
     328#if !defined(VBOX_VMM_TARGET_ARMV8)
    322329        case GIMPROVIDERID_HYPERV:
    323330            rc = gimR3HvLoad(pVM, pSSM);
     
    329336            AssertRCReturn(rc, rc);
    330337            break;
    331 
     338#endif
    332339        default:
    333340            break;
     
    345352    switch (pVM->gim.s.enmProviderId)
    346353    {
     354#if !defined(VBOX_VMM_TARGET_ARMV8)
    347355        case GIMPROVIDERID_HYPERV:
    348356            return gimR3HvLoadDone(pVM, pSSM);
    349 
     357#endif
    350358        default:
    351359            return VINF_SUCCESS;
     
    367375    switch (pVM->gim.s.enmProviderId)
    368376    {
     377#if !defined(VBOX_VMM_TARGET_ARMV8)
    369378        case GIMPROVIDERID_HYPERV:
    370379            return gimR3HvTerm(pVM);
     
    372381        case GIMPROVIDERID_KVM:
    373382            return gimR3KvmTerm(pVM);
    374 
     383#endif
    375384        default:
    376385            break;
     
    392401    switch (pVM->gim.s.enmProviderId)
    393402    {
     403#if !defined(VBOX_VMM_TARGET_ARMV8)
    394404        case GIMPROVIDERID_HYPERV:
    395405            gimR3HvRelocate(pVM, offDelta);
    396406            break;
    397 
     407#endif
    398408        default:
    399409            break;
     
    415425    switch (pVM->gim.s.enmProviderId)
    416426    {
     427#if !defined(VBOX_VMM_TARGET_ARMV8)
    417428        case GIMPROVIDERID_HYPERV:
    418429            return gimR3HvReset(pVM);
     
    420431        case GIMPROVIDERID_KVM:
    421432            return gimR3KvmReset(pVM);
    422 
     433#endif
    423434        default:
    424435            break;
     
    456467    switch (pVM->gim.s.enmProviderId)
    457468    {
     469#if !defined(VBOX_VMM_TARGET_ARMV8)
    458470        case GIMPROVIDERID_HYPERV:
    459471            return gimR3HvGetDebugSetup(pVM, pDbgSetup);
     472#endif
    460473        default:
    461474            break;
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r98103 r99051  
    176176     * Info.
    177177     */
     178#if !defined(VBOX_VMM_TARGET_ARMV8)
    178179    DBGFR3InfoRegisterInternal(pVM, "ioport", "Dumps all IOPort ranges. No arguments.", &iomR3IoPortInfo);
     180#endif
    179181    DBGFR3InfoRegisterInternal(pVM, "mmio", "Dumps all MMIO ranges. No arguments.", &iomR3MmioInfo);
    180182
     
    234236         * regions and won't grow the table again.
    235237         */
     238# if !defined(VBOX_VMM_TARGET_ARMV8)
    236239        for (uint32_t i = 0; i < pVM->iom.s.cIoPortRegs; i++)
    237240        {
     
    241244                iomR3IoPortRegStats(pVM, pRegEntry);
    242245        }
     246# endif
    243247
    244248        for (uint32_t i = 0; i < pVM->iom.s.cMmioRegs; i++)
  • trunk/src/VBox/VMM/VMMR3/MM.cpp

    r98103 r99051  
    405405    pVM->mm.s.cbRamAbove4GB = cbRam > offRamHole ? cbRam - offRamHole : 0;
    406406
     407#if defined(VBOX_VMM_TARGET_ARMV8)
     408    rc = PGMR3PhysRegisterRam(pVM, 0, cbRam, "Conventional RAM");
     409#else
    407410    /* First the conventional memory: */
    408411    rc = PGMR3PhysRegisterRam(pVM, 0, RT_MIN(cbRam, 640*_1K), "Conventional RAM");
     
    421424        }
    422425    }
     426#endif
    423427
    424428    /*
     
    427431     */
    428432    pVM->mm.s.fDoneMMR3InitPaging = true;
     433#if !defined(VBOX_VMM_TARGET_ARMV8)
    429434    AssertMsg(pVM->mm.s.cBasePages == cBasePages || RT_FAILURE(rc), ("%RX64 != %RX64\n", pVM->mm.s.cBasePages, cBasePages));
     435#endif
    430436
    431437    LogFlow(("MMR3InitPaging: returns %Rrc\n", rc));
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r98993 r99051  
    9090    VM_ASSERT_STATE_RETURN(pVM, VMSTATE_CREATING, VERR_VM_INVALID_VM_STATE);
    9191
     92#if defined(VBOX_VMM_TARGET_ARMV8)
     93    int rc = VERR_NOT_SUPPORTED;
     94    AssertReleaseFailed();
     95#else
    9296    int rc = IOMR3IoPortCreate(pVM, pDevIns, cPorts, fFlags, pPciDev, iPciRegion,
    9397                               pfnOut, pfnIn, pfnOutStr, pfnInStr, pvUser, pszDesc, paExtDescs, phIoPorts);
     98#endif
    9499
    95100    LogFlow(("pdmR3DevHlp_IoPortCreateEx: caller='%s'/%d: returns %Rrc (*phIoPorts=%#x)\n",
     
    107112    VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT);
    108113
     114#if defined(VBOX_VMM_TARGET_ARMV8)
     115    int rc = VERR_NOT_SUPPORTED;
     116    AssertReleaseFailed();
     117#else
    109118    int rc = IOMR3IoPortMap(pVM, pDevIns, hIoPorts, Port);
     119#endif
    110120
    111121    LogFlow(("pdmR3DevHlp_IoPortMap: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     
    122132    VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT);
    123133
     134#if defined(VBOX_VMM_TARGET_ARMV8)
     135    int rc = VERR_NOT_SUPPORTED;
     136    AssertReleaseFailed();
     137#else
    124138    int rc = IOMR3IoPortUnmap(pVM, pDevIns, hIoPorts);
     139#endif
    125140
    126141    LogFlow(("pdmR3DevHlp_IoPortMap: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
     
    135150    LogFlow(("pdmR3DevHlp_IoPortGetMappingAddress: caller='%s'/%d: hIoPorts=%#x\n", pDevIns->pReg->szName, pDevIns->iInstance, hIoPorts));
    136151
     152#if defined(VBOX_VMM_TARGET_ARMV8)
     153    uint32_t uAddress = UINT32_MAX;
     154    AssertReleaseFailed();
     155#else
    137156    uint32_t uAddress = IOMR3IoPortGetMappingAddress(pDevIns->Internal.s.pVMR3, pDevIns, hIoPorts);
     157#endif
    138158
    139159    LogFlow(("pdmR3DevHlp_IoPortGetMappingAddress: caller='%s'/%d: returns %#RX32\n", pDevIns->pReg->szName, pDevIns->iInstance, uAddress));
     
    150170    VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT);
    151171
     172#if defined(VBOX_VMM_TARGET_ARMV8)
     173    RT_NOREF(Port, u32Value, cbValue);
     174    VBOXSTRICTRC rcStrict = VERR_NOT_SUPPORTED;
     175    AssertReleaseFailed();
     176#else
    152177    PVMCPU pVCpu = VMMGetCpu(pVM);
    153178    AssertPtrReturn(pVCpu, VERR_ACCESS_DENIED);
    154179
    155180    VBOXSTRICTRC rcStrict = IOMIOPortWrite(pVM, pVCpu, Port, u32Value, cbValue);
     181#endif
    156182
    157183    LogFlow(("pdmR3DevHlp_IoPortWrite: caller='%s'/%d: returns %Rrc\n",
     
    20942120        case PDMPCIDEV_IORGN_F_IOPORT_HANDLE:
    20952121            AssertReturn(enmType == PCI_ADDRESS_SPACE_IO, VERR_INVALID_FLAGS);
     2122#if defined(VBOX_VMM_TARGET_ARMV8)
     2123            rc = VERR_NOT_SUPPORTED;
     2124            AssertReleaseFailed();
     2125            AssertRCReturn(rc, rc);
     2126#else
    20962127            rc = IOMR3IoPortValidateHandle(pVM, pDevIns, (IOMIOPORTHANDLE)hHandle);
    20972128            AssertRCReturn(rc, rc);
     2129#endif
    20982130            break;
    20992131        case PDMPCIDEV_IORGN_F_MMIO_HANDLE:
     
    46164648    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
    46174649    LogFlow(("pdmR3DevHlp_A20Set: caller='%s'/%d: fEnable=%d\n", pDevIns->pReg->szName, pDevIns->iInstance, fEnable));
     4650#ifdef VBOX_VMM_TARGET_ARMV8
     4651    AssertReleaseFailed();
     4652#else
    46184653    PGMR3PhysSetA20(VMMGetCpu(pDevIns->Internal.s.pVMR3), fEnable);
     4654#endif
    46194655}
    46204656
  • trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp

    r98993 r99051  
    6666    Assert(pVM->enmVMState != VMSTATE_LOADING || pVM->pdm.s.fStateLoaded);
    6767
     68#if defined(VBOX_VMM_TARGET_ARMV8)
     69    AssertReleaseFailed();
     70#else
    6871    APICLocalInterrupt(pVCpu, 0 /* u8Pin */, 1 /* u8Level */, VINF_SUCCESS /* rcRZ */);
     72#endif
    6973}
    7074
     
    8084    Assert(pVM->enmVMState != VMSTATE_LOADING || pVM->pdm.s.fStateLoaded);
    8185
     86#if defined(VBOX_VMM_TARGET_ARMV8)
     87    AssertReleaseFailed();
     88#else
    8289    APICLocalInterrupt(pVCpu, 0 /* u8Pin */,  0 /* u8Level */, VINF_SUCCESS /* rcRZ */);
     90#endif
    8391}
    8492
     
    129137    LogFlow(("pdmR3IoApicHlp_ApicBusDeliver: caller='%s'/%d: u8Dest=%RX8 u8DestMode=%RX8 u8DeliveryMode=%RX8 uVector=%RX8 u8Polarity=%RX8 u8TriggerMode=%RX8 uTagSrc=%#x\n",
    130138             pDevIns->pReg->szName, pDevIns->iInstance, u8Dest, u8DestMode, u8DeliveryMode, uVector, u8Polarity, u8TriggerMode, uTagSrc));
     139#if defined(VBOX_VMM_TARGET_ARMV8)
     140    AssertReleaseFailed();
     141    return VERR_NOT_IMPLEMENTED;
     142#else
    131143    return APICBusDeliver(pVM, u8Dest, u8DestMode, u8DeliveryMode, uVector, u8Polarity, u8TriggerMode, uTagSrc);
     144#endif
    132145}
    133146
  • trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp

    r98103 r99051  
    675675    RegCB.pCfgNode         = NULL;
    676676
     677#if defined(VBOX_VMM_TARGET_ARMV8)
     678    int rc;
     679#else
    677680    /*
    678681     * Register the internal VMM APIC device.
     
    680683    int rc = pdmR3DevReg_Register(&RegCB.Core, &g_DeviceAPIC);
    681684    AssertRCReturn(rc, rc);
     685#endif
    682686
    683687    /*
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r98103 r99051  
    59625962*********************************************************************************************************************************/
    59635963
     5964#if !defined(VBOX_VMM_TARGET_ARMV8)
    59645965/**
    59655966 * Sets the Address Gate 20 state.
     
    60006001    }
    60016002}
    6002 
     6003#endif
     6004
  • trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp

    r98103 r99051  
    32213221                AssertLogRelRCReturn(rc, rc);
    32223222
     3223#if !defined(VBOX_VMM_TARGET_ARMV8)
    32233224                /* Update the PSE, NX flags and validity masks. */
    32243225                pVCpu->pgm.s.fGst32BitPageSizeExtension = CPUMIsGuestPageSizeExtEnabled(pVCpu);
    32253226                PGMNotifyNxeChanged(pVCpu, CPUMIsGuestNXEnabled(pVCpu));
     3227#endif
    32263228            }
    32273229        }
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r98103 r99051  
    638638     */
    639639    pVM->tm.s.enmOriginalTSCMode = pVM->tm.s.enmTSCMode;
     640#if !defined(VBOX_VMM_TARGET_ARMV8)
    640641    CPUMR3SetCR4Feature(pVM, X86_CR4_TSD, ~X86_CR4_TSD);
     642#endif
    641643    LogRel(("TM:     cTSCTicksPerSecond=%'RU64 (%#RX64) enmTSCMode=%d (%s)\n"
    642644            "TM: cTSCTicksPerSecondHost=%'RU64 (%#RX64)\n"
  • trunk/src/VBox/VMM/VMMR3/TRPM.cpp

    r98103 r99051  
    367367VMMR3DECL(int) TRPMR3InjectEvent(PVM pVM, PVMCPU pVCpu, TRPMEVENT enmEvent, bool *pfInjected)
    368368{
     369#if defined(VBOX_VMM_TARGET_ARMV8)
     370    RT_NOREF(pVM, pVCpu, enmEvent, pfInjected);
     371    AssertReleaseFailed();
     372    return VERR_NOT_IMPLEMENTED;
     373#else
    369374    PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    370375    Assert(!CPUMIsInInterruptShadow(pCtx));
     
    382387    {
    383388        *pfInjected = true;
    384 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     389# ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    385390        if (   CPUMIsGuestInVmxNonRootMode(pCtx)
    386391            && CPUMIsGuestVmxInterceptEvents(pCtx)
     
    391396            return VBOXSTRICTRC_VAL(rcStrict);
    392397        }
    393 #endif
    394 #ifdef RT_OS_WINDOWS
     398# endif
     399# ifdef RT_OS_WINDOWS
    395400        if (!VM_IS_NEM_ENABLED(pVM))
    396401        {
    397 #endif
     402# endif
    398403            rc = TRPMAssertTrap(pVCpu, u8Interrupt, TRPM_HARDWARE_INT);
    399404            AssertRC(rc);
    400 #ifdef RT_OS_WINDOWS
     405# ifdef RT_OS_WINDOWS
    401406        }
    402407        else
     
    408413                return VBOXSTRICTRC_TODO(rcStrict);
    409414        }
    410 #endif
     415# endif
    411416        STAM_REL_COUNTER_INC(&pVM->trpm.s.aStatForwardedIRQ[u8Interrupt]);
    412417    }
     
    419424         : VM_IS_NEM_ENABLED(pVM) ? VINF_EM_RESCHEDULE
    420425         :                          VINF_EM_RESCHEDULE_REM; /* (Heed the halted state if this is changed!) */
     426#endif
    421427}
    422428
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r98644 r99051  
    873873                        if (RT_SUCCESS(rc))
    874874                        {
     875#if !defined(VBOX_VMM_TARGET_ARMV8)
    875876                            rc = SELMR3Init(pVM);
     877#endif
    876878                            if (RT_SUCCESS(rc))
    877879                            {
     
    902904                                                            if (RT_SUCCESS(rc))
    903905                                                            {
     906#if !defined(VBOX_VMM_TARGET_ARMV8)
    904907                                                                rc = GCMR3Init(pVM);
     908#endif
    905909                                                                if (RT_SUCCESS(rc))
    906910                                                                {
     
    927931                                                                        AssertRC(rc2);
    928932                                                                    }
     933#if !defined(VBOX_VMM_TARGET_ARMV8)
    929934                                                                    int rc2 = GCMR3Term(pVM);
    930935                                                                    AssertRC(rc2);
     936#endif
    931937                                                                }
    932938                                                                int rc2 = GIMR3Term(pVM);
     
    950956                                    AssertRC(rc2);
    951957                                }
     958#if !defined(VBOX_VMM_TARGET_ARMV8)
    952959                                int rc2 = SELMR3Term(pVM);
    953960                                AssertRC(rc2);
     961#endif
    954962                            }
    955963                            int rc2 = VMMR3Term(pVM);
     
    10711079    CPUMR3Relocate(pVM);
    10721080    HMR3Relocate(pVM);
     1081#if !defined(VBOX_VMM_TARGET_ARMV8)
    10731082    SELMR3Relocate(pVM);
     1083#endif
    10741084    VMMR3Relocate(pVM, offDelta);
     1085#if !defined(VBOX_VMM_TARGET_ARMV8)
    10751086    SELMR3Relocate(pVM);                /* !hack! fix stack! */
     1087#endif
    10761088    TRPMR3Relocate(pVM, offDelta);
    10771089    IOMR3Relocate(pVM, offDelta);
     
    10821094    PDMR3Relocate(pVM, offDelta);
    10831095    GIMR3Relocate(pVM, offDelta);
     1096#if !defined(VBOX_VMM_TARGET_ARMV8)
    10841097    GCMR3Relocate(pVM, offDelta);
     1098#endif
    10851099}
    10861100
     
    22242238        rc = TRPMR3Term(pVM);
    22252239        AssertRC(rc);
     2240#if !defined(VBOX_VMM_TARGET_ARMV8)
    22262241        rc = SELMR3Term(pVM);
    22272242        AssertRC(rc);
     2243#endif
    22282244        rc = HMR3Term(pVM);
    22292245        AssertRC(rc);
     
    26062622        PDMR3Reset(pVM);
    26072623        PGMR3Reset(pVM);
     2624#if !defined(VBOX_VMM_TARGET_ARMV8)
    26082625        SELMR3Reset(pVM);
     2626#endif
    26092627        TRPMR3Reset(pVM);
    26102628        IOMR3Reset(pVM);
     
    42244242    switch (pVM->bMainExecutionEngine)
    42254243    {
     4244#if !defined(VBOX_VMM_TARGET_ARMV8)
    42264245        case VM_EXEC_ENGINE_HW_VIRT:
    42274246            return HMIsLongModeAllowed(pVM);
     4247#endif
    42284248
    42294249        case VM_EXEC_ENGINE_NATIVE_API:
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r98103 r99051  
    570570        case VMINITCOMPLETED_HM:
    571571        {
     572#if !defined(VBOX_VMM_TARGET_ARMV8)
    572573            /*
    573574             * Disable the periodic preemption timers if we can use the
     
    578579                pVM->vmm.s.fUsePeriodicPreemptionTimers = false;
    579580            LogRel(("VMM: fUsePeriodicPreemptionTimers=%RTbool\n", pVM->vmm.s.fUsePeriodicPreemptionTimers));
     581#endif
    580582
    581583            /*
     
    12101212VMMR3_INT_DECL(int) VMMR3HmRunGC(PVM pVM, PVMCPU pVCpu)
    12111213{
     1214#if defined(VBOX_VMM_TARGET_ARMV8)
     1215    /* We should actually never get here as the only execution engine is NEM. */
     1216    RT_NOREF(pVM, pVCpu);
     1217    AssertReleaseFailed();
     1218    return VERR_NOT_SUPPORTED;
     1219#else
    12121220    Log2(("VMMR3HmRunGC: (cs:rip=%04x:%RX64)\n", CPUMGetGuestCS(pVCpu), CPUMGetGuestRIP(pVCpu)));
    12131221
     
    12151223    do
    12161224    {
    1217 #ifdef NO_SUPCALLR0VMM
     1225# ifdef NO_SUPCALLR0VMM
    12181226        rc = VERR_GENERAL_FAILURE;
    1219 #else
     1227# else
    12201228        rc = SUPR3CallVMMR0Fast(VMCC_GET_VMR0_FOR_CALL(pVM), VMMR0_DO_HM_RUN, pVCpu->idCpu);
    12211229        if (RT_LIKELY(rc == VINF_SUCCESS))
    12221230            rc = pVCpu->vmm.s.iLastGZRc;
    1223 #endif
     1231# endif
    12241232    } while (rc == VINF_EM_RAW_INTERRUPT_HYPER);
    12251233
    1226 #if 0 /** @todo triggers too often */
     1234# if 0 /** @todo triggers too often */
    12271235    Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_TO_R3));
    1228 #endif
     1236# endif
    12291237
    12301238    /*
    12311239     * Flush the logs
    12321240     */
    1233 #ifdef LOG_ENABLED
     1241# ifdef LOG_ENABLED
    12341242    VMM_FLUSH_R0_LOG(pVM, pVCpu, &pVCpu->vmm.s.u.s.Logger, NULL);
    1235 #endif
     1243# endif
    12361244    VMM_FLUSH_R0_LOG(pVM, pVCpu, &pVCpu->vmm.s.u.s.RelLogger, RTLogRelGetDefaultInstance());
    12371245    if (rc != VERR_VMM_RING0_ASSERTION)
     
    12411249    }
    12421250    return vmmR3HandleRing0Assert(pVM, pVCpu);
     1251#endif
    12431252}
    12441253
     
    13011310        return VINF_SUCCESS;
    13021311
     1312#if defined(VBOX_VMM_TARGET_ARMV8)
     1313    AssertReleaseFailed(); /** @todo */
     1314#else
    13031315    PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    1304 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     1316# ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    13051317    if (CPUMIsGuestInVmxRootMode(pCtx))
    13061318    {
     
    13121324        return VINF_SUCCESS;
    13131325    }
    1314 #endif
     1326# endif
    13151327
    13161328    pCtx->cs.Sel        = uVector << 8;
     
    13201332    pCtx->cs.u32Limit   = UINT32_C(0x0000ffff);
    13211333    pCtx->rip           = 0;
     1334#endif
    13221335
    13231336    Log(("vmmR3SendSipi for VCPU %d with vector %x\n", idCpu, uVector));
     
    13631376    PGMR3ResetCpu(pVM, pVCpu);
    13641377    PDMR3ResetCpu(pVCpu);   /* Only clears pending interrupts force flags */
     1378#if !defined(VBOX_VMM_TARGET_ARMV8)
    13651379    APICR3InitIpi(pVCpu);
     1380#endif
    13661381    TRPMR3ResetCpu(pVCpu);
    13671382    CPUMR3ResetCpu(pVM, pVCpu);
  • trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp

    r98103 r99051  
    374374        case VERR_VMM_LONG_JMP_ERROR:
    375375        {
     376#if defined(VBOX_VMM_TARGET_ARMV8)
     377            AssertReleaseFailed();
     378#else
    376379            /*
    377380             * Active trap? This is only of partial interest when in hardware
     
    585588                                "!! Skipping ring-0 registers and stack, rcErr=%Rrc\n", rcErr);
    586589            }
     590#endif /* !VBOX_VMM_TARGET_ARMV8 */
    587591            break;
    588592        }
  • trunk/src/VBox/VMM/include/EMHandleRCTmpl.h

    r98103 r99051  
    113113            break;
    114114
     115#if !defined(VBOX_VMM_TARGET_ARMV8)
    115116        /*
    116117         * Execute pending I/O Port access.
     
    122123            rc = VBOXSTRICTRC_TODO(emR3ExecutePendingIoPortRead(pVM, pVCpu));
    123124            break;
     125#endif
    124126
    125127        /*
     
    167169            break;
    168170
     171#if !defined(VBOX_VMM_TARGET_ARMV8)
    169172        case VINF_EM_EMULATE_SPLIT_LOCK:
    170173            rc = VBOXSTRICTRC_TODO(emR3ExecuteSplitLockInstruction(pVM, pVCpu));
    171174            break;
     175#endif
    172176
    173177
  • trunk/src/VBox/VMM/include/IOMInternal.h

    r98103 r99051  
    574574
    575575#ifdef IN_RING3
     576# if !defined(VBOX_VMM_TARGET_ARMV8)
    576577DECLCALLBACK(void)  iomR3IoPortInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    577578void                iomR3IoPortRegStats(PVM pVM, PIOMIOPORTENTRYR3 pRegEntry);
     579# endif
    578580DECLCALLBACK(void)  iomR3MmioInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    579581void                iomR3MmioRegStats(PVM pVM, PIOMMMIOENTRYR3 pRegEntry);
  • trunk/src/VBox/VMM/include/NEMInternal.h

    r98103 r99051  
    4242#include <iprt/critsect.h>
    4343#elif defined(RT_OS_DARWIN)
    44 # include "VMXInternal.h"
     44# if defined(VBOX_VMM_TARGET_ARMV8)
     45#  include <Hypervisor/Hypervisor.h>
     46# else
     47#  include "VMXInternal.h"
     48# endif
    4549#endif
    4650
     
    108112
    109113#ifdef RT_OS_DARWIN
     114# if !defined(VBOX_VMM_TARGET_ARMV8)
    110115/** vCPU ID declaration to avoid dragging in HV headers here. */
    111116typedef unsigned hv_vcpuid_t;
    112117/** The HV VM memory space ID (ASID). */
    113118typedef unsigned hv_vm_space_t;
     119# endif
    114120
    115121
     
    122128/** @} */
    123129
     130# if defined(VBOX_VMM_TARGET_ARMV8)
    124131/** The CPUMCTX_EXTRN_XXX mask for IEM. */
    125 # define NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM      (  IEM_CPUMCTX_EXTRN_MUST_MASK | CPUMCTX_EXTRN_INHIBIT_INT \
    126                                                      | CPUMCTX_EXTRN_INHIBIT_NMI )
     132#  define NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM      (  IEM_CPUMCTX_EXTRN_MUST_MASK )
     133# else
     134/** The CPUMCTX_EXTRN_XXX mask for IEM. */
     135#  define NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM      (  IEM_CPUMCTX_EXTRN_MUST_MASK | CPUMCTX_EXTRN_INHIBIT_INT \
     136                                                      | CPUMCTX_EXTRN_INHIBIT_NMI )
     137#endif
     138
    127139/** The CPUMCTX_EXTRN_XXX mask for IEM when raising exceptions. */
    128140# define NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM_XCPT (IEM_CPUMCTX_EXTRN_XCPT_MASK | NEM_DARWIN_CPUMCTX_EXTRN_MASK_FOR_IEM)
     
    274286    /** Set if hv_vm_create() was called successfully. */
    275287    bool                        fCreatedVm   : 1;
     288# if defined(VBOX_VMM_TARGET_ARMV8)
     289    /** @todo */
     290# else
    276291    /** Set if hv_vm_space_create() was called successfully. */
    277292    bool                        fCreatedAsid : 1;
     
    310325    /** The last valid host LBR info stack range. */
    311326    uint32_t                    idLbrInfoMsrLast;
     327# endif
    312328
    313329    STAMCOUNTER                 StatMapPage;
     
    460476
    461477#elif defined(RT_OS_DARWIN)
     478# if defined(VBOX_VMM_TARGET_ARMV8)
     479    /** The vCPU handle associated with the EMT executing this vCPU. */
     480    hv_vcpu_t                   hVCpu;
     481    /** Pointer to the exit information structure. */
     482    hv_vcpu_exit_t              *pHvExit;
     483    /** Flag whether an event is pending. */
     484    bool                        fEventPending;
     485# else
    462486    /** The vCPU handle associated with the EMT executing this vCPU. */
    463487    hv_vcpuid_t                 hVCpuId;
     
    530554    /** Pointer to the VMX statistics. */
    531555    PVMXSTATISTICS              pVmxStats;
     556# endif
    532557
    533558    /** @name Statistics
  • trunk/src/VBox/VMM/include/PGMInline.h

    r98103 r99051  
    374374
    375375
     376#ifndef VBOX_VMM_TARGET_ARMV8
    376377/**
    377378 * Checks if the no-execute (NX) feature is active (EFER.NXE=1).
     
    978979    return NULL;
    979980}
     981#endif /* !VBOX_VMM_TARGET_ARMV8 */
    980982
    981983
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r98103 r99051  
    374374 * @param   GCVirt      The virtual address of the page to invalidate.
    375375 */
    376 #ifdef IN_RING0
    377 # define PGM_INVL_PG_ALL_VCPU(pVM, GCVirt)      HMInvalidatePageOnAllVCpus(pVM, (RTGCPTR)(GCVirt))
     376#if defined(VBOX_VMM_TARGET_ARMV8)
     377# define PGM_INVL_PG_ALL_VCPU(pVM, GCVirt)      do { } while(0)
    378378#else
    379379# define PGM_INVL_PG_ALL_VCPU(pVM, GCVirt)      HMInvalidatePageOnAllVCpus(pVM, (RTGCPTR)(GCVirt))
     
    386386 * @param   GCVirt      The virtual address within the page directory to invalidate.
    387387 */
    388 #ifdef IN_RING0
    389 # define PGM_INVL_BIG_PG(pVCpu, GCVirt)         HMFlushTlb(pVCpu)
     388#if defined(VBOX_VMM_TARGET_ARMV8)
     389# define PGM_INVL_BIG_PG(pVCpu, GCVirt)         do { } while(0)
    390390#else
    391391# define PGM_INVL_BIG_PG(pVCpu, GCVirt)         HMFlushTlb(pVCpu)
     
    397397 * @param   pVCpu       The cross context virtual CPU structure.
    398398 */
    399 #ifdef IN_RING0
    400 # define PGM_INVL_VCPU_TLBS(pVCpu)             HMFlushTlb(pVCpu)
     399#if defined(VBOX_VMM_TARGET_ARMV8)
     400# define PGM_INVL_VCPU_TLBS(pVCpu)             do { } while(0)
    401401#else
    402402# define PGM_INVL_VCPU_TLBS(pVCpu)             HMFlushTlb(pVCpu)
     
    408408 * @param   pVM         The cross context VM structure.
    409409 */
    410 #ifdef IN_RING0
    411 # define PGM_INVL_ALL_VCPU_TLBS(pVM)            HMFlushTlbOnAllVCpus(pVM)
     410#if defined(VBOX_VMM_TARGET_ARMV8)
     411# define PGM_INVL_ALL_VCPU_TLBS(pVM)            do { } while(0)
    412412#else
    413413# define PGM_INVL_ALL_VCPU_TLBS(pVM)            HMFlushTlbOnAllVCpus(pVM)
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