VirtualBox

Changeset 23200 in vbox


Ignore:
Timestamp:
Sep 21, 2009 4:13:38 PM (15 years ago)
Author:
vboxsync
Message:

Extend to all use cases of RTMpPokeCpu

File:
1 edited

Legend:

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

    r23198 r23200  
    104104}
    105105
     106#ifdef IN_RING0
     107/**
     108 * Dummy RTMpOnSpecific handler since RTMpPokeCpu couldn't be used.
     109 *
     110 */
     111static DECLCALLBACK(void) hwaccmFlushHandler(RTCPUID idCpu, void *pvUser1, void *pvUser2)
     112{
     113    return;
     114}
     115
     116/**
     117 * Wrapper for RTMpPokeCpu to deal with VERR_NOT_SUPPORTED
     118 *
     119 */
     120void hwaccmMpPokeCpu(RTCPUID idHostCpu)
     121{
     122    int rc = RTMpPokeCpu(idHostCpu);
     123# ifdef RT_OS_WINDOWS
     124    AssertRC(rc);
     125# else
     126    /* Not implemented on some platforms (Darwin, Linux kernel < 2.6.19); fall back to a less efficient implementation (broadcast). */
     127    if (rc == VERR_NOT_SUPPORTED)
     128        RTMpOnSpecific(idHostCpu, hwaccmFlushHandler, 0, 0);
     129# endif
     130}
     131#endif
     132
    106133#ifndef IN_RC
    107134/**
     
    133160                RTCPUID idHostCpu = pVCpu->hwaccm.s.idEnteredCpu;
    134161                if (idHostCpu != NIL_RTCPUID)
    135                     RTMpPokeCpu(idHostCpu);
     162                    hwaccmMpPokeCpu(idHostCpu);
    136163#else
    137164                VMR3NotifyCpuFFU(pVCpu->pUVCpu, VMNOTIFYFF_FLAGS_POKE);
     
    148175
    149176/**
    150  * Dummy RTMpOnSpecific handler since RTMpPokeCpu couldn't be used.
    151  *
    152  */
    153 static DECLCALLBACK(void) hwaccmFlushHandler(RTCPUID idCpu, void *pvUser1, void *pvUser2)
    154 {
    155     return;
    156 }
    157 
    158 
    159 /**
    160177 * Flush the TLBs of all VCPUs
    161178 *
     
    188205            RTCPUID idHostCpu = pVCpu->hwaccm.s.idEnteredCpu;
    189206            if (idHostCpu != NIL_RTCPUID)
    190             {
    191                 int rc = RTMpPokeCpu(idHostCpu);
    192 # ifdef RT_OS_WINDOWS
    193                 AssertRC(rc);
    194 # else
    195                 /* Not implemented on some platforms (Darwin, Linux kernel < 2.6.19); fall back to a less efficient implementation (broadcast). */
    196                 if (rc == VERR_NOT_SUPPORTED)
    197                     RTMpOnSpecific(idHostCpu, hwaccmFlushHandler, 0, 0);
    198 # endif
    199             }
     207                hwaccmMpPokeCpu(idHostCpu);
    200208#else
    201209            VMR3NotifyCpuFFU(pVCpu->pUVCpu, VMNOTIFYFF_FLAGS_POKE);
     
    269277            {
    270278                STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatTlbShootdownFlush);
    271     #ifdef IN_RING0
     279# ifdef IN_RING0
    272280                RTCPUID idHostCpu = pVCpu->hwaccm.s.idEnteredCpu;
    273281                if (idHostCpu != NIL_RTCPUID)
    274                     RTMpPokeCpu(idHostCpu);
    275     #else
     282                    hwaccmMpPokeCpu(idHostCpu);
     283# else
    276284                VMR3NotifyCpuFFU(pVCpu->pUVCpu, VMNOTIFYFF_FLAGS_POKE);
    277     #endif
     285# endif
    278286            }
    279287            else
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