- Timestamp:
- Jul 20, 2018 11:20:08 AM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r73246 r73263 542 542 } 543 543 544 545 /** 546 * Notification callback which is called whenever there is a chance that a CR3 547 * value might have changed. 548 * 549 * This is called by PGM. 550 * 551 * @param pVCpu The cross context virtual CPU structure. 552 * @param enmShadowMode New shadow paging mode. 553 * @param enmGuestMode New guest paging mode. 554 */ 555 VMM_INT_DECL(void) HMPagingModeChanged(PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode) 556 { 557 #ifdef IN_RING3 558 /* Ignore page mode changes during state loading. */ 559 if (VMR3GetState(pVCpu->pVMR3) == VMSTATE_LOADING) 560 return; 561 #endif 562 563 pVCpu->hm.s.enmShadowMode = enmShadowMode; 564 565 /* 566 * If the guest left protected mode VMX execution, we'll have to be 567 * extra careful if/when the guest switches back to protected mode. 568 */ 569 if (enmGuestMode == PGMMODE_REAL) 570 pVCpu->hm.s.vmx.fWasInRealMode = true; 571 572 Log4(("HMR3PagingModeChanged: Guest paging mode '%s', shadow paging mode '%s'\n", PGMGetModeName(enmGuestMode), 573 PGMGetModeName(enmShadowMode))); 574 } 575 -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r73203 r73263 1919 1919 1920 1920 /** 1921 * Notification callback which is called whenever there is a chance that a CR31922 * value might have changed.1923 *1924 * This is called by PGM.1925 *1926 * @param pVM The cross context VM structure.1927 * @param pVCpu The cross context virtual CPU structure.1928 * @param enmShadowMode New shadow paging mode.1929 * @param enmGuestMode New guest paging mode.1930 */1931 VMMR3_INT_DECL(void) HMR3PagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode)1932 {1933 RT_NOREF_PV(pVM);1934 1935 /* Ignore page mode changes during state loading. */1936 if (VMR3GetState(pVCpu->pVMR3) == VMSTATE_LOADING)1937 return;1938 1939 pVCpu->hm.s.enmShadowMode = enmShadowMode;1940 1941 /*1942 * If the guest left protected mode VMX execution, we'll have to be1943 * extra careful if/when the guest switches back to protected mode.1944 */1945 if (enmGuestMode == PGMMODE_REAL)1946 pVCpu->hm.s.vmx.fWasInRealMode = true;1947 1948 Log4(("HMR3PagingModeChanged: Guest paging mode '%s', shadow paging mode '%s'\n", PGMGetModeName(enmGuestMode),1949 PGMGetModeName(enmShadowMode)));1950 }1951 1952 1953 /**1954 1921 * Terminates the HM. 1955 1922 * -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r73260 r73263 681 681 static FNVMATSTATE pgmR3ResetNoMorePhysWritesFlag; 682 682 #endif 683 static PGMMODE pgmR3CalcShadowMode(PVM pVM, PGMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, VMMSWITCHER *penmSwitcher);684 683 685 684 #ifdef VBOX_WITH_DEBUGGER … … 3268 3267 * VMMSWITCHER_INVALID means no change. 3269 3268 */ 3270 static PGMMODE pgmR3CalcShadowMode(PVM pVM, PGMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, VMMSWITCHER *penmSwitcher) 3269 static PGMMODE pgmCalcShadowMode(PVM pVM, PGMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, 3270 VMMSWITCHER *penmSwitcher) 3271 3271 { 3272 3272 VMMSWITCHER enmSwitcher = VMMSWITCHER_INVALID; … … 3301 3301 enmShadowMode = PGMMODE_PAE; 3302 3302 enmSwitcher = VMMSWITCHER_PAE_TO_PAE; 3303 #ifdef DEBUG_bird3304 if (RTEnvExist("VBOX_32BIT"))3305 {3306 enmShadowMode = PGMMODE_32_BIT;3307 enmSwitcher = VMMSWITCHER_PAE_TO_32;3308 }3309 #endif3310 3303 break; 3311 3304 … … 3316 3309 enmShadowMode = PGMMODE_PAE; 3317 3310 enmSwitcher = VMMSWITCHER_AMD64_TO_PAE; 3318 #ifdef DEBUG_bird3319 if (RTEnvExist("VBOX_32BIT"))3320 {3321 enmShadowMode = PGMMODE_32_BIT;3322 enmSwitcher = VMMSWITCHER_AMD64_TO_32;3323 }3324 #endif3325 3311 break; 3326 3312 3327 default: AssertMsgFailed(("enmHostMode=%d\n", enmHostMode)); break; 3313 default: 3314 AssertLogRelMsgFailedReturnStmt(("enmHostMode=%d\n", enmHostMode), 3315 *penmSwitcher = VMMSWITCHER_INVALID, PGMMODE_INVALID); 3328 3316 } 3329 3317 break; … … 3344 3332 enmShadowMode = PGMMODE_PAE; 3345 3333 enmSwitcher = VMMSWITCHER_PAE_TO_PAE; 3346 #ifdef DEBUG_bird3347 if (RTEnvExist("VBOX_32BIT"))3348 {3349 enmShadowMode = PGMMODE_32_BIT;3350 enmSwitcher = VMMSWITCHER_PAE_TO_32;3351 }3352 #endif3353 3334 break; 3354 3335 … … 3359 3340 enmShadowMode = PGMMODE_PAE; 3360 3341 enmSwitcher = VMMSWITCHER_AMD64_TO_PAE; 3361 #ifdef DEBUG_bird3362 if (RTEnvExist("VBOX_32BIT"))3363 {3364 enmShadowMode = PGMMODE_32_BIT;3365 enmSwitcher = VMMSWITCHER_AMD64_TO_32;3366 }3367 #endif3368 3342 break; 3369 3343 3370 default: AssertMsgFailed(("enmHostMode=%d\n", enmHostMode)); break; 3344 default: 3345 AssertLogRelMsgFailedReturnStmt(("enmHostMode=%d\n", enmHostMode), 3346 *penmSwitcher = VMMSWITCHER_INVALID, PGMMODE_INVALID); 3371 3347 } 3372 3348 break; … … 3398 3374 break; 3399 3375 3400 default: AssertMsgFailed(("enmHostMode=%d\n", enmHostMode)); break; 3376 default: 3377 AssertLogRelMsgFailedReturnStmt(("enmHostMode=%d\n", enmHostMode), 3378 *penmSwitcher = VMMSWITCHER_INVALID, PGMMODE_INVALID); 3401 3379 } 3402 3380 break; … … 3428 3406 break; 3429 3407 3430 default: AssertMsgFailed(("enmHostMode=%d\n", enmHostMode)); break; 3408 default: 3409 AssertLogRelMsgFailedReturnStmt(("enmHostMode=%d\n", enmHostMode), 3410 *penmSwitcher = VMMSWITCHER_INVALID, PGMMODE_INVALID); 3431 3411 } 3432 3412 break; 3433 3413 3434 3435 3414 default: 3436 AssertLogRelMsgFailed(("enmGuestMode=%d\n", enmGuestMode)); 3437 *penmSwitcher = VMMSWITCHER_INVALID; 3438 return PGMMODE_INVALID; 3415 AssertLogRelMsgFailedReturnStmt(("enmGuestMode=%d\n", enmGuestMode), 3416 *penmSwitcher = VMMSWITCHER_INVALID, PGMMODE_INVALID); 3439 3417 } 3440 3418 … … 3486 3464 #endif 3487 3465 default: 3488 AssertLogRelFailedReturn(PGMMODE_INVALID); 3466 AssertLogRelMsgFailedReturnStmt(("enmHostMode=%d\n", pVM->pgm.s.enmHostMode), 3467 *penmSwitcher = VMMSWITCHER_INVALID, PGMMODE_INVALID); 3489 3468 } 3490 3469 } … … 3519 3498 VMMSWITCHER enmSwitcher = VMMSWITCHER_INVALID; 3520 3499 PGMMODE enmShadowMode = PGMMODE_INVALID; 3521 enmShadowMode = pgm R3CalcShadowMode(pVM, enmGuestMode, pVM->pgm.s.enmHostMode, pVCpu->pgm.s.enmShadowMode, &enmSwitcher);3522 3523 #ifdef VBOX_WITH_RAW_MODE 3500 enmShadowMode = pgmCalcShadowMode(pVM, enmGuestMode, pVM->pgm.s.enmHostMode, pVCpu->pgm.s.enmShadowMode, &enmSwitcher); 3501 3502 #ifdef VBOX_WITH_RAW_MODE_NOT_R0 3524 3503 if ( enmSwitcher != VMMSWITCHER_INVALID 3525 3504 && VM_IS_RAW_MODE_ENABLED(pVM)) … … 3674 3653 * Notify HM. 3675 3654 */ 3676 HM R3PagingModeChanged(pVM,pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode);3655 HMPagingModeChanged(pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode); 3677 3656 return rc; 3678 3657 }
Note:
See TracChangeset
for help on using the changeset viewer.