VirtualBox

Ignore:
Timestamp:
Dec 4, 2024 3:20:14 PM (6 weeks ago)
Author:
vboxsync
Message:

VMM: Cleaning up ARMv8 / x86 split. jiraref:VBP-1470

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp

    r107194 r107227  
    9797        return VINF_EM_RESCHEDULE;
    9898
    99 #if defined(VBOX_VMM_TARGET_ARMV8)
    100     uint64_t const uOldPc = pVCpu->cpum.GstCtx.Pc.u64;
     99#ifdef VBOX_VMM_TARGET_ARMV8
     100    uint64_t const uOldPc  = pVCpu->cpum.GstCtx.Pc.u64;
     101#elif defined(VBOX_VMM_TARGET_X86)
     102    uint64_t const uOldRip = pVCpu->cpum.GstCtx.rip;
    101103#else
    102     uint64_t const uOldRip = pVCpu->cpum.GstCtx.rip;
     104# error "port me"
    103105#endif
    104106    for (;;)
     
    147149         * Done?
    148150         */
    149 #if defined(VBOX_VMM_TARGET_ARMV8)
     151#ifdef VBOX_VMM_TARGET_ARMV8
    150152        CPUM_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_PC);
    151153        if (   (rcStrict != VINF_SUCCESS && rcStrict != VINF_EM_DBG_STEPPED)
     
    160162            return rcStrict;
    161163        }
    162 #else
     164
     165#elif defined(VBOX_VMM_TARGET_X86)
    163166        CPUM_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_RIP);
    164167        if (   (rcStrict != VINF_SUCCESS && rcStrict != VINF_EM_DBG_STEPPED)
     
    173176            return rcStrict;
    174177        }
     178
     179#else
     180# error "port me"
    175181#endif
    176182    }
     
    201207     * Log it.
    202208     */
    203 #ifdef VBOX_VMM_TARGET_ARMV8
     209# ifdef VBOX_VMM_TARGET_ARMV8
    204210    Log(("EMINS: %RGv SP_EL0=%RGv SP_EL1=%RGv\n", (RTGCPTR)pVCpu->cpum.GstCtx.Pc.u64,
    205                                                   (RTGCPTR)pVCpu->cpum.GstCtx.aSpReg[0].u64,
    206                                                   (RTGCPTR)pVCpu->cpum.GstCtx.aSpReg[1].u64));
     211         (RTGCPTR)pVCpu->cpum.GstCtx.aSpReg[0].u64, (RTGCPTR)pVCpu->cpum.GstCtx.aSpReg[1].u64));
    207212    if (pszPrefix)
    208213    {
     
    210215        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
    211216    }
    212 # else
     217# elif defined(VBOX_VMM_TARGET_X86)
    213218    Log(("EMINS: %04x:%RGv RSP=%RGv\n", pVCpu->cpum.GstCtx.cs.Sel, (RTGCPTR)pVCpu->cpum.GstCtx.rip, (RTGCPTR)pVCpu->cpum.GstCtx.rsp));
    214219    if (pszPrefix)
     
    217222        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
    218223    }
     224# else
     225#  error "port me"
    219226# endif
    220227#endif
     
    375382#ifdef VBOX_VMM_TARGET_ARMV8
    376383    LogFlow(("emR3NemExecute%d: (pc=%RGv)\n", pVCpu->idCpu, (RTGCPTR)pVCpu->cpum.GstCtx.Pc.u64));
     384#elif defined(VBOX_VMM_TARGET_X86)
     385    LogFlow(("emR3NemExecute%d: (cs:eip=%04x:%RGv)\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.cs.Sel, (RTGCPTR)pVCpu->cpum.GstCtx.rip));
    377386#else
    378     LogFlow(("emR3NemExecute%d: (cs:eip=%04x:%RGv)\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.cs.Sel, (RTGCPTR)pVCpu->cpum.GstCtx.rip));
     387# error "port me"
    379388#endif
    380389    *pfFFDone = false;
     
    411420        }
    412421
    413 #if defined(LOG_ENABLED) && !defined(VBOX_VMM_TARGET_ARMV8)
     422#ifdef LOG_ENABLED
    414423        /*
    415424         * Log important stuff before entering GC.
    416425         */
     426# ifdef VBOX_VMM_TARGET_X86
    417427        if (TRPMHasTrap(pVCpu))
    418428            Log(("CPU%d: Pending hardware interrupt=0x%x cs:rip=%04X:%RGv\n", pVCpu->idCpu, TRPMGetTrapNo(pVCpu), pVCpu->cpum.GstCtx.cs.Sel, (RTGCPTR)pVCpu->cpum.GstCtx.rip));
     
    441451            }
    442452        }
     453# elif defined(VBOX_VMM_TARGET_ARMV8)
     454        if (!(pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_PC))
     455        {
     456            /** @todo better logging */
     457            if (pVM->cCpus == 1)
     458                Log(("NEM: %RX64\n", pVCpu->cpum.GstCtx.Pc.u64));
     459            else
     460                Log(("NEM-CPU%d: %RX64\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.Pc.u64));
     461        }
     462# else
     463#  error "port me"
     464# endif
    443465        else if (pVM->cCpus == 1)
    444466            Log(("NEMRx: -> NEMR3RunGC\n"));
    445467        else
    446             Log(("NEMRx-CPU%u: -> NEMR3RunGC\n",  pVCpu->idCpu));
     468            Log(("NEMRx-CPU%u: -> NEMR3RunGC\n", pVCpu->idCpu));
    447469#endif /* LOG_ENABLED */
    448470
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