VirtualBox

Changeset 105687 in vbox


Ignore:
Timestamp:
Aug 15, 2024 12:45:46 PM (6 weeks ago)
Author:
vboxsync
Message:

VMMArm/GIC: Rename GICR3Kvm to GICR3Nem and add a stub for macOS Hypervisor.framework which will be handled by the NEM backend directly due to the hv_gic_* API being entangled with the rest of the hv_* API, bugref:10747

Location:
trunk
Files:
1 added
6 edited
1 moved

Legend:

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

    r104386 r105687  
    5252#ifdef VBOX_INCLUDED_vmm_pdmdev_h
    5353extern const PDMDEVREG g_DeviceGIC;
    54 # ifdef RT_OS_LINUX
    55 extern const PDMDEVREG g_DeviceGICKvm;
    56 # endif
     54extern const PDMDEVREG g_DeviceGICNem;
    5755#endif
    5856
     
    7169VMMR3_INT_DECL(void)        GICR3InitIpi(PVMCPU pVCpu);
    7270
    73 # ifdef RT_OS_LINUX
    74 /* Access to the in-kernel KVM GICv3. */
    75 VMMR3_INT_DECL(int)         GICR3KvmSpiSet(PVMCC pVM, uint32_t uIntId, bool fAsserted);
    76 VMMR3_INT_DECL(int)         GICR3KvmPpiSet(PVMCPUCC pVCpu, uint32_t uIntId, bool fAsserted);
    77 # endif
     71/* Access to the NEM provided GICv3. */
     72VMMR3_INT_DECL(int)         GICR3NemSpiSet(PVMCC pVM, uint32_t uIntId, bool fAsserted);
     73VMMR3_INT_DECL(int)         GICR3NemPpiSet(PVMCPUCC pVCpu, uint32_t uIntId, bool fAsserted);
    7874/** @} */
    7975#endif /* IN_RING3 */
  • trunk/src/VBox/VMM/Makefile.kmk

    r104947 r105687  
    501501
    502502 VBoxVMMArm_SOURCES.darwin.arm64 += \
    503         VMMR3/NEMR3Native-darwin-armv8.cpp
     503        VMMR3/NEMR3Native-darwin-armv8.cpp \
     504        VMMR3/GICR3Nem-darwin.cpp
    504505 VBoxVMMArm_DEFS.darwin.arm64   += VBOX_WITH_NATIVE_NEM
    505506 VBoxVMMArm_LDFLAGS.darwin.arm64 = -framework Hypervisor
     
    507508 VBoxVMMArm_SOURCES.linux.arm64 += \
    508509        VMMR3/NEMR3Native-linux-armv8.cpp \
    509         VMMR3/GICR3Kvm.cpp
     510        VMMR3/GICR3Nem-linux.cpp
    510511 VBoxVMMArm_DEFS.linux.arm64    += VBOX_WITH_NATIVE_NEM
    511512
  • trunk/src/VBox/VMM/VMMAll/GICAll.cpp

    r104386 r105687  
    12151215    /** @todo r=aeichner There must be another way to do this better, maybe create some callback interface
    12161216     *                   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
     1217#ifdef IN_RING3
     1218    if (pGic->fNemGic)
     1219        return GICR3NemSpiSet(pVM, uIntId, fAsserted);
     1220#else
     1221# error "Impossible to call the NEM in-kernel GIC from this context!"
    12241222#endif
    12251223
     
    12591257    /** @todo r=aeichner There must be another way to do this better, maybe create some callback interface
    12601258     *                   the GIC can register. */
    1261 #ifdef RT_OS_LINUX
    1262 # ifdef IN_RING3
     1259#ifdef IN_RING3
    12631260    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
     1261    if (pGic->fNemGic)
     1262        return GICR3NemPpiSet(pVCpu, uIntId, fAsserted);
     1263#else
     1264# error "Impossible to call the NEM in-kernel GIC from this context!"
    12691265#endif
    12701266
  • trunk/src/VBox/VMM/VMMR3/GICR3.cpp

    r100758 r105687  
    7070    GIC_SYSREGRANGE(ARMV8_AARCH64_SYSREG_ICC_DIR_EL1,   ARMV8_AARCH64_SYSREG_ICC_SGI0R_EL1,   "ICC_DIR_EL1 - ICC_SGI0R_EL1"),
    7171    GIC_SYSREGRANGE(ARMV8_AARCH64_SYSREG_ICC_IAR1_EL1,  ARMV8_AARCH64_SYSREG_ICC_IGRPEN1_EL1, "ICC_IAR1_EL1 - ICC_IGRPEN1_EL1"),
     72    GIC_SYSREGRANGE(ARMV8_AARCH64_SYSREG_ICC_SRE_EL2,   ARMV8_AARCH64_SYSREG_ICC_SRE_EL2,     "ICC_SRE_EL2")
    7273};
    7374
  • trunk/src/VBox/VMM/VMMR3/GICR3Nem-linux.cpp

    r105686 r105687  
    138138 * @param   fAsserted   Flag whether the interrupt is asserted (true) or not (false).
    139139 */
    140 VMMR3_INT_DECL(int) GICR3KvmSpiSet(PVMCC pVM, uint32_t uIntId, bool fAsserted)
     140VMMR3_INT_DECL(int) GICR3NemSpiSet(PVMCC pVM, uint32_t uIntId, bool fAsserted)
    141141{
    142142    PGIC pGic = VM_TO_GIC(pVM);
     
    157157 * @param   fAsserted   Flag whether the interrupt is asserted (true) or not (false).
    158158 */
    159 VMMR3_INT_DECL(int) GICR3KvmPpiSet(PVMCPUCC pVCpu, uint32_t uIntId, bool fAsserted)
     159VMMR3_INT_DECL(int) GICR3NemPpiSet(PVMCPUCC pVCpu, uint32_t uIntId, bool fAsserted)
    160160{
    161161    PPDMDEVINS pDevIns = VMCPU_TO_DEVINS(pVCpu);
     
    276276     */
    277277    pGic->pDevInsR3 = pDevIns;
    278     pGic->fKvmGic   = true;
     278    pGic->fNemGic   = true;
    279279    pThis->pDevIns  = pDevIns;
    280280    pThis->fdKvmVm  = pVM->nem.s.fdVm;
     
    359359 * GIC device registration structure.
    360360 */
    361 const PDMDEVREG g_DeviceGICKvm =
     361const PDMDEVREG g_DeviceGICNem =
    362362{
    363363    /* .u32Version = */             PDM_DEVREG_VERSION,
    364364    /* .uReserved0 = */             0,
    365     /* .szName = */                 "gic-kvm",
     365    /* .szName = */                 "gic-nem",
    366366    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_NEW_STYLE,
    367367    /* .fClass = */                 PDM_DEVREG_CLASS_PIC,
  • trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp

    r104386 r105687  
    686686    AssertRCReturn(rc, rc);
    687687
    688 # ifdef RT_OS_LINUX
    689     /*
    690      * Register the internal VMM GIC device, KVM variant.
    691      */
    692     rc = pdmR3DevReg_Register(&RegCB.Core, &g_DeviceGICKvm);
     688    /*
     689     * Register the internal VMM GIC device, NEM variant.
     690     */
     691    rc = pdmR3DevReg_Register(&RegCB.Core, &g_DeviceGICNem);
    693692    AssertRCReturn(rc, rc);
    694 # endif
    695693#else
    696694    /*
  • trunk/src/VBox/VMM/include/GICInternal.h

    r104386 r105687  
    101101    /** The ring-3 device instance. */
    102102    PPDMDEVINSR3                pDevInsR3;
    103 #ifdef RT_OS_LINUX
    104     /** Flag whether the in-kernel KVM GIC is used. */
    105     bool                        fKvmGic;
    106 #endif
     103    /** Flag whether the GIC provided by NEM is used. */
     104    bool                        fNemGic;
    107105} GIC;
    108106/** Pointer to GIC VM instance data. */
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