Changeset 78712 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- May 24, 2019 8:34:13 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130790
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r76553 r78712 1377 1377 1378 1378 1379 /**1380 * MWAIT Emulation.1381 */1382 VMM_INT_DECL(VBOXSTRICTRC) EMInterpretMWait(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)1383 {1384 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));1385 uint32_t u32Dummy, u32ExtFeatures, cpl, u32MWaitFeatures;1386 NOREF(pVM);1387 1388 /* Get the current privilege level. */1389 cpl = CPUMGetGuestCPL(pVCpu);1390 if (cpl != 0)1391 return VERR_EM_INTERPRETER; /* supervisor only */1392 1393 CPUMGetGuestCpuId(pVCpu, 1, 0, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);1394 if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))1395 return VERR_EM_INTERPRETER; /* not supported */1396 1397 /*1398 * CPUID.05H.ECX[0] defines support for power management extensions (eax)1399 * CPUID.05H.ECX[1] defines support for interrupts as break events for mwait even when IF=01400 */1401 CPUMGetGuestCpuId(pVCpu, 5, 0, &u32Dummy, &u32Dummy, &u32MWaitFeatures, &u32Dummy);1402 if (pRegFrame->ecx > 1)1403 {1404 Log(("EMInterpretMWait: unexpected ecx value %x -> recompiler\n", pRegFrame->ecx));1405 return VERR_EM_INTERPRETER; /* illegal value. */1406 }1407 1408 if (pRegFrame->ecx && !(u32MWaitFeatures & X86_CPUID_MWAIT_ECX_BREAKIRQIF0))1409 {1410 Log(("EMInterpretMWait: unsupported X86_CPUID_MWAIT_ECX_BREAKIRQIF0 -> recompiler\n"));1411 return VERR_EM_INTERPRETER; /* illegal value. */1412 }1413 1414 return EMMonitorWaitPerform(pVCpu, pRegFrame->rax, pRegFrame->rcx);1415 }1416 1417 1418 /**1419 * MONITOR Emulation.1420 */1421 VMM_INT_DECL(int) EMInterpretMonitor(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)1422 {1423 uint32_t u32Dummy, u32ExtFeatures, cpl;1424 Assert(pRegFrame == CPUMGetGuestCtxCore(pVCpu));1425 NOREF(pVM);1426 1427 if (pRegFrame->ecx != 0)1428 {1429 Log(("emInterpretMonitor: unexpected ecx=%x -> recompiler!!\n", pRegFrame->ecx));1430 return VERR_EM_INTERPRETER; /* illegal value. */1431 }1432 1433 /* Get the current privilege level. */1434 cpl = CPUMGetGuestCPL(pVCpu);1435 if (cpl != 0)1436 return VERR_EM_INTERPRETER; /* supervisor only */1437 1438 CPUMGetGuestCpuId(pVCpu, 1, 0, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);1439 if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))1440 return VERR_EM_INTERPRETER; /* not supported */1441 1442 EMMonitorWaitPrepare(pVCpu, pRegFrame->rax, pRegFrame->rcx, pRegFrame->rdx, NIL_RTGCPHYS);1443 return VINF_SUCCESS;1444 }1445 1446 1447 1379 /* VT-x only: */ 1448 1380
Note:
See TracChangeset
for help on using the changeset viewer.