Changeset 55316 in vbox
- Timestamp:
- Apr 16, 2015 5:34:30 PM (10 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r55292 r55316 9222 9222 do \ 9223 9223 { \ 9224 if (RT_LIKELY( (pIemCpu->fPrefixes & (IEM_OP_PRF_LOCK | IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)))) \9224 if (RT_LIKELY(!(pIemCpu->fPrefixes & (IEM_OP_PRF_LOCK | IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)))) \ 9225 9225 { /* likely */ } \ 9226 9226 else \ -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r55306 r55316 23 23 #include <iprt/thread.h> 24 24 25 #include <VBox/vmm/pdmapi.h> 26 #include <VBox/vmm/dbgf.h> 27 #include <VBox/vmm/iem.h> 28 #include <VBox/vmm/iom.h> 29 #include <VBox/vmm/tm.h> 30 #include <VBox/vmm/gim.h> 25 31 #include "HMInternal.h" 26 32 #include <VBox/vmm/vm.h> 27 33 #include "HMSVMR0.h" 28 #include <VBox/vmm/pdmapi.h>29 #include <VBox/vmm/dbgf.h>30 #include <VBox/vmm/iom.h>31 #include <VBox/vmm/tm.h>32 #include <VBox/vmm/gim.h>33 34 #include "dtrace/VBoxVMM.h" 34 35 … … 288 289 static FNSVMEXITHANDLER hmR0SvmExitReadDRx; 289 290 static FNSVMEXITHANDLER hmR0SvmExitWriteDRx; 291 static FNSVMEXITHANDLER hmR0SvmExitXsetbv; 290 292 static FNSVMEXITHANDLER hmR0SvmExitIOInstr; 291 293 static FNSVMEXITHANDLER hmR0SvmExitNestedPF; … … 724 726 | SVM_CTRL2_INTERCEPT_WBINVD /* WBINVD causes a #VMEXIT. */ 725 727 | SVM_CTRL2_INTERCEPT_MONITOR /* MONITOR causes a #VMEXIT. */ 726 | SVM_CTRL2_INTERCEPT_MWAIT; /* MWAIT causes a #VMEXIT. */ 728 | SVM_CTRL2_INTERCEPT_MWAIT /* MWAIT causes a #VMEXIT. */ 729 | SVM_CTRL2_INTERCEPT_XSETBV; /* XSETBV causes a #VMEXIT. */ 727 730 728 731 /* CR0, CR4 reads must be intercepted, our shadow values are not necessarily the same as the guest's. */ … … 1249 1252 /* 1250 1253 * Guest CR4. 1254 * ASSUMES this is done everytime we get in from ring-3! (XCR0) 1251 1255 */ 1252 1256 if (HMCPU_CF_IS_PENDING(pVCpu, HM_CHANGED_GUEST_CR4)) … … 1289 1293 pVmcb->guest.u64CR4 = u64GuestCR4; 1290 1294 pVmcb->ctrl.u64VmcbCleanBits &= ~HMSVM_VMCB_CLEAN_CRX_EFER; 1295 1296 /* Whether to save/load/restore XCR0 during world switch depends on CR4.OSXSAVE and host+guest XCR0. */ 1297 pVCpu->hm.s.fLoadSaveGuestXcr0 = (u64GuestCR4 & X86_CR4_OSXSAVE) && pCtx->aXcr[0] != ASMGetXcr0(); 1298 1291 1299 HMCPU_CF_CLEAR(pVCpu, HM_CHANGED_GUEST_CR4); 1292 1300 } … … 3582 3590 case SVM_EXIT_WRITE_DR14: case SVM_EXIT_WRITE_DR15: 3583 3591 return hmR0SvmExitWriteDRx(pVCpu, pCtx, pSvmTransient); 3592 3593 case SVM_EXIT_XSETBV: 3594 return hmR0SvmExitXsetbv(pVCpu, pCtx, pSvmTransient); 3584 3595 3585 3596 case SVM_EXIT_TASK_SWITCH: … … 4711 4722 4712 4723 /** 4724 * #VMEXIT handler for XCRx write (SVM_EXIT_XSETBV). Conditional #VMEXIT. 4725 */ 4726 HMSVM_EXIT_DECL hmR0SvmExitXsetbv(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient) 4727 { 4728 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); 4729 4730 /** @todo decode assists... */ 4731 VBOXSTRICTRC rcStrict = IEMExecOne(pVCpu); 4732 if (rcStrict == VINF_IEM_RAISED_XCPT) 4733 HMCPU_CF_SET(pVCpu, HM_CHANGED_ALL_GUEST); 4734 4735 pVCpu->hm.s.fLoadSaveGuestXcr0 = (pCtx->cr4 & X86_CR4_OSXSAVE) && pCtx->aXcr[0] != ASMGetXcr0(); 4736 4737 HMSVM_CHECK_SINGLE_STEP(pVCpu, rcStrict); 4738 return VBOXSTRICTRC_TODO(rcStrict); 4739 } 4740 4741 4742 /** 4713 4743 * #VMEXIT handler for I/O instructions (SVM_EXIT_IOIO). Conditional #VMEXIT. 4714 4744 */ -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r55307 r55316 24 24 #include <iprt/thread.h> 25 25 26 #include "HMInternal.h"27 #include <VBox/vmm/vm.h>28 #include "HMVMXR0.h"29 26 #include <VBox/vmm/pdmapi.h> 30 27 #include <VBox/vmm/dbgf.h> … … 37 34 # include <VBox/vmm/rem.h> 38 35 #endif 39 # include "dtrace/VBoxVMM.h" 36 #include "HMInternal.h" 37 #include <VBox/vmm/vm.h> 38 #include "HMVMXR0.h" 39 #include "dtrace/VBoxVMM.h" 40 40 41 41 #ifdef DEBUG_ramshankar … … 4018 4018 /* 4019 4019 * Guest CR4. 4020 * ASSUMES this is done everytime we get in from ring-3! (XCR0) 4020 4021 */ 4021 4022 if (HMCPU_CF_IS_PENDING(pVCpu, HM_CHANGED_GUEST_CR4)) … … 4100 4101 4101 4102 /* Setup CR4 mask. CR4 flags owned by the host, if the guest attempts to change them, that would cause a VM-exit. */ 4102 uint32_t u32CR4Mask = 0; 4103 u32CR4Mask = X86_CR4_VME 4104 | X86_CR4_PAE 4105 | X86_CR4_PGE 4106 | X86_CR4_PSE 4107 | X86_CR4_VMXE; 4103 uint32_t u32CR4Mask = X86_CR4_VME 4104 | X86_CR4_PAE 4105 | X86_CR4_PGE 4106 | X86_CR4_PSE 4107 | X86_CR4_VMXE; 4108 if (pVM->cpum.ro.HostFeatures.fXSaveRstor) 4109 u32CR4Mask |= X86_CR4_OSXSAVE; 4108 4110 pVCpu->hm.s.vmx.u32CR4Mask = u32CR4Mask; 4109 4111 rc = VMXWriteVmcs32(VMX_VMCS_CTRL_CR4_MASK, u32CR4Mask); 4110 4112 AssertRCReturn(rc, rc); 4113 4114 /* Whether to save/load/restore XCR0 during world switch depends on CR4.OSXSAVE and host+guest XCR0. */ 4115 pVCpu->hm.s.fLoadSaveGuestXcr0 = (pMixedCtx->cr4 & X86_CR4_OSXSAVE) && pMixedCtx->aXcr[0] != ASMGetXcr0(); 4111 4116 4112 4117 HMCPU_CF_CLEAR(pVCpu, HM_CHANGED_GUEST_CR4); … … 10649 10654 pVCpu->hm.s.fLoadSaveGuestXcr0 = (pMixedCtx->cr4 & X86_CR4_OSXSAVE) && pMixedCtx->aXcr[0] != ASMGetXcr0(); 10650 10655 10651 return VBOXSTRICTRC_ VAL(rcStrict);10656 return VBOXSTRICTRC_TODO(rcStrict); 10652 10657 } 10653 10658 … … 11049 11054 break; 11050 11055 case 4: /* CR4 */ 11051 pVCpu->hm.s.fLoadSaveGuestXcr0 = (pMixedCtx->cr4 & X86_CR4_OSXSAVE) && pMixedCtx->aXcr[0] != ASMGetXcr0();11052 11056 HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_CR4); 11053 11057 Log4(("CRX CR4 write rc=%Rrc CR4=%#RX64 fLoadSaveGuestXcr0=%u\n", -
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r55293 r55316 3643 3643 AssertLogRelRCReturn(rc, rc); 3644 3644 3645 #if 1 /* Incomplete, so not yet enabled. */3646 3645 bool const fMayHaveXSave = fNestedPagingAndFullGuestExec 3647 3646 && pVM->cpum.s.HostFeatures.fXSaveRstor 3648 && pVM->cpum.s.HostFeatures.fOpSysXSaveRstor 3649 && pVM->cpum.s.HostFeatures.enmCpuVendor == CPUMCPUVENDOR_INTEL /** @todo test and enable on AMD! */; 3650 #else 3651 bool const fMayHaveXSave = false; 3652 #endif 3647 && pVM->cpum.s.HostFeatures.fOpSysXSaveRstor; 3653 3648 /** @cfgm{/CPUM/IsaExts/XSAVE, boolean, depends} 3654 3649 * Expose XSAVE/XRSTOR to the guest if available. For the time being the
Note:
See TracChangeset
for help on using the changeset viewer.