VirtualBox

Changeset 101114 in vbox


Ignore:
Timestamp:
Sep 13, 2023 3:36:26 PM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159083
Message:

VMM/CPUM: Add support for querying the ID registers presented to the guest and log more ID registers, bugref:10525

Location:
trunk
Files:
2 edited

Legend:

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

    r101103 r101114  
    848848VMMR3DECL(int)          CPUMR3PopulateFeaturesByIdRegisters(PVM pVM, PCCPUMIDREGS pIdRegs);
    849849
     850VMMR3_INT_DECL(int)     CPUMR3QueryGuestIdRegs(PVM pVM, PCCPUMIDREGS *ppIdRegs);
     851
    850852/** @} */
    851853#endif /* IN_RING3 */
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId-armv8.cpp

    r101106 r101114  
    531531
    532532
     533/**
     534 * Queries the pointer to the VM wide ID registers exposing configured features to the guest.
     535 *
     536 * @returns VBox status code.
     537 * @param   pVM                 The cross context VM structure.
     538 * @param   ppIdRegs            Where to store the pointer to the guest ID register struct.
     539 */
     540VMMR3_INT_DECL(int) CPUMR3QueryGuestIdRegs(PVM pVM, PCCPUMIDREGS *ppIdRegs)
     541{
     542    AssertPtrReturn(ppIdRegs, VERR_INVALID_POINTER);
     543
     544    *ppIdRegs = &pVM->cpum.s.GuestIdRegs;
     545    return VINF_SUCCESS;
     546}
     547
    533548
    534549/*
     
    598613    DBGFREGSUBFIELD_RO("BC\0"        "BC instruction support in AArch64",                           20, 4, 0),
    599614    DBGFREGSUBFIELD_RO("PAC_frac\0"  "ConstPACField() returns TRUE",                                24, 4, 0),
     615    DBGFREGSUBFIELD_TERMINATOR()
     616};
     617
     618
     619/** ID_AA64MMFR0_EL1 field descriptions.   */
     620static DBGFREGSUBFIELD const g_aIdAa64MmfR0Fields[] =
     621{
     622    DBGFREGSUBFIELD_RO("PARange\0"   "Physical address width",                                       0, 4, 0),
     623    DBGFREGSUBFIELD_RO("ASIDBits\0"  "Number of ASID bits",                                          4, 4, 0),
     624    DBGFREGSUBFIELD_RO("BigEnd\0"    "Mixed-endian configuration support",                           8, 4, 0),
     625    DBGFREGSUBFIELD_RO("SNSMem\0"    "Secure and Non-secure memory distinction",                    12, 4, 0),
     626    DBGFREGSUBFIELD_RO("BigEndEL0\0" "Mixed-endian support in EL0 only",                            16, 4, 0),
     627    DBGFREGSUBFIELD_RO("TGran16\0"   "16KiB memory granule size",                                   20, 4, 0),
     628    DBGFREGSUBFIELD_RO("TGran64\0"   "64KiB memory granule size",                                   24, 4, 0),
     629    DBGFREGSUBFIELD_RO("TGran4\0"    "4KiB memory granule size",                                    28, 4, 0),
     630    DBGFREGSUBFIELD_RO("TGran16_2\0" "16KiB memory granule size at stage 2",                        32, 4, 0),
     631    DBGFREGSUBFIELD_RO("TGran64_2\0" "64KiB memory granule size at stage 2",                        36, 4, 0),
     632    DBGFREGSUBFIELD_RO("TGran4_2\0"  "4KiB memory granule size at stage 2",                         40, 4, 0),
     633    DBGFREGSUBFIELD_RO("ExS\0"       "Disabling context synchronizing exception",                   44, 4, 0),
     634    DBGFREGSUBFIELD_RO("Res0\0"      "Reserved",                                                    48, 4, 0),
     635    DBGFREGSUBFIELD_RO("Res0\0"      "Reserved",                                                    52, 4, 0),
     636    DBGFREGSUBFIELD_RO("FGT\0"       "Fine-grained trap controls support",                          56, 4, 0),
     637    DBGFREGSUBFIELD_RO("ECV\0"       "Enhanced Counter Virtualization support",                      60, 4, 0),
     638    DBGFREGSUBFIELD_TERMINATOR()
     639};
     640
     641
     642/** ID_AA64MMFR1_EL1 field descriptions.   */
     643static DBGFREGSUBFIELD const g_aIdAa64MmfR1Fields[] =
     644{
     645    DBGFREGSUBFIELD_RO("HAFDBS\0"    "Hardware updates to Access/Dirty state",                       0, 4, 0),
     646    DBGFREGSUBFIELD_RO("VMIDBit\0"   "Number of VMID bits",                                          4, 4, 0),
     647    DBGFREGSUBFIELD_RO("VH\0"        "Virtualization Host Extensions",                               8, 4, 0),
     648    DBGFREGSUBFIELD_RO("HPDS\0"      "Hierarchical Permission Disables",                            12, 4, 0),
     649    DBGFREGSUBFIELD_RO("LO\0"        "LORegions support",                                           16, 4, 0),
     650    DBGFREGSUBFIELD_RO("PAN\0"       "Privileged Access Never",                                     20, 4, 0),
     651    DBGFREGSUBFIELD_RO("SpecSEI\0"   "SError interrupt exception for speculative reads",            24, 4, 0),
     652    DBGFREGSUBFIELD_RO("XNX\0"       "Execute-never control support",                               28, 4, 0),
     653    DBGFREGSUBFIELD_RO("TWED\0"      "Configurable delayed WFE trapping",                           32, 4, 0),
     654    DBGFREGSUBFIELD_RO("ETS\0"       "Enhanced Translation Synchronization support",                36, 4, 0),
     655    DBGFREGSUBFIELD_RO("HCX\0"       "HCRX_EL2 support",                                            40, 4, 0),
     656    DBGFREGSUBFIELD_RO("AFP\0"       "FPCR.{AH,FIZ,NEP} support",                                   44, 4, 0),
     657    DBGFREGSUBFIELD_RO("nTLBPA\0"    "Caching of translation table walks",                          48, 4, 0),
     658    DBGFREGSUBFIELD_RO("TIDCP1\0"    "FEAT_TIDCP1 support",                                         52, 4, 0),
     659    DBGFREGSUBFIELD_RO("CMOW\0"      "Cache maintenance instruction permission",                    56, 4, 0),
     660    DBGFREGSUBFIELD_RO("Res0\0"      "Reserved",                                                    60, 4, 0),
     661    DBGFREGSUBFIELD_TERMINATOR()
     662};
     663
     664
     665/** ID_AA64MMFR2_EL1 field descriptions.   */
     666static DBGFREGSUBFIELD const g_aIdAa64MmfR2Fields[] =
     667{
     668    DBGFREGSUBFIELD_RO("CnP\0"       "Common not Private translation support",                       0, 4, 0),
     669    DBGFREGSUBFIELD_RO("UAO\0"       "User Access Override",                                         4, 4, 0),
     670    DBGFREGSUBFIELD_RO("LSM\0"       "LSMAOE/nTLSMD bit support",                                    8, 4, 0),
     671    DBGFREGSUBFIELD_RO("IESB\0"      "IESB bit support in SCTLR_ELx",                               12, 4, 0),
     672    DBGFREGSUBFIELD_RO("VARange\0"   "Large virtual address space support",                         16, 4, 0),
     673    DBGFREGSUBFIELD_RO("CCIDX\0"     "64-bit CCSIDR_EL1 format",                                    20, 4, 0),
     674    DBGFREGSUBFIELD_RO("NV\0"        "Nested Virtualization support",                               24, 4, 0),
     675    DBGFREGSUBFIELD_RO("ST\0"        "Small translation table support",                             28, 4, 0),
     676    DBGFREGSUBFIELD_RO("AT\0"        "Unaligned single-copy atomicity support",                     32, 4, 0),
     677    DBGFREGSUBFIELD_RO("IDS\0"       "FEAT_IDST support",                                           36, 4, 0),
     678    DBGFREGSUBFIELD_RO("FWB\0"       "HCR_EL2.FWB support",                                         40, 4, 0),
     679    DBGFREGSUBFIELD_RO("Res0\0"      "Reserved",                                                    44, 4, 0),
     680    DBGFREGSUBFIELD_RO("TTL\0"       "TTL field support in address operations",                     48, 4, 0),
     681    DBGFREGSUBFIELD_RO("BBM\0"       "FEAT_BBM support",                                            52, 4, 0),
     682    DBGFREGSUBFIELD_RO("EVT\0"       "Enhanced Virtualization Traps support",                       56, 4, 0),
     683    DBGFREGSUBFIELD_RO("E0PD\0"      "E0PD mechanism support",                                      60, 4, 0),
    600684    DBGFREGSUBFIELD_TERMINATOR()
    601685};
     
    738822                                g_aIdAa64IsaR2Fields, iVerbosity > 1);
    739823
     824    cpumR3CpuIdInfoIdRegDetails(pHlp, "ID_AA64MMFR0_EL1",
     825                                pVM->cpum.s.HostIdRegs.u64RegIdAa64Mmfr0El1,
     826                                pVM->cpum.s.GuestIdRegs.u64RegIdAa64Mmfr0El1,
     827                                g_aIdAa64MmfR0Fields, iVerbosity > 1);
     828
     829    cpumR3CpuIdInfoIdRegDetails(pHlp, "ID_AA64MMFR1_EL1",
     830                                pVM->cpum.s.HostIdRegs.u64RegIdAa64Mmfr1El1,
     831                                pVM->cpum.s.GuestIdRegs.u64RegIdAa64Mmfr1El1,
     832                                g_aIdAa64MmfR1Fields, iVerbosity > 1);
     833
     834    cpumR3CpuIdInfoIdRegDetails(pHlp, "ID_AA64MMFR2_EL1",
     835                                pVM->cpum.s.HostIdRegs.u64RegIdAa64Mmfr2El1,
     836                                pVM->cpum.s.GuestIdRegs.u64RegIdAa64Mmfr2El1,
     837                                g_aIdAa64MmfR2Fields, iVerbosity > 1);
     838
    740839    /** @todo Other ID and feature registers. */
    741840}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette