VirtualBox

Ignore:
Timestamp:
Apr 20, 2024 7:05:54 PM (8 months ago)
Author:
vboxsync
Message:

VMM/GIC: Add a dedicated GIC device implementation for linux.arm64 which interfaces with the in-kernel KVM GIC device emulation, bugref:10391

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/GICAll.cpp

    r103374 r104386  
    12111211    AssertReturn(uIntId < GIC_SPI_MAX, VERR_INVALID_PARAMETER);
    12121212
    1213     PGIC       pGic    = VM_TO_GIC(pVM);
     1213    PGIC pGic = VM_TO_GIC(pVM);
     1214
     1215    /** @todo r=aeichner There must be another way to do this better, maybe create some callback interface
     1216     *                   the GIC can register. */
     1217#ifdef RT_OS_LINUX
     1218# ifdef IN_RING3
     1219    if (pGic->fKvmGic)
     1220        return GICR3KvmSpiSet(pVM, uIntId, fAsserted);
     1221# else
     1222#  error "Impossible to call the KVM in-kernel GIC from this context!"
     1223# endif
     1224#endif
     1225
    12141226    PPDMDEVINS pDevIns = pGic->CTX_SUFF(pDevIns);
    12151227    PGICDEV    pThis   = PDMDEVINS_2_DATA(pDevIns, PGICDEV);
     
    12451257    PPDMDEVINS pDevIns = VMCPU_TO_DEVINS(pVCpu);
    12461258
     1259    /** @todo r=aeichner There must be another way to do this better, maybe create some callback interface
     1260     *                   the GIC can register. */
     1261#ifdef RT_OS_LINUX
     1262# ifdef IN_RING3
     1263    PGIC pGic = VM_TO_GIC(pVCpu->pVMR3);
     1264    if (pGic->fKvmGic)
     1265        return GICR3KvmPpiSet(pVCpu, uIntId, fAsserted);
     1266# else
     1267#  error "Impossible to call the KVM in-kernel GIC from this context!"
     1268# endif
     1269#endif
     1270
    12471271    int const  rcLock  = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VERR_IGNORED);
    12481272    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, pDevIns->pCritSectRoR3, rcLock);
     
    12701294
    12711295    PPDMDEVINS pDevIns = VMCPU_TO_DEVINS(pVCpu);
     1296
     1297    /** @todo r=aeichner There must be another way to do this better, maybe create some callback interface
     1298     *                   the GIC can register. */
     1299#ifdef RT_OS_LINUX
     1300# ifdef IN_RING3
     1301    PGIC pGic = VM_TO_GIC(pVCpu->pVMR3);
     1302    /* These should be handled in the kernel and never be set from here. */
     1303    AssertReturn(!pGic->fKvmGic, VERR_NEM_IPE_6);
     1304# else
     1305#  error "Impossible to call the KVM in-kernel GIC from this context!"
     1306# endif
     1307#endif
    12721308
    12731309    int const  rcLock  = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VERR_IGNORED);
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