Changeset 66254 in vbox
- Timestamp:
- Mar 27, 2017 3:18:10 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114175
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp
r66233 r66254 315 315 } 316 316 317 /** @todo gPAT MSR validation? */ 318 317 319 /* 318 320 * Copy segments from nested-guest VMCB state to the guest-CPU state. … … 352 354 return HMSvmNstGstVmExit(pVCpu, pCtx, SVM_EXIT_INVALID, 0 /* uExitInfo1 */, 0 /* uExitInfo2 */); 353 355 } 354 Assert( !(uValidEfer & MSR_K6_EFER_LME)355 || VmcbNstGst.u64CR0 & X86_CR0_PG);356 356 bool const fSvm = RT_BOOL(uValidEfer & MSR_K6_EFER_SVME); 357 357 bool const fLongModeSupported = RT_BOOL(pVM->cpum.ro.GuestFeatures.fLongMode); 358 bool const fLongModeActiveOrEnabled = RT_BOOL(uValidEfer & (MSR_K6_EFER_LME | MSR_K6_EFER_LMA));359 358 bool const fLongModeEnabled = RT_BOOL(uValidEfer & MSR_K6_EFER_LME); 360 359 bool const fPaging = RT_BOOL(VmcbNstGst.u64CR0 & X86_CR0_PG); … … 363 362 bool const fLongModeWithPaging = fLongModeEnabled && fPaging; 364 363 bool const fLongModeConformCS = pCtx->cs.Attr.n.u1Long && pCtx->cs.Attr.n.u1DefBig; 364 /* Adjust EFER.LMA (this is normally done by the CPU when system software writes CR0). */ 365 if (fLongModeWithPaging) 366 uValidEfer |= MSR_K6_EFER_LMA; 367 bool const fLongModeActiveOrEnabled = RT_BOOL(uValidEfer & (MSR_K6_EFER_LME | MSR_K6_EFER_LMA)); 365 368 if ( !fSvm 366 369 || (!fLongModeSupported && fLongModeActiveOrEnabled) … … 382 385 * nested-guest (or the guest). 383 386 * 384 * - VMCPU_FF_INHIBIT_INTERRUPTS need n't be preserved as it's for a single387 * - VMCPU_FF_INHIBIT_INTERRUPTS need not be preserved as it's for a single 385 388 * instruction which is this VMRUN instruction itself. 386 389 * … … 419 422 pCtx->idtr.cbIdt = VmcbNstGst.IDTR.u32Limit; 420 423 pCtx->idtr.pIdt = VmcbNstGst.IDTR.u64Base; 421 pCtx->cr0 = VmcbNstGst.u64CR0; 424 pCtx->cr0 = VmcbNstGst.u64CR0; /** @todo What about informing PGM about CR0.WP? */ 422 425 pCtx->cr4 = VmcbNstGst.u64CR4; 423 426 pCtx->cr3 = VmcbNstGst.u64CR3; … … 429 432 pCtx->rsp = VmcbNstGst.u64RSP; 430 433 pCtx->rip = VmcbNstGst.u64RIP; 434 pCtx->msrEFER = uValidEfer; 431 435 432 436 /* Mask DR6, DR7 bits mandatory set/clear bits. */
Note:
See TracChangeset
for help on using the changeset viewer.