VirtualBox

Changeset 99385 in vbox


Ignore:
Timestamp:
Apr 13, 2023 11:05:39 AM (20 months ago)
Author:
vboxsync
Message:

VMM/ArmV8: Skeleton of the GICv3 interrupt controller emulation, bugref:10404

Location:
trunk
Files:
3 added
7 edited

Legend:

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

    r99383 r99385  
    6666    kCpumSysRegRdFn_WriteOnly,
    6767
     68    /** Read from a GICv3 PE ICC system register. */
     69    kCpumSysRegRdFn_GicV3Icc,
     70
    6871    /** End of valid system register read function indexes. */
    6972    kCpumSysRegRdFn_End
     
    8689     * kCpumSysRegRdFn_Alias. */
    8790    kCpumSysRegWrFn_Alias,
     91
     92    /** Write to a GICv3 PE ICC system register. */
     93    kCpumSysRegWrFn_GicV3Icc,
    8894
    8995    /** End of valid system register write function indexes. */
  • trunk/include/VBox/vmm/vm.h

    r98993 r99385  
    269269    } gim;
    270270
     271#if defined(VBOX_VMM_TARGET_ARMV8)
     272    /** GIC part. */
     273    union VMCPUUNIONGIC
     274    {
     275# ifdef VMM_INCLUDED_SRC_include_GICInternal_h
     276        struct GICCPU       s;
     277# endif
     278        uint8_t             padding[3840];      /* multiple of 64 */
     279    } gic;
     280#else
    271281    /** APIC part. */
    272282    union VMCPUUNIONAPIC
    273283    {
    274 #ifdef VMM_INCLUDED_SRC_include_APICInternal_h
     284# ifdef VMM_INCLUDED_SRC_include_APICInternal_h
    275285        struct APICCPU      s;
    276 #endif
     286# endif
    277287        uint8_t             padding[3840];      /* multiple of 64 */
    278288    } apic;
     289#endif
    279290
    280291    /*
     
    14331444    } gim;
    14341445
    1435     union
    1436     {
    1437 #ifdef VMM_INCLUDED_SRC_include_APICInternal_h
     1446#if defined(VBOX_VMM_TARGET_ARMV8)
     1447    union
     1448    {
     1449# ifdef VMM_INCLUDED_SRC_include_GICInternal_h
     1450        struct GIC  s;
     1451# endif
     1452        uint8_t     padding[128];       /* multiple of 8 */
     1453    } gic;
     1454#else
     1455    union
     1456    {
     1457# ifdef VMM_INCLUDED_SRC_include_APICInternal_h
    14381458        struct APIC s;
    1439 #endif
     1459# endif
    14401460        uint8_t     padding[128];       /* multiple of 8 */
    14411461    } apic;
     1462#endif
    14421463
    14431464    /* ---- begin small stuff ---- */
  • trunk/include/VBox/vmm/vm.mac

    r98103 r99385  
    8989    .gim                    resb 512
    9090    alignb 64
     91%ifdef VBOX_VMM_TARGET_ARMV8
     92    .gic                    resb 3840
     93%else
    9194    .apic                   resb 3840
     95%endif
    9296
    9397    alignb 64
     
    169173    .gim                    resb 448
    170174    alignb 64
     175%ifdef VBOX_VMM_TARGET_ARMV8
     176    .gic                    resb 128
     177%else
    171178    .apic                   resb 128
     179%endif
    172180    alignb 64
    173181    .vm                     resb 32
  • trunk/src/VBox/VMM/Makefile.kmk

    r99383 r99385  
    375375        VMMR3/EMR3Dbg.cpp \
    376376        VMMR3/EMR3Nem.cpp \
     377        VMMR3/GICR3.cpp \
    377378        VMMR3/GIM.cpp \
    378379        VMMR3/IEMR3.cpp \
     
    432433        VMMAll/PGMAllPool.cpp \
    433434        VMMAll/EMAll.cpp \
     435        VMMAll/GICAll.cpp \
    434436        VMMAll/GIMAll.cpp \
    435437        VMMAll/TMAll.cpp \
  • trunk/src/VBox/VMM/VMMAll/CPUMAllSysRegs-armv8.cpp

    r99196 r99385  
    3333#include <VBox/vmm/cpum.h>
    3434#include "CPUMInternal-armv8.h"
     35#include <VBox/vmm/gic.h>
    3536#include <VBox/vmm/vmcc.h>
    3637#include <VBox/err.h>
     
    143144
    144145
     146/** @callback_method_impl{FNCPUMRDMSR} */
     147static DECLCALLBACK(VBOXSTRICTRC) cpumSysRegRd_GicV3Icc(PVMCPUCC pVCpu, uint32_t idSysReg, PCCPUMSYSREGRANGE pRange, uint64_t *puValue)
     148{
     149    RT_NOREF_PV(pRange);
     150    return GICReadSysReg(pVCpu, idSysReg, puValue);
     151}
     152
     153
     154/** @callback_method_impl{FNCPUMWRMSR} */
     155static DECLCALLBACK(VBOXSTRICTRC) cpumSysRegWr_GicV3Icc(PVMCPUCC pVCpu, uint32_t idSysReg, PCCPUMSYSREGRANGE pRange, uint64_t uValue, uint64_t uRawValue)
     156{
     157    RT_NOREF_PV(pRange); RT_NOREF_PV(uRawValue);
     158    return GICWriteSysReg(pVCpu, idSysReg, uValue);
     159}
     160
    145161
    146162/**
     
    153169    { NULL }, /* Alias */
    154170    { cpumSysRegRd_WriteOnly },
     171    { cpumSysRegRd_GicV3Icc  },
    155172};
    156173
     
    165182    { cpumSysRegWr_ReadOnly },
    166183    { NULL }, /* Alias */
     184    { cpumSysRegWr_GicV3Icc },
    167185};
    168186
     
    396414 * @returns VINF_SUCCESS on success, error on failure.
    397415 */
    398 int cpumR3SysRegStrictInitChecks(void)
     416DECLHIDDEN(int) cpumR3SysRegStrictInitChecks(void)
    399417{
    400418#define CPUM_ASSERT_RD_SYSREG_FN(a_Register) \
     
    406424    CPUM_ASSERT_RD_SYSREG_FN(FixedValue);
    407425    CPUM_ASSERT_RD_SYSREG_FN(WriteOnly);
     426    CPUM_ASSERT_RD_SYSREG_FN(GicV3Icc);
    408427
    409428    AssertReturn(g_aCpumWrSysRegFns[kCpumSysRegWrFn_Invalid].pfnWrSysReg == NULL, VERR_CPUM_IPE_2);
     429    CPUM_ASSERT_WR_SYSREG_FN(IgnoreWrite);
     430    CPUM_ASSERT_WR_SYSREG_FN(ReadOnly);
     431    CPUM_ASSERT_WR_SYSREG_FN(GicV3Icc);
    410432
    411433    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp

    r99051 r99385  
    3434#include "PDMInternal.h"
    3535#include <VBox/vmm/pdm.h>
    36 #include <VBox/vmm/apic.h>
     36#if defined(VBOX_VMM_TARGET_ARMV8)
     37# include <VBox/vmm/gic.h>
     38#else
     39# include <VBox/vmm/apic.h>
     40#endif
    3741#include <VBox/vmm/cfgm.h>
    3842#include <VBox/vmm/dbgf.h>
     
    676680
    677681#if defined(VBOX_VMM_TARGET_ARMV8)
    678     int rc;
     682    /*
     683     * Register the internal VMM GIC device.
     684     */
     685    int rc = pdmR3DevReg_Register(&RegCB.Core, &g_DeviceGIC);
     686    AssertRCReturn(rc, rc);
    679687#else
    680688    /*
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r99051 r99385  
    130130#include <VBox/sup.h>
    131131#include <VBox/vmm/dbgf.h>
    132 #include <VBox/vmm/apic.h>
     132#if defined(VBOX_VMM_TARGET_ARMV8)
     133# include <VBox/vmm/gic.h>
     134#else
     135# include <VBox/vmm/apic.h>
     136#endif
    133137#include <VBox/vmm/ssm.h>
    134138#include <VBox/vmm/tm.h>
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