VirtualBox

Changeset 102987 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Jan 22, 2024 10:07:42 AM (16 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.

File:
1 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);
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