VirtualBox

Changeset 27341 in vbox for trunk/src


Ignore:
Timestamp:
Mar 12, 2010 7:17:05 PM (15 years ago)
Author:
vboxsync
Message:

APIC: hack to reduce OSX guests idle state CPU consumption

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r27305 r27341  
    21632163}
    21642164
     2165/**
     2166 * This function is a hack, intended to minimize impact of not fully implemented power management support
     2167 * on OSX guests. We do nothing smarter than make access to certain register (ISR status for LVT[6])
     2168 * rather long operation from the guest's perspective.
     2169 * To be removed once real reasons why power saving states not reached by OSX will be figured out.
     2170 * Hack seems to be safe, as guests rarely access this particular register.
     2171 */
     2172int checkHeavyRegistersPolling(APICDeviceInfo * pThis, RTGCPHYS GCPhysAddr)
     2173{
     2174    int index = (GCPhysAddr >> 4) & 0xff;
     2175
     2176    /* We pick up rarely accessed IRR status register for this check */
     2177    if (index != 0x26)
     2178        return VINF_SUCCESS;
     2179
     2180#ifdef IN_RING3
     2181    RTThreadSleep(10);
     2182    return VINF_SUCCESS;
     2183#else
     2184    return VINF_IOM_HC_MMIO_READ;
     2185#endif
     2186}
     2187
    21652188#ifdef VBOX
    21662189static
     
    24282451#endif
    24292452#endif /* experimental */
     2453            int rc = checkHeavyRegistersPolling(dev, GCPhysAddr);
     2454            if (rc != VINF_SUCCESS)
     2455                return rc;
    24302456            APIC_LOCK(dev, VINF_IOM_HC_MMIO_READ);
    24312457            *(uint32_t *)pv = apic_mem_readl(dev, s, GCPhysAddr);
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