VirtualBox

Changeset 45701 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Apr 24, 2013 2:21:09 PM (12 years ago)
Author:
vboxsync
Message:

VMM: SELM and VMM early HM init changes.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
5 edited

Legend:

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

    r45620 r45701  
    15381538# endif
    15391539# ifdef VBOX_WITH_RAW_MODE
    1540         if ((val ^ oldval) & X86_CR4_VME)
     1540        if (((val ^ oldval) & X86_CR4_VME) && !HMIsEnabled(pVM))
    15411541            VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS);
    15421542# endif
  • trunk/src/VBox/VMM/VMMAll/HMAll.cpp

    r45618 r45701  
    3838
    3939/**
    40  * Query HM state (enabled/disabled)
    41  *
    42  * @returns @c false if disabled, @c true if enabled.
     40 * Checks whether HM (VT-x/AMD-V) is being used by this VM.
     41 *
     42 * @retval  @c true if used.
     43 * @retval  @c false if software virtualization (raw-mode) is used.
    4344 * @param   pVM         The cross context VM structure.
    4445 * @sa      HMIsEnabled, HMR3IsEnabled
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r45531 r45701  
    8787#include <VBox/vmm/iom.h>
    8888#include <VBox/vmm/em.h>
     89#include <VBox/vmm/hm.h>
    8990#include <VBox/vmm/tm.h>
    9091#include <VBox/vmm/dbgf.h>
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h

    r45533 r45701  
    34173417                         RT_BOOL(uOldCrX & X86_CR4_VME), RT_BOOL(uNewCrX & X86_CR4_VME) ));
    34183418#ifdef VBOX_WITH_RAW_MODE
    3419                     VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS);
     3419                    if (!HMIsEnabled(IEMCPU_TO_VM(pIemCpu)))
     3420                        VMCPU_FF_SET(pVCpu, VMCPU_FF_SELM_SYNC_TSS);
    34203421#endif
    34213422                }
  • trunk/src/VBox/VMM/VMMAll/SELMAll.cpp

    r45485 r45701  
    2525#include <VBox/vmm/em.h>
    2626#include <VBox/vmm/mm.h>
     27#include <VBox/vmm/hm.h>
    2728#include <VBox/vmm/pgm.h>
    2829#include <VBox/vmm/hm.h>
     
    6465{
    6566    Assert(pVM->cCpus == 1 && !CPUMIsGuestInLongMode(VMMGetCpu(pVM)));    /* DON'T USE! */
     67    Assert(!HMIsEnabled(pVM));
    6668
    6769    /** @todo check the limit. */
     
    322324{
    323325    Assert(!CPUMIsGuestInLongMode(pVCpu));    /* DON'T USE! (Accessing shadow GDT/LDT.) */
     326    Assert(!HMIsEnabled(pVCpu->CTX_SUFF(pVM)));
    324327
    325328    /*
     
    488491                                                   RTGCPTR GCPtrDesc, RTSEL const Sel, uint32_t const iSReg)
    489492{
     493    Assert(!HMIsEnabled(pVCpu->CTX_SUFF(pVM)));
     494
    490495    /*
    491496     * Try read the entry.
     
    541546    PVM pVM = pVCpu->CTX_SUFF(pVM);
    542547    Assert(pVM->cCpus == 1);
     548    Assert(!HMIsEnabled(pVM));
    543549
    544550
     
    634640{
    635641    NOREF(pVCpu);
     642    Assert(!HMIsEnabled(pVM));
     643
    636644    /** @todo validate limit! */
    637645    X86DESC    Desc;
     
    836844void selmSetRing1Stack(PVM pVM, uint32_t ss, RTGCPTR32 esp)
    837845{
     846    Assert(!HMIsEnabled(pVM));
    838847    Assert((ss & 1) || esp == 0);
    839848    pVM->selm.s.Tss.ss1  = ss;
     
    852861void selmSetRing2Stack(PVM pVM, uint32_t ss, RTGCPTR32 esp)
    853862{
     863    Assert(!HMIsEnabled(pVM));
    854864    Assert((ss & 3) == 2 || esp == 0);
    855865    pVM->selm.s.Tss.ss2  = ss;
     
    858868#endif
    859869
    860 
    861870#ifdef VBOX_WITH_RAW_MODE_NOT_R0
     871
    862872/**
    863873 * Gets ss:esp for ring1 in main Hypervisor's TSS.
     
    872882VMMDECL(int) SELMGetRing1Stack(PVM pVM, uint32_t *pSS, PRTGCPTR32 pEsp)
    873883{
     884    Assert(!HMIsEnabled(pVM));
    874885    Assert(pVM->cCpus == 1);
    875886    PVMCPU pVCpu = &pVM->aCpus[0];
     
    944955    return VINF_SUCCESS;
    945956}
    946 #endif /* VBOX_WITH_RAW_MODE_NOT_R0 */
    947 
    948 
    949 /**
    950  * Returns Guest TSS pointer
    951  *
    952  * @returns Pointer to the guest TSS, RTRCPTR_MAX if not being monitored.
    953  * @param   pVM     Pointer to the VM.
    954  */
    955 VMMDECL(RTGCPTR) SELMGetGuestTSS(PVM pVM)
    956 {
    957     return (RTGCPTR)pVM->selm.s.GCPtrGuestTss;
    958 }
    959 
    960 #ifdef VBOX_WITH_RAW_MODE_NOT_R0
     957
    961958
    962959/**
     
    10791076VMMDECL(void) SELMShadowCR3Changed(PVM pVM, PVMCPU pVCpu)
    10801077{
    1081     /** @todo SMP support!! */
     1078    /** @todo SMP support!! (64-bit guest scenario, primarily) */
    10821079    pVM->selm.s.Tss.cr3       = PGMGetHyperCR3(pVCpu);
    10831080    pVM->selm.s.TssTrap08.cr3 = PGMGetInterRCCR3(pVM, pVCpu);
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