Changeset 13221
- Timestamp:
- 10/13/08 16:43:54 (3 months ago)
- Files:
-
- trunk/include/VBox/hwaccm.h (modified) (1 diff)
- trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp (modified) (5 diffs)
- trunk/src/VBox/Main/ConsoleImpl2.cpp (modified) (1 diff)
- trunk/src/VBox/Main/MachineDebuggerImpl.cpp (modified) (1 diff)
- trunk/src/VBox/Main/MachineImpl.cpp (modified) (6 diffs)
- trunk/src/VBox/Main/Makefile.kmk (modified) (1 diff)
- trunk/src/VBox/Main/idl/VirtualBox.xidl (modified) (4 diffs)
- trunk/src/VBox/Main/include/MachineDebuggerImpl.h (modified) (1 diff)
- trunk/src/VBox/Main/include/MachineImpl.h (modified) (2 diffs)
- trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd (modified) (2 diffs)
- trunk/src/VBox/VMM/HWACCM.cpp (modified) (3 diffs)
- trunk/src/VBox/VMM/HWACCMInternal.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/VBox/hwaccm.h
r12989 r13221 111 111 VMMR3DECL(bool) HWACCMR3IsAllowed(PVM pVM); 112 112 VMMR3DECL(void) HWACCMR3PagingModeChanged(PVM pVM, PGMMODE enmShadowMode); 113 VMMR3DECL(bool) HWACCMR3IsVPIDActive(PVM pVM); 114 113 115 /** @} */ 114 116 #endif /* IN_RING3 */ trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r13082 r13221 334 334 " [-hwvirtex on|off|default]\n" 335 335 " [-nestedpaging on|off]\n" 336 " [-vtxvpid on|off]\n" 336 337 " [-monitorcount <number>]\n" 337 338 " [-bioslogofadein on|off]\n" … … 998 999 else 999 1000 RTPrintf("Nested Paging: %s\n", HWVirtExNestedPagingEnabled ? "on" : "off"); 1001 1002 BOOL HWVirtExVPIDEnabled; 1003 machine->COMGETTER(HWVirtExVPIDEnabled)(&HWVirtExVPIDEnabled); 1004 if (details == VMINFO_MACHINEREADABLE) 1005 RTPrintf("vtxvpid=\"%s\"\n", HWVirtExVPIDEnabled ? "on" : "off"); 1006 else 1007 RTPrintf("VT-x VPID: %s\n", HWVirtExVPIDEnabled ? "on" : "off"); 1000 1008 1001 1009 MachineState_T machineState; … … 3798 3806 char *hwvirtex = NULL; 3799 3807 char *nestedpaging = NULL; 3808 char *vtxvpid = NULL; 3800 3809 char *pae = NULL; 3801 3810 char *ioapic = NULL; … … 3931 3940 nestedpaging = argv[i]; 3932 3941 } 3942 else if (strcmp(argv[i], "-vtxvpid") == 0) 3943 { 3944 if (argc <= i + 1) 3945 return errorArgument("Missing argument to '%s'", argv[i]); 3946 i++; 3947 vtxvpid = argv[i]; 3948 } 3933 3949 else if (strcmp(argv[i], "-pae") == 0) 3934 3950 { … … 4577 4593 { 4578 4594 errorArgument("Invalid -nestedpaging argument '%s'", ioapic); 4595 rc = E_FAIL; 4596 break; 4597 } 4598 } 4599 if (vtxvpid) 4600 { 4601 if (strcmp(vtxvpid, "on") == 0) 4602 { 4603 CHECK_ERROR(machine, COMSETTER(HWVirtExVPIDEnabled)(true)); 4604 } 4605 else if (strcmp(vtxvpid, "off") == 0) 4606 { 4607 CHECK_ERROR(machine, COMSETTER(HWVirtExVPIDEnabled)(false)); 4608 } 4609 else 4610 { 4611 errorArgument("Invalid -vtxvpid argument '%s'", ioapic); 4579 4612 rc = E_FAIL; 4580 4613 break; trunk/src/VBox/Main/ConsoleImpl2.cpp
r13165 r13221 189 189 hrc = pMachine->COMGETTER(HWVirtExNestedPagingEnabled)(&fEnableNestedPaging); H(); 190 190 rc = CFGMR3InsertInteger(pRoot, "EnableNestedPaging", fEnableNestedPaging); RC_CHECK(); 191 192 /* VPID (VT-x) */ 193 BOOL fEnableVPID = false; 194 hrc = pMachine->COMGETTER(HWVirtExVPIDEnabled)(&fEnableVPID); H(); 195 rc = CFGMR3InsertInteger(pRoot, "EnableVPID", fEnableVPID); RC_CHECK(); 191 196 192 197 /* Physical Address Extension (PAE) */ trunk/src/VBox/Main/MachineDebuggerImpl.cpp
r10695 r13221 552 552 553 553 /** 554 * Returns the current VPID flag. 555 * 556 * @returns COM status code 557 * @param enabled address of result variable 558 */ 559 STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExVPIDEnabled)(BOOL *enabled) 560 { 561 if (!enabled) 562 return E_POINTER; 563 564 AutoWriteLock alock (this); 565 CHECK_READY(); 566 567 Console::SafeVMPtrQuiet pVM (mParent); 568 if (pVM.isOk()) 569 *enabled = HWACCMR3IsVPIDActive(pVM.raw()); 570 else 571 *enabled = false; 572 return S_OK; 573 } 574 575 /** 554 576 * Returns the current PAE flag. 555 577 * trunk/src/VBox/Main/MachineImpl.cpp
r13165 r13221 191 191 mHWVirtExEnabled = TSBool_False; 192 192 mHWVirtExNestedPagingEnabled = false; 193 mHWVirtExVPIDEnabled = false; 193 194 mPAEEnabled = false; 194 195 … … 219 220 mHWVirtExEnabled != that.mHWVirtExEnabled || 220 221 mHWVirtExNestedPagingEnabled != that.mHWVirtExNestedPagingEnabled || 222 mHWVirtExVPIDEnabled != that.mHWVirtExVPIDEnabled || 221 223 mPAEEnabled != that.mPAEEnabled || 222 224 mClipboardMode != that.mClipboardMode) … … 1153 1155 } 1154 1156 1157 STDMETHODIMP Machine::COMGETTER(HWVirtExVPIDEnabled)(BOOL *enabled) 1158 { 1159 if (!enabled) 1160 return E_POINTER; 1161 1162 AutoCaller autoCaller (this); 1163 CheckComRCReturnRC (autoCaller.rc()); 1164 1165 AutoReadLock alock (this); 1166 1167 *enabled = mHWData->mHWVirtExVPIDEnabled; 1168 1169 return S_OK; 1170 } 1171 1172 STDMETHODIMP Machine::COMSETTER(HWVirtExVPIDEnabled)(BOOL enable) 1173 { 1174 AutoCaller autoCaller (this); 1175 CheckComRCReturnRC (autoCaller.rc()); 1176 1177 AutoWriteLock alock (this); 1178 1179 HRESULT rc = checkStateDependency (MutableStateDep); 1180 CheckComRCReturnRC (rc); 1181 1182 /** @todo check validity! */ 1183 1184 mHWData.backup(); 1185 mHWData->mHWVirtExVPIDEnabled = enable; 1186 1187 return S_OK; 1188 } 1155 1189 1156 1190 STDMETHODIMP Machine::COMGETTER(PAEEnabled)(BOOL *enabled) … … 4758 4792 mHWData->mHWVirtExEnabled = TSBool_Default; 4759 4793 mHWData->mHWVirtExNestedPagingEnabled = false; 4794 mHWData->mHWVirtExVPIDEnabled = false; 4760 4795 mHWData->mPAEEnabled = false; 4761 4796 … … 4779 4814 { 4780 4815 mHWData->mHWVirtExNestedPagingEnabled = HWVirtExNestedPagingNode.value <bool> ("enabled"); 4816 } 4817 4818 /* HardwareVirtExVPID (optional, default is false) */ 4819 Key HWVirtExVPIDNode = cpuNode.findKey ("HardwareVirtExVPID"); 4820 if (!HWVirtExVPIDNode.isNull()) 4821 { 4822 mHWData->mHWVirtExVPIDEnabled = HWVirtExVPIDNode.value <bool> ("enabled"); 4781 4823 } 4782 4824 … … 6172 6214 hwVirtExNode.setStringValue ("enabled", value); 6173 6215 6174 /* Nested paging (optional, default is true) */6216 /* Nested paging (optional, default is false) */ 6175 6217 Key HWVirtExNestedPagingNode = cpuNode.createKey ("HardwareVirtExNestedPaging"); 6176 6218 HWVirtExNestedPagingNode.setValue <bool> ("enabled", !!mHWData->mHWVirtExNestedPagingEnabled); 6177 6219 6220 /* VPID (optional, default is false) */ 6221 Key HWVirtExVPIDNode = cpuNode.createKey ("HardwareVirtExVPID"); 6222 HWVirtExVPIDNode.setValue <bool> ("enabled", !!mHWData->mHWVirtExVPIDEnabled); 6223 6178 6224 /* PAE (optional, default is false) */ 6179 6225 Key PAENode = cpuNode.createKey ("PAE"); trunk/src/VBox/Main/Makefile.kmk
r12944 r13221 27 27 # Include sub-makefile(s). 28 28 # 29 ifdef VBOX_WITH_WEBSERVICES30 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk31 endif29 #ifdef VBOX_WITH_WEBSERVICES 30 # include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk 31 #endif 32 32 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk 33 33 trunk/src/VBox/Main/idl/VirtualBox.xidl
r13165 r13221 2645 2645 <interface 2646 2646 name="IMachine" extends="$unknown" 2647 uuid=" 1e509de4-d96c-4f44-8b94-860194f710ac"2647 uuid="9797b8f2-0631-4db8-813d-4c63356b223b" 2648 2648 wsmap="managed" 2649 2649 > … … 2876 2876 </attribute> 2877 2877 2878 <attribute name="HWVirtExVPIDEnabled" type="boolean" default="false"> 2879 <desc> 2880 This setting determines whether VirtualBox will try to make use of 2881 the VPID extension of Intel VT-x. Note that in case such extensions are 2882 not available, they will not be used. 2883 </desc> 2884 </attribute> 2885 2878 2886 <attribute name="PAEEnabled" type="boolean" default="false"> 2879 2887 <desc> … … 8871 8879 <interface 8872 8880 name="IMachineDebugger" extends="$unknown" 8873 uuid=" 54ebce96-fa7d-4a4d-bc81-a7db41c29637"8881 uuid="0de52346-938b-4020-a33b-471be542f3ff" 8874 8882 wsmap="suppress" 8875 8883 > … … 8942 8950 Flag indicating whether the VM is currently making use of the nested paging 8943 8951 CPU hardware virtualization extension. 8952 </desc> 8953 </attribute> 8954 8955 <attribute name="HWVirtExVPIDEnabled" type="boolean" readonly="yes"> 8956 <desc> 8957 Flag indicating whether the VM is currently making use of the VPID 8958 VT-x extension. 8944 8959 </desc> 8945 8960 </attribute> trunk/src/VBox/Main/include/MachineDebuggerImpl.h
r10695 r13221 68 68 STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *enabled); 69 69 STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled))(BOOL *enabled); 70 STDMETHOD(COMGETTER(HWVirtExVPIDEnabled))(BOOL *enabled); 70 71 STDMETHOD(COMGETTER(PAEEnabled))(BOOL *enabled); 71 72 STDMETHOD(COMGETTER(VirtualTimeRate))(ULONG *pct); trunk/src/VBox/Main/include/MachineImpl.h
r13165 r13221 255 255 TSBool_T mHWVirtExEnabled; 256 256 BOOL mHWVirtExNestedPagingEnabled; 257 BOOL mHWVirtExVPIDEnabled; 257 258 BOOL mPAEEnabled; 258 259 … … 489 490 STDMETHOD(COMGETTER(HWVirtExNestedPagingEnabled))(BOOL *enabled); 490 491 STDMETHOD(COMSETTER(HWVirtExNestedPagingEnabled))(BOOL enabled); 492 STDMETHOD(COMGETTER(HWVirtExVPIDEnabled))(BOOL *enabled); 493 STDMETHOD(COMSETTER(HWVirtExVPIDEnabled))(BOOL enabled); 491 494 STDMETHOD(COMGETTER(PAEEnabled))(BOOL *enabled); 492 495 STDMETHOD(COMSETTER(PAEEnabled))(BOOL enabled); trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r12126 r13221 417 417 </xsd:complexType> 418 418 419 <xsd:complexType name="THWVirtExVPIDType"> 420 <xsd:attribute name="enabled" type="xsd:boolean" default="false"/> 421 </xsd:complexType> 422 419 423 <xsd:complexType name="TPAEType"> 420 424 <xsd:attribute name="enabled" type="xsd:boolean" default="false"/> … … 425 429 <xsd:element name="HardwareVirtEx" type="THWVirtExType" minOccurs="0"/> 426 430 <xsd:element name="HardwareVirtExNestedPaging" type="THWVirtExNestedPagingType" minOccurs="0"/> 431 <xsd:element name="HardwareVirtExVPID" type="THWVirtExVPIDType" minOccurs="0"/> 427 432 <xsd:element name="PAE" type="TPAEType" minOccurs="0"/> 428 433 </xsd:sequence> trunk/src/VBox/VMM/HWACCM.cpp
r13178 r13221 195 195 /* Nested paging: disabled by default. */ 196 196 rc = CFGMR3QueryBoolDef(CFGMR3GetRoot(pVM), "EnableNestedPaging", &pVM->hwaccm.s.fAllowNestedPaging, false); 197 AssertRC(rc); 198 199 /* VT-x VPID: disabled by default. */ 200 rc = CFGMR3QueryBoolDef(CFGMR3GetRoot(pVM), "EnableVPID", &pVM->hwaccm.s.fAllowVPID, false); 197 201 AssertRC(rc); 198 202 … … 576 580 #endif /* HWACCM_VTX_WITH_EPT */ 577 581 #ifdef HWACCM_VTX_WITH_VPID 578 else579 if (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VPID)580 pVM->hwaccm.s.vmx.fVPID = true;582 if ( (pVM->hwaccm.s.vmx.msr.vmx_proc_ctls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VPID) 583 && !pVM->hwaccm.s.fNestedPaging) /* VPID and EPT are mutually exclusive. */ 584 pVM->hwaccm.s.vmx.fVPID = pVM->hwaccm.s.fAllowVPID; 581 585 #endif /* HWACCM_VTX_WITH_VPID */ 582 586 … … 954 958 955 959 /** 960 * Checks if we are currently using VPID in VT-x mode. 961 * 962 * @returns boolean 963 * @param pVM The VM to operate on. 964 */ 965 VMMR3DECL(bool) HWACCMR3IsVPIDActive(PVM pVM) 966 { 967 return pVM->hwaccm.s.vmx.fVPID; 968 } 969 970 971 /** 956 972 * Checks if internal events are pending. In that case we are not allowed to dispatch interrupts. 957 973 * trunk/src/VBox/VMM/HWACCMInternal.h
r13204 r13221 42 42 #define HWACCM_VMX_EMULATE_REALMODE 43 43 #define HWACCM_VTX_WITH_EPT 44 #define HWACCM_VTX_WITH_VPID 44 45 45 46 __BEGIN_DECLS … … 189 190 /** Set if nested paging is allowed. */ 190 191 bool fAllowNestedPaging; 192 /** Set if VT-x VPID is allowed. */ 193 bool fAllowVPID; 191 194 192 195 /** Set if we need to flush the TLB during the world switch. */ … … 196 199 bool fFPUOldStyleOverride; 197 200 201 #if 0 198 202 /** Explicit alignment padding to make 32-bit gcc align u64RegisterMask 199 203 * naturally. */ 200 204 bool padding[1]; 205 #endif 201 206 202 207 /** HWACCM_CHANGED_* flags. */

