Changeset 24248 in vbox
- Timestamp:
- Nov 2, 2009 12:16:09 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r24243 r24248 2259 2259 RTGCUINTPTR errCode, instrInfo; 2260 2260 bool fSetupTPRCaching = false; 2261 bool fRestoreLSTAR = false; 2262 uint64_t u64LSTAR = 0; 2261 2263 uint8_t u8LastTPR = 0; 2262 2264 RTCCUINTREG uOldEFlags = ~(RTCCUINTREG)0; … … 2498 2500 2499 2501 if (fPending) 2502 { 2500 2503 /* A TPR change could activate a pending interrupt, so catch lstar writes. */ 2501 2504 vmxR0SetMSRPermission(pVCpu, MSR_K8_LSTAR, true, false); 2505 fRestoreLSTAR = false; 2506 } 2502 2507 else 2508 { 2503 2509 /* No interrupts are pending, so we don't need to be explicitely notified. 2504 2510 * There are enough world switches for detecting pending interrupts. 2505 2511 */ 2506 2512 vmxR0SetMSRPermission(pVCpu, MSR_K8_LSTAR, true, true); 2513 2514 /* Must save the host LSTAR msr to restore it later. */ 2515 fRestoreLSTAR = true; 2516 u64LSTAR = ASMRdMsr(MSR_K8_LSTAR); 2517 } 2507 2518 } 2508 2519 } … … 2618 2629 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED); 2619 2630 Assert(!(ASMGetFlags() & X86_EFL_IF)); 2631 2632 /* Restore the host LSTAR msr if the guest could have changed it. */ 2633 if (fRestoreLSTAR) 2634 { 2635 Assert(pVM->hwaccm.s.fTPRPatchingActive); 2636 ASMWrMsr(MSR_K8_LSTAR, u64LSTAR); 2637 } 2638 2620 2639 ASMSetFlags(uOldEFlags); 2621 2640 #ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION
Note:
See TracChangeset
for help on using the changeset viewer.

