Changeset 50748 in vbox for trunk/src/VBox
- Timestamp:
- Mar 12, 2014 2:29:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r50746 r50748 1008 1008 rc = SUPR0EnableVTx(true /* fEnable */); 1009 1009 if (RT_SUCCESS(rc)) 1010 { 1010 1011 /* If the host provides a VT-x init API, then we'll rely on that for global init. */ 1011 1012 g_HvmR0.fGlobalInit = pVM->hm.s.fGlobalInit = true; 1013 } 1012 1014 else 1013 1015 AssertMsgFailed(("hmR0EnableAllCpuOnce/SUPR0EnableVTx: rc=%Rrc\n", rc)); … … 1060 1062 VMMR0_INT_DECL(int) HMR0EnableAllCpus(PVM pVM) 1061 1063 { 1062 /* Make sure we don't touch HM after we've disabled HM in 1063 preparation of a suspend. */ 1064 /* Make sure we don't touch HM after we've disabled HM in preparation of a suspend. */ 1064 1065 if (ASMAtomicReadBool(&g_HvmR0.fSuspended)) 1065 1066 return VERR_HM_SUSPEND_PENDING; … … 1330 1331 AssertReturn(pVM, VERR_INVALID_PARAMETER); 1331 1332 1332 /* Make sure we don't touch HM after we've disabled HM in 1333 preparation of a suspend. */ 1333 /* Make sure we don't touch HM after we've disabled HM in preparation of a suspend. */ 1334 1334 AssertReturn(!ASMAtomicReadBool(&g_HvmR0.fSuspended), VERR_HM_SUSPEND_PENDING); 1335 1335 … … 1391 1391 rc = hmR0EnableCpu(pVCpu->CTX_SUFF(pVM), idCpu); 1392 1392 1393 /* Reload host- context (back from ring-3/migrated CPUs), reload host context & sharedbits. */1393 /* Reload host-state (back from ring-3/migrated CPUs) and shared guest/host bits. */ 1394 1394 HMCPU_CF_SET(pVCpu, HM_CHANGED_HOST_CONTEXT | HM_CHANGED_HOST_GUEST_SHARED_STATE); 1395 1395 pVCpu->hm.s.idEnteredCpu = idCpu; … … 1430 1430 AssertMsgRCReturn(rc, ("pfnEnterSession failed. rc=%Rrc pVCpu=%p HostCpuId=%u\n", rc, pVCpu, idCpu), rc); 1431 1431 1432 /* Load the host as we may be resuming code after a longjmp and quite1432 /* Load the host-state as we may be resuming code after a longjmp and quite 1433 1433 possibly now be scheduled on a different CPU. */ 1434 1434 rc = g_HvmR0.pfnSaveHostState(pVM, pVCpu); … … 1440 1440 #endif 1441 1441 1442 /* Keep track of the CPU owning the VMCS for debugging scheduling weirdness 1443 and ring-3 calls. */ 1442 /* Keep track of the CPU owning the VMCS for debugging scheduling weirdness and ring-3 calls. */ 1444 1443 if (RT_FAILURE(rc)) 1445 1444 pVCpu->hm.s.idEnteredCpu = NIL_RTCPUID; … … 1895 1894 # if HC_ARCH_BITS == 64 1896 1895 uint64_t u32Base = X86DESC64_BASE(pDesc); 1897 1898 1896 Log(("%s %04x - %RX64 %RX64 - base=%RX64 limit=%08x dpl=%d %s\n", pszMsg, 1899 1897 Sel, pDesc->au64[0], pDesc->au64[1], u32Base, u32Limit, pDesc->Gen.u2Dpl, szMsg)); 1900 1898 # else 1901 1899 uint32_t u32Base = X86DESC_BASE(pDesc); 1902 1903 1900 Log(("%s %04x - %08x %08x - base=%08x limit=%08x dpl=%d %s\n", pszMsg, 1904 1901 Sel, pDesc->au32[0], pDesc->au32[1], u32Base, u32Limit, pDesc->Gen.u2Dpl, szMsg)); … … 1926 1923 } const s_aFlags[] = 1927 1924 { 1928 { "vip", NULL, X86_EFL_VIP },1929 { "vif", NULL, X86_EFL_VIF },1930 { "ac", NULL, X86_EFL_AC },1931 { "vm", NULL, X86_EFL_VM },1932 { "rf", NULL, X86_EFL_RF },1933 { "nt", NULL, X86_EFL_NT },1934 { "ov", "nv", X86_EFL_OF },1935 { "dn", "up", X86_EFL_DF },1936 { "ei", "di", X86_EFL_IF },1937 { "tf", NULL, X86_EFL_TF },1938 { "nt", "pl", X86_EFL_SF },1939 { "nz", "zr", X86_EFL_ZF },1940 { "ac", "na", X86_EFL_AF },1941 { "po", "pe", X86_EFL_PF },1942 { "cy", "nc", X86_EFL_CF },1925 { "vip", NULL, X86_EFL_VIP }, 1926 { "vif", NULL, X86_EFL_VIF }, 1927 { "ac", NULL, X86_EFL_AC }, 1928 { "vm", NULL, X86_EFL_VM }, 1929 { "rf", NULL, X86_EFL_RF }, 1930 { "nt", NULL, X86_EFL_NT }, 1931 { "ov", "nv", X86_EFL_OF }, 1932 { "dn", "up", X86_EFL_DF }, 1933 { "ei", "di", X86_EFL_IF }, 1934 { "tf", NULL, X86_EFL_TF }, 1935 { "nt", "pl", X86_EFL_SF }, 1936 { "nz", "zr", X86_EFL_ZF }, 1937 { "ac", "na", X86_EFL_AF }, 1938 { "po", "pe", X86_EFL_PF }, 1939 { "cy", "nc", X86_EFL_CF }, 1943 1940 }; 1944 1941 char szEFlags[80]; 1945 1942 char *psz = szEFlags; 1946 uint32_t efl= pCtx->eflags.u32;1943 uint32_t uEFlags = pCtx->eflags.u32; 1947 1944 for (unsigned i = 0; i < RT_ELEMENTS(s_aFlags); i++) 1948 1945 { 1949 const char *pszAdd = s_aFlags[i].fFlag & efl? s_aFlags[i].pszSet : s_aFlags[i].pszClear;1946 const char *pszAdd = s_aFlags[i].fFlag & uEFlags ? s_aFlags[i].pszSet : s_aFlags[i].pszClear; 1950 1947 if (pszAdd) 1951 1948 { … … 1985 1982 pCtx->r8, pCtx->r9, pCtx->r10, pCtx->r11, pCtx->r12, pCtx->r13, 1986 1983 pCtx->r14, pCtx->r15, 1987 pCtx->rip, pCtx->rsp, pCtx->rbp, X86_EFL_GET_IOPL( efl), 31, szEFlags,1984 pCtx->rip, pCtx->rsp, pCtx->rbp, X86_EFL_GET_IOPL(uEFlags), 31, szEFlags, 1988 1985 pCtx->cs.Sel, pCtx->cs.u64Base, pCtx->cs.u32Limit, pCtx->cs.Attr.u, 1989 1986 pCtx->ds.Sel, pCtx->ds.u64Base, pCtx->ds.u32Limit, pCtx->ds.Attr.u, … … 1995 1992 pCtx->dr[0], pCtx->dr[1], pCtx->dr[2], pCtx->dr[3], 1996 1993 pCtx->dr[4], pCtx->dr[5], pCtx->dr[6], pCtx->dr[7], 1997 pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, efl,1994 pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, uEFlags, 1998 1995 pCtx->ldtr.Sel, pCtx->ldtr.u64Base, pCtx->ldtr.u32Limit, pCtx->ldtr.Attr.u, 1999 1996 pCtx->tr.Sel, pCtx->tr.u64Base, pCtx->tr.u32Limit, pCtx->tr.Attr.u, … … 2015 2012 , 2016 2013 pCtx->eax, pCtx->ebx, pCtx->ecx, pCtx->edx, pCtx->esi, pCtx->edi, 2017 pCtx->eip, pCtx->esp, pCtx->ebp, X86_EFL_GET_IOPL( efl), 31, szEFlags,2014 pCtx->eip, pCtx->esp, pCtx->ebp, X86_EFL_GET_IOPL(uEFlags), 31, szEFlags, 2018 2015 pCtx->cs.Sel, pCtx->cs.u64Base, pCtx->cs.u32Limit, pCtx->cs.Attr.u, pCtx->dr[0], pCtx->dr[1], 2019 2016 pCtx->ds.Sel, pCtx->ds.u64Base, pCtx->ds.u32Limit, pCtx->ds.Attr.u, pCtx->dr[2], pCtx->dr[3], … … 2022 2019 pCtx->gs.Sel, pCtx->gs.u64Base, pCtx->gs.u32Limit, pCtx->gs.Attr.u, pCtx->cr0, pCtx->cr2, 2023 2020 pCtx->ss.Sel, pCtx->ss.u64Base, pCtx->ss.u32Limit, pCtx->ss.Attr.u, pCtx->cr3, pCtx->cr4, 2024 pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, efl,2021 pCtx->gdtr.pGdt, pCtx->gdtr.cbGdt, pCtx->idtr.pIdt, pCtx->idtr.cbIdt, uEFlags, 2025 2022 pCtx->ldtr.Sel, pCtx->ldtr.u64Base, pCtx->ldtr.u32Limit, pCtx->ldtr.Attr.u, 2026 2023 pCtx->tr.Sel, pCtx->tr.u64Base, pCtx->tr.u32Limit, pCtx->tr.Attr.u, … … 2036 2033 pCtx->fpu.FPUDP, pCtx->fpu.DS, pCtx->fpu.Rsrvd2, 2037 2034 pCtx->fpu.MXCSR, pCtx->fpu.MXCSR_MASK)); 2038 2039 2035 2040 2036 Log(("MSR:\n" … … 2053 2049 pCtx->msrSFMASK, 2054 2050 pCtx->msrKERNELGSBASE)); 2055 2056 2051 } 2057 2052
Note:
See TracChangeset
for help on using the changeset viewer.