VirtualBox

Changeset 93626 in vbox


Ignore:
Timestamp:
Feb 6, 2022 6:04:51 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149771
Message:

VMM/MMHyper: Removed unused code. [build fix] bugref:10093

File:
1 edited

Legend:

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

    r93623 r93626  
    9292
    9393
    94 #ifdef IN_RING0
    95 /**
    96  * Lookup a host context ring-0 address.
    97  *
    98  * @returns Pointer to the corresponding lookup record.
    99  * @returns NULL on failure.
    100  * @param   pVM     The cross context VM structure.
    101  * @param   R0Ptr   The host context ring-0 address to lookup.
    102  * @param   poff    Where to store the offset into the HMA memory chunk.
    103  */
    104 DECLINLINE(PMMLOOKUPHYPER) mmHyperLookupR0(PVM pVM, RTR0PTR R0Ptr, uint32_t *poff)
    105 {
    106     AssertCompile(sizeof(RTR0PTR) == sizeof(RTR3PTR));
    107 
    108     /** @todo cache last lookup, this stuff ain't cheap! */
    109     PMMLOOKUPHYPER  pLookup = (PMMLOOKUPHYPER)((uint8_t *)pVM->mm.s.CTX_SUFF(pHyperHeap) + pVM->mm.s.offLookupHyper);
    110     for (;;)
    111     {
    112         switch (pLookup->enmType)
    113         {
    114             case MMLOOKUPHYPERTYPE_LOCKED:
    115             {
    116                 const RTR0UINTPTR off = (RTR0UINTPTR)R0Ptr - (RTR0UINTPTR)pLookup->u.Locked.pvR0;
    117                 if (off < pLookup->cb && pLookup->u.Locked.pvR0)
    118                 {
    119                     *poff = off;
    120                     return pLookup;
    121                 }
    122                 break;
    123             }
    124 
    125             case MMLOOKUPHYPERTYPE_HCPHYS:
    126             {
    127                 const RTR0UINTPTR off = (RTR0UINTPTR)R0Ptr - (RTR0UINTPTR)pLookup->u.HCPhys.pvR0;
    128                 if (off < pLookup->cb && pLookup->u.HCPhys.pvR0)
    129                 {
    130                     *poff = off;
    131                     return pLookup;
    132                 }
    133                 break;
    134             }
    135 
    136             case MMLOOKUPHYPERTYPE_GCPHYS:  /* (for now we'll not allow these kind of conversions) */
    137             case MMLOOKUPHYPERTYPE_MMIO2:
    138             case MMLOOKUPHYPERTYPE_DYNAMIC:
    139                 break;
    140 
    141             default:
    142                 AssertMsgFailed(("enmType=%d\n", pLookup->enmType));
    143                 break;
    144         }
    145 
    146         /* next */
    147         if (pLookup->offNext ==  (int32_t)NIL_OFFSET)
    148             break;
    149         pLookup = (PMMLOOKUPHYPER)((uint8_t *)pLookup + pLookup->offNext);
    150     }
    151 
    152     AssertMsgFailed(("R0Ptr=%RHv is not inside the hypervisor memory area!\n", R0Ptr));
    153     return NULL;
    154 }
    155 #endif /* IN_RING0 */
    156 
    157 
    15894#ifdef IN_RING3
    15995/**
     
    168104DECLINLINE(PMMLOOKUPHYPER) mmHyperLookupCC(PVM pVM, void *pv, uint32_t *poff)
    169105{
    170 # ifdef IN_RING0
    171     return mmHyperLookupR0(pVM, pv, poff);
    172 # elif defined(IN_RING3)
    173106    return mmHyperLookupR3(pVM, pv, poff);
    174 # else
    175 #  error "Neither IN_RING0 nor IN_RING3!"
    176 # endif
    177107}
    178108#endif
     
    280210        return mmHyperLookupCalcR0(pVM, pLookup, off);
    281211    return NULL;
    282 }
    283 #endif
    284 
    285 
    286 #ifndef IN_RING0
    287 /**
    288  * Converts a current context address in the Hypervisor memory region to a ring-0 host context address.
    289  *
    290  * @returns ring-0 host context address.
    291  * @param   pVM         The cross context VM structure.
    292  * @param   pv          The current context address.
    293  *                      You'll be damned if this is not in the HMA! :-)
    294  * @thread  The Emulation Thread.
    295  */
    296 VMMDECL(RTR0PTR) MMHyperCCToR0(PVM pVM, void *pv)
    297 {
    298     uint32_t off;
    299     PMMLOOKUPHYPER pLookup = mmHyperLookupCC(pVM, pv, &off);
    300     if (pLookup)
    301         return mmHyperLookupCalcR0(pVM, pLookup, off);
    302     return NIL_RTR0PTR;
    303212}
    304213#endif
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