VirtualBox

Changeset 102987 in vbox


Ignore:
Timestamp:
Jan 22, 2024 10:07:42 AM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161219
Message:

VMM/HM: Nested VMX: bugref:10318 Log host CR0 and a couple of MSRs for split-lock disable status.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMR0.cpp

    r101412 r102987  
    134134 * module termination. */
    135135static bool             g_fHmVmxCalledSUPR0EnableVTx = false;
     136/** VMX: Host CR0 value (set by ring-0 VMX init) */
     137uint64_t                g_uHmVmxHostCr0;
    136138/** VMX: Host CR4 value (set by ring-0 VMX init) */
    137139uint64_t                g_uHmVmxHostCr4;
     
    140142/** VMX: Host SMM monitor control (used for logging/diagnostics) */
    141143uint64_t                g_uHmVmxHostSmmMonitorCtl;
     144/** VMX: Host core capabilities (set by ring-0 VMX init) */
     145uint64_t                g_uHmVmxHostCoreCap;
     146/** VMX: Host memory control register (set by ring-0 VMX init) */
     147uint64_t                g_uHmVmxHostMemoryCtrl;
    142148
    143149
     
    460466    {
    461467        /* Read CR4 and EFER for logging/diagnostic purposes. */
     468        g_uHmVmxHostCr0     = ASMGetCR0();
    462469        g_uHmVmxHostCr4     = ASMGetCR4();
    463470        g_uHmVmxHostMsrEfer = ASMRdMsr(MSR_K6_EFER);
     
    474481        if (RT_BF_GET(uVmxBasicMsr, VMX_BF_BASIC_DUAL_MON))
    475482            g_uHmVmxHostSmmMonitorCtl = ASMRdMsr(MSR_IA32_SMM_MONITOR_CTL);
     483
     484        /*
     485         * Host core and memory capabilities MSRs.
     486         * Primarily for logging split-lock disable status.
     487         */
     488        uint32_t uDummy, uStdExtFeatEdx;
     489        ASMCpuId_Idx_ECX(7, 0, &uDummy, &uDummy, &uDummy, &uStdExtFeatEdx);
     490        if (uStdExtFeatEdx & X86_CPUID_STEXT_FEATURE_EDX_CORECAP)
     491        {
     492            g_uHmVmxHostCoreCap = ASMRdMsr(MSR_IA32_CORE_CAPABILITIES);
     493            if (g_uHmVmxHostCoreCap & MSR_IA32_CORE_CAP_SPLIT_LOCK_DISABLE)
     494                g_uHmVmxHostMemoryCtrl = ASMRdMsr(MSR_MEMORY_CTRL);
     495        }
    476496
    477497        /* Initialize VPID - 16 bits ASID. */
     
    12331253        pVM->hm.s.vmx.fUsePreemptTimerCfg           = pVM->hmr0.s.vmx.fUsePreemptTimer;
    12341254        pVM->hm.s.vmx.cPreemptTimerShift            = g_cHmVmxPreemptTimerShift;
     1255        pVM->hm.s.ForR3.vmx.u64HostCr0              = g_uHmVmxHostCr0;
    12351256        pVM->hm.s.ForR3.vmx.u64HostCr4              = g_uHmVmxHostCr4;
    12361257        pVM->hm.s.ForR3.vmx.u64HostMsrEfer          = g_uHmVmxHostMsrEfer;
    12371258        pVM->hm.s.ForR3.vmx.u64HostSmmMonitorCtl    = g_uHmVmxHostSmmMonitorCtl;
     1259        pVM->hm.s.ForR3.vmx.u64HostCoreCap          = g_uHmVmxHostCoreCap;
     1260        pVM->hm.s.ForR3.vmx.u64HostMemoryCtrl       = g_uHmVmxHostMemoryCtrl;
    12381261        pVM->hm.s.ForR3.vmx.u64HostFeatCtrl         = g_HmMsrs.u.vmx.u64FeatCtrl;
    12391262        HMGetVmxMsrsFromHwvirtMsrs(&g_HmMsrs, &pVM->hm.s.ForR3.vmx.Msrs);
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r102943 r102987  
    16381638    LogRel(("HM: Using VT-x implementation 3.0\n"));
    16391639    LogRel(("HM: Max resume loops                  = %u\n",     pVM->hm.s.cMaxResumeLoopsCfg));
     1640    LogRel(("HM: Host CR0                          = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostCr0));
    16401641    LogRel(("HM: Host CR4                          = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostCr4));
    16411642    LogRel(("HM: Host EFER                         = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostMsrEfer));
    1642     LogRel(("HM: MSR_IA32_SMM_MONITOR_CTL          = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostSmmMonitorCtl));
     1643    LogRel(("HM: Host SMM_MONITOR_CTL              = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostSmmMonitorCtl));
     1644    LogRel(("HM: Host CORE_CAPABILITIES            = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostCoreCap));
     1645    LogRel(("HM: Host MEMORY_CTRL                  = %#RX64%s\n", pVM->hm.s.ForR3.vmx.u64HostMemoryCtrl,
     1646            pVM->hm.s.ForR3.vmx.u64HostMemoryCtrl & MSR_MEMORY_CTRL_SPLIT_LOCK_DISABLE ? " - split-lock disable!" : ""));
    16431647    LogRel(("HM: Host DR6 zero'ed                  = %#RX64%s\n", pVM->hm.s.ForR3.vmx.u64HostDr6Zeroed,
    16441648            pVM->hm.s.ForR3.vmx.fAlwaysInterceptMovDRx ? " - always intercept MOV DRx" : ""));
  • trunk/src/VBox/VMM/include/HMInternal.h

    r100139 r102987  
    372372            bool                        fAlwaysInterceptMovDRx;
    373373
     374            /** Host CR0 value (set by ring-0 VMX init, for logging). */
     375            uint64_t                    u64HostCr0;
    374376            /** Host CR4 value (set by ring-0 VMX init, for logging). */
    375377            uint64_t                    u64HostCr4;
     
    380382            /** Host IA32_FEATURE_CONTROL MSR (set by ring-0 VMX init, for logging). */
    381383            uint64_t                    u64HostFeatCtrl;
     384            /** Host IA32_CORE_CAPABILITIES MSR (set by ring-0 VMX init, for logging). */
     385            uint64_t                    u64HostCoreCap;
     386            /** Host MSR_MEMORY_CTRL MSR (set by ring-0 VMX init, for logging). */
     387            uint64_t                    u64HostMemoryCtrl;
     388
    382389            /** Host zero'ed DR6 value (set by ring-0 VMX init, for logging). */
    383390            uint64_t                    u64HostDr6Zeroed;
     
    11861193extern uint8_t          g_cHmVmxPreemptTimerShift;
    11871194extern bool             g_fHmVmxSupportsVmcsEfer;
     1195extern uint64_t         g_uHmVmxHostCr0;
    11881196extern uint64_t         g_uHmVmxHostCr4;
    11891197extern uint64_t         g_uHmVmxHostMsrEfer;
    11901198extern uint64_t         g_uHmVmxHostSmmMonitorCtl;
     1199extern uint64_t         g_uHmVmxHostCoreCap;
     1200extern uint64_t         g_uHmVmxHostMemoryCtrl;
    11911201extern bool             g_fHmSvmSupported;
    11921202extern uint32_t         g_uHmSvmRev;
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