VirtualBox

Changeset 103374 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Feb 14, 2024 10:10:00 PM (11 months ago)
Author:
vboxsync
Message:

VMM/PGM,DBGF,GIC: Parfait pointed out some potential NULL pointer use here and there. bugref:3409

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

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

    r102559 r103374  
    848848        else
    849849        {
    850             PVMCPU pVCpu = VMMGetCpuById(pUVM->pVM, idCpu);
    851             CPUMMODE enmCpuMode = CPUMGetGuestMode(pVCpu);
     850            PVMCPU const   pVCpu      = pUVM->pVM->apCpusR3[idCpu];
     851            CPUMMODE const enmCpuMode = CPUMGetGuestMode(pVCpu);
    852852            if (enmCpuMode == CPUMMODE_REAL)
    853853            {
     
    10291029    {
    10301030        case DBGFCODETYPE_GUEST:
    1031             pCtx = CPUMQueryGuestCtxPtr(VMMGetCpuById(pVM, idCpu));
     1031            pCtx = CPUMQueryGuestCtxPtr(pVM->apCpusR3[idCpu]);
    10321032            hAs  = DBGF_AS_GLOBAL;
    10331033            break;
    10341034        case DBGFCODETYPE_HYPER:
    1035             pCtx = CPUMQueryGuestCtxPtr(VMMGetCpuById(pVM, idCpu));
     1035            pCtx = CPUMQueryGuestCtxPtr(pVM->apCpusR3[idCpu]);
    10361036            hAs  = DBGF_AS_RC_AND_GC_GLOBAL;
    10371037            break;
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r100101 r103374  
    12961296
    12971297#if defined(VBOX_VMM_TARGET_ARMV8)
     1298
    12981299/**
    12991300 * VCPU worker for VMMR3CpuOn.
     
    13061307static DECLCALLBACK(int) vmmR3CpuOn(PVM pVM, VMCPUID idCpu, RTGCPHYS GCPhysExecAddr, uint64_t u64CtxId)
    13071308{
    1308     PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
     1309    PVMCPU pVCpu = pVM->apCpusR3[idCpu];
    13091310    VMCPU_ASSERT_EMT(pVCpu);
    13101311
     
    13461347    AssertRC(rc);
    13471348}
    1348 #else
     1349
     1350#else /* !VBOX_VMM_TARGET_ARMV8 */
     1351
    13491352/**
    13501353 * VCPU worker for VMMR3SendStartupIpi.
     
    13561359static DECLCALLBACK(int) vmmR3SendStartupIpi(PVM pVM, VMCPUID idCpu, uint32_t uVector)
    13571360{
    1358     PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
     1361    PVMCPU pVCpu = pVM->apCpusR3[idCpu];
    13591362    VMCPU_ASSERT_EMT(pVCpu);
    13601363
     
    14111414static DECLCALLBACK(int) vmmR3SendInitIpi(PVM pVM, VMCPUID idCpu)
    14121415{
    1413     PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
     1416    PVMCPU pVCpu = pVM->apCpusR3[idCpu];
    14141417    VMCPU_ASSERT_EMT(pVCpu);
    14151418
     
    14201423
    14211424    /* If the CPU is in VMX non-root mode, INIT signals cause VM-exits. */
    1422 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     1425# ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    14231426    PCCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    14241427    if (CPUMIsGuestInVmxNonRootMode(pCtx))
    14251428        return VBOXSTRICTRC_TODO(IEMExecVmxVmexit(pVCpu, VMX_EXIT_INIT_SIGNAL, 0 /* uExitQual */));
    1426 #endif
     1429# endif
    14271430
    14281431    /** @todo Figure out how to handle a SVM nested-guest intercepts here for INIT
     
    14311434    PGMR3ResetCpu(pVM, pVCpu);
    14321435    PDMR3ResetCpu(pVCpu);   /* Only clears pending interrupts force flags */
    1433 #if !defined(VBOX_VMM_TARGET_ARMV8)
     1436# if !defined(VBOX_VMM_TARGET_ARMV8)
    14341437    APICR3InitIpi(pVCpu);
    1435 #endif
     1438# endif
    14361439    TRPMR3ResetCpu(pVCpu);
    14371440    CPUMR3ResetCpu(pVM, pVCpu);
     
    14751478    AssertRC(rc);
    14761479}
    1477 #endif
    1478 
     1480
     1481#endif /* !VBOX_VMM_TARGET_ARMV8 */
    14791482
    14801483/**
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