VirtualBox

Changeset 92120 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Oct 28, 2021 12:31:35 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147939
Message:

VMM/NEM/win: New approach to A20: Reschedule to IEM. Logging. bugref:10122

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/NEMR3.cpp

    r91848 r92120  
    406406
    407407
     408#ifndef VBOX_WITH_NATIVE_NEM
    408409VMMR3_INT_DECL(bool) NEMR3CanExecuteGuest(PVM pVM, PVMCPU pVCpu)
    409410{
    410     Assert(VM_IS_NEM_ENABLED(pVM));
    411 #ifdef VBOX_WITH_NATIVE_NEM
    412     return nemR3NativeCanExecuteGuest(pVM, pVCpu);
    413 #else
    414     NOREF(pVM); NOREF(pVCpu);
     411    RT_NOREF(pVM, pVCpu);
    415412    return false;
    416 #endif
    417 }
     413}
     414#endif
    418415
    419416
     
    441438
    442439
     440#ifndef VBOX_WITH_NATIVE_NEM
    443441VMMR3_INT_DECL(void) NEMR3NotifySetA20(PVMCPU pVCpu, bool fEnabled)
    444442{
    445 #ifdef VBOX_WITH_NATIVE_NEM
    446     if (pVCpu->pVMR3->bMainExecutionEngine == VM_EXEC_ENGINE_NATIVE_API)
    447         nemR3NativeNotifySetA20(pVCpu, fEnabled);
    448 #else
    449     NOREF(pVCpu); NOREF(fEnabled);
    450 #endif
    451 }
    452 
     443    RT_NOREF(pVCpu, fEnabled);
     444}
     445#endif
     446
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r91958 r92120  
    12791279     * Some state init.
    12801280     */
     1281#ifdef NEM_WIN_WITH_A20
    12811282    pVM->nem.s.fA20Enabled = true;
     1283#endif
    12821284#if 0
    12831285    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
     
    18141816void nemR3NativeReset(PVM pVM)
    18151817{
     1818#if 0
    18161819    /* Unfix the A20 gate. */
    18171820    pVM->nem.s.fA20Fixed = false;
     1821#else
     1822    RT_NOREF(pVM);
     1823#endif
    18181824}
    18191825
     
    18281834void nemR3NativeResetCpu(PVMCPU pVCpu, bool fInitIpi)
    18291835{
     1836#ifdef NEM_WIN_WITH_A20
    18301837    /* Lock the A20 gate if INIT IPI, make sure it's enabled.  */
    18311838    if (fInitIpi && pVCpu->idCpu > 0)
     
    18371844        pVM->nem.s.fA20Fixed   = true;
    18381845    }
     1846#else
     1847    RT_NOREF(pVCpu, fInitIpi);
     1848#endif
    18391849}
    18401850
     
    18861896
    18871897
    1888 bool nemR3NativeCanExecuteGuest(PVM pVM, PVMCPU pVCpu)
    1889 {
    1890     NOREF(pVM); NOREF(pVCpu);
     1898VMMR3_INT_DECL(bool) NEMR3CanExecuteGuest(PVM pVM, PVMCPU pVCpu)
     1899{
     1900    Assert(VM_IS_NEM_ENABLED(pVM));
     1901
     1902#ifndef NEM_WIN_WITH_A20
     1903    /*
     1904     * Only execute when the A20 gate is enabled because this lovely Hyper-V
     1905     * blackbox does not seem to have any way to enable or disable A20.
     1906     */
     1907    RT_NOREF(pVM);
     1908    return PGMPhysIsA20Enabled(pVCpu);
     1909#else
     1910    RT_NOREF(pVM, pVCpu);
    18911911    return true;
     1912#endif
    18921913}
    18931914
     
    20232044        *pu2State = NEM_WIN_PAGE_STATE_UNMAPPED;
    20242045    }
     2046    RT_NOREF(pvRam);
    20252047
    20262048#else
     
    22062228
    22072229
     2230#ifdef NEM_WIN_WITH_A20
    22082231/**
    22092232 * Unmaps a page from Hyper-V for the purpose of emulating A20 gate behavior.
     
    22202243                                     nemR3WinUnsetForA20CheckerCallback, NULL);
    22212244}
     2245#endif
    22222246
    22232247
     
    22322256 * @param   fEnabled        Whether it was enabled (true) or disabled.
    22332257 */
    2234 void nemR3NativeNotifySetA20(PVMCPU pVCpu, bool fEnabled)
     2258VMMR3_INT_DECL(void) NEMR3NotifySetA20(PVMCPU pVCpu, bool fEnabled)
    22352259{
    22362260    Log(("nemR3NativeNotifySetA20: fEnabled=%RTbool\n", fEnabled));
     2261    Assert(VM_IS_NEM_ENABLED(pVCpu->CTX_SUFF(pVM)));
     2262#ifdef NEM_WIN_WITH_A20
    22372263    PVM pVM = pVCpu->CTX_SUFF(pVM);
    22382264    if (!pVM->nem.s.fA20Fixed)
     
    22422268            nemR3WinUnmapPageForA20Gate(pVM, pVCpu, GCPhys);
    22432269    }
     2270#else
     2271    RT_NOREF(pVCpu, fEnabled);
     2272#endif
    22442273}
    22452274
     
    24462475 *   (e.g. possiblity of two CPUs with different A20 status).
    24472476 *
    2448  *   Workaround: Only do A20 on CPU 0, restricting the emulation to HMA.  We
    2449  *   unmap all pages related to HMA (0x100000..0x10ffff) when the A20 state
    2450  *   changes, lazily syncing the right pages back when accessed.
     2477 *   Workaround #1 (obsolete): Only do A20 on CPU 0, restricting the emulation
     2478 *   to HMA. We unmap all pages related to HMA (0x100000..0x10ffff) when the A20
     2479 *   state changes, lazily syncing the right pages back when accessed.
     2480 *
     2481 *   Workaround #2 (used): Use IEM when the A20 gate is disabled.
    24512482 *
    24522483 *
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