Changeset 99370 in vbox
- Timestamp:
- Apr 11, 2023 12:32:33 AM (23 months ago)
- svn:sync-xref-src-repo-rev:
- 156785
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/NEMR3.cpp
r98103 r99370 50 50 51 51 #include <iprt/asm.h> 52 #include <iprt/string.h> 52 53 53 54 … … 535 536 #endif 536 537 } 538 539 540 /** 541 * Disables a CPU ISA extension, like MONITOR/MWAIT. 542 * 543 * @returns VBox status code 544 * @param pVM The cross context VM structure. 545 * @param pszIsaExt The ISA extension name in the config tree. 546 */ 547 int nemR3DisableCpuIsaExt(PVM pVM, const char *pszIsaExt) 548 { 549 /* 550 * Get IsaExts config node under CPUM. 551 */ 552 PCFGMNODE pIsaExts = CFGMR3GetChild(CFGMR3GetRoot(pVM), "/CPUM/IsaExts"); 553 if (!pIsaExts) 554 { 555 int rc = CFGMR3InsertNode(CFGMR3GetRoot(pVM), "/CPUM/IsaExts", &pIsaExts); 556 AssertLogRelMsgReturn(RT_SUCCESS(rc), ("CFGMR3InsertNode: rc=%Rrc pszIsaExt=%s\n", rc, pszIsaExt), rc); 557 } 558 559 /* 560 * Look for a value by the given name (pszIsaExt). 561 */ 562 /* Integer values 1 (CPUMISAEXTCFG_ENABLED_SUPPORTED) and 9 (CPUMISAEXTCFG_ENABLED_PORTABLE) will be replaced. */ 563 uint64_t u64Value; 564 int rc = CFGMR3QueryInteger(pIsaExts, pszIsaExt, &u64Value); 565 if (RT_SUCCESS(rc)) 566 { 567 if (u64Value != 1 && u64Value != 9) 568 { 569 LogRel(("NEM: Not disabling IsaExt '%s', already configured with int value %lld\n", pszIsaExt, u64Value)); 570 return VINF_SUCCESS; 571 } 572 CFGMR3RemoveValue(pIsaExts, pszIsaExt); 573 } 574 /* String value 'default', 'enabled' and 'portable' will be replaced. */ 575 else if (rc == VERR_CFGM_NOT_INTEGER) 576 { 577 char szValue[32]; 578 rc = CFGMR3QueryString(pIsaExts, pszIsaExt, szValue, sizeof(szValue)); 579 AssertRCReturn(rc, VINF_SUCCESS); 580 581 if ( RTStrICmpAscii(szValue, "default") != 0 582 && RTStrICmpAscii(szValue, "def") != 0 583 && RTStrICmpAscii(szValue, "enabled") != 0 584 && RTStrICmpAscii(szValue, "enable") != 0 585 && RTStrICmpAscii(szValue, "on") != 0 586 && RTStrICmpAscii(szValue, "yes") != 0 587 && RTStrICmpAscii(szValue, "portable") != 0) 588 { 589 LogRel(("NEM: Not disabling IsaExt '%s', already configured with string value '%s'\n", pszIsaExt, szValue)); 590 return VINF_SUCCESS; 591 } 592 CFGMR3RemoveValue(pIsaExts, pszIsaExt); 593 } 594 else 595 AssertLogRelMsgReturn(rc == VERR_CFGM_VALUE_NOT_FOUND, ("CFGMR3QueryInteger: rc=%Rrc pszIsaExt=%s\n", rc, pszIsaExt), 596 VERR_NEM_IPE_8); 597 598 /* 599 * Insert the disabling value. 600 */ 601 rc = CFGMR3InsertInteger(pIsaExts, pszIsaExt, 0 /* disabled */); 602 AssertLogRelMsgReturn(RT_SUCCESS(rc), ("CFGMR3InsertInteger: rc=%Rrc pszIsaExt=%s\n", rc, pszIsaExt), rc); 603 604 return VINF_SUCCESS; 605 } 606 -
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp
r98103 r99370 1319 1319 Log(("NEM: Marked active!\n")); 1320 1320 nemR3WinDisableX2Apic(pVM); 1321 nemR3DisableCpuIsaExt(pVM, "MONITOR"); /* MONITOR is not supported by Hyper-V (MWAIT is sometimes). */ 1321 1322 PGMR3EnableNemMode(pVM); 1322 1323 … … 1568 1569 /* 1569 1570 * Adjust features. 1570 * Note! We've already disabled X2APIC via CFGM during the first init call. 1571 */ 1571 * 1572 * Note! We've already disabled X2APIC and MONITOR/MWAIT via CFGM during 1573 * the first init call. 1574 */ 1575 1572 1576 return VINF_SUCCESS; 1573 1577 } -
trunk/src/VBox/VMM/include/NEMInternal.h
r99051 r99370 623 623 624 624 #ifdef IN_RING3 625 626 int nemR3DisableCpuIsaExt(PVM pVM, const char *pszIsaExt); 627 625 628 int nemR3NativeInit(PVM pVM, bool fFallback, bool fForced); 626 629 int nemR3NativeInitAfterCPUM(PVM pVM); … … 667 670 */ 668 671 DECLHIDDEN(bool) nemR3NativeNotifyDebugEventChangedPerCpu(PVM pVM, PVMCPU pVCpu, bool fUseDebugLoop); 669 #endif 672 673 #endif /* IN_RING3 */ 670 674 671 675 void nemHCNativeNotifyHandlerPhysicalRegister(PVMCC pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb);
Note:
See TracChangeset
for help on using the changeset viewer.