Changeset 104219 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Apr 8, 2024 6:01:43 AM (11 months ago)
- svn:sync-xref-src-repo-rev:
- 162656
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r103289 r104219 380 380 else 381 381 { 382 ASMWrMsr(MSR_K8_KERNEL_GS_BASE, pCtx->msrKERNELGSBASE); 383 ASMWrMsr(MSR_K8_LSTAR, pCtx->msrLSTAR); 384 ASMWrMsr(MSR_K6_STAR, pCtx->msrSTAR); 385 /* The system call flag mask register isn't as benign and accepting of all 386 values as the above, so mask it to avoid #GP'ing on corrupted input. */ 387 Assert(!(pCtx->msrSFMASK & ~(uint64_t)UINT32_MAX)); 388 ASMWrMsr(MSR_K8_SF_MASK, pCtx->msrSFMASK & UINT32_MAX); 382 /* Avoid raising #GP caused by writing illegal values to these MSRs. */ 383 if ( X86_IS_CANONICAL(pCtx->msrKERNELGSBASE) 384 && X86_IS_CANONICAL(pCtx->msrLSTAR)) 385 { 386 ASMWrMsr(MSR_K8_KERNEL_GS_BASE, pCtx->msrKERNELGSBASE); 387 ASMWrMsr(MSR_K8_LSTAR, pCtx->msrLSTAR); 388 ASMWrMsr(MSR_K6_STAR, pCtx->msrSTAR); 389 /* The system call flag mask register isn't as benign and accepting of all 390 values as the above, so mask it to avoid #GP'ing on corrupted input. */ 391 Assert(!(pCtx->msrSFMASK & ~(uint64_t)UINT32_MAX)); 392 ASMWrMsr(MSR_K8_SF_MASK, pCtx->msrSFMASK & UINT32_MAX); 393 } 394 else 395 AssertMsgFailed(("Incompatible lazily-loaded guest MSR values\n")); 389 396 } 390 397 }
Note:
See TracChangeset
for help on using the changeset viewer.