Changeset 51981 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 11, 2014 6:16:19 AM (10 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r51560 r51981 274 274 275 275 /** 276 * Checks if nested paging is enabled 277 * 278 * @returns boolean276 * Checks if nested paging is enabled. 277 * 278 * @returns true if nested paging is active, false otherwise. 279 279 * @param pVM Pointer to the VM. 280 280 */ … … 283 283 return HMIsEnabled(pVM) && pVM->hm.s.fNestedPaging; 284 284 } 285 286 287 /** 288 * Checks if MSR bitmaps are available. It is assumed that when it's available 289 * it will be used as well. 290 * 291 * @returns true if MSR bitmaps are available, false otherwise. 292 * @param pVM Pointer to the VM. 293 */ 294 VMM_INT_DECL(bool) HMAreMsrBitmapsAvailable(PVM pVM) 295 { 296 if (HMIsEnabled(pVM)) 297 { 298 if (pVM->hm.s.svm.fSupported) 299 return true; 300 301 if ( pVM->hm.s.vmx.fSupported 302 && (pVM->hm.s.vmx.Msrs.VmxProcCtls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)) 303 { 304 return true; 305 } 306 } 307 return false; 308 } 309 285 310 286 311 /** -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r51961 r51981 976 976 } 977 977 978 /* Allocate the MSR-bitmap if supported by the CPU. The MSR-bitmap is for transparent accesses of specific MSRs. */ 978 /* 979 * Allocate the MSR-bitmap if supported by the CPU. The MSR-bitmap is for 980 * transparent accesses of specific MSRs. 981 * 982 * If the condition for enabling MSR bitmaps changes here, don't forget to 983 * update HMIsMsrBitmapsAvailable(). 984 */ 979 985 if (pVM->hm.s.vmx.Msrs.VmxProcCtls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS) 980 986 { -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r51980 r51981 88 88 if (!pVM->gim.s.u32Version) 89 89 { 90 /* Basic features. */ 90 91 pHv->uBaseFeat = 0 91 92 //| GIM_HV_BASE_FEAT_VP_RUNTIME_MSR … … 104 105 ; 105 106 107 /* Miscellaneous features. */ 106 108 pHv->uMiscFeat = GIM_HV_MISC_FEAT_TIMER_FREQ; 107 109 110 /* Hypervisor recommendations to the guest. */ 108 111 pHv->uHyperHints = GIM_HV_HINT_MSR_FOR_SYS_RESET; 112 113 /* Hypervisor capabilities; features used by the hypervisor. */ 114 pHv->uHyperCaps = HMIsNestedPagingActive(pVM) ? GIM_HV_HOST_FEAT_NESTED_PAGING : 0; 115 pHv->uHyperCaps |= HMAreMsrBitmapsAvailable(pVM) ? GIM_HV_HOST_FEAT_MSR_BITMAP : 0; 109 116 } 110 117 … … 161 168 RT_ZERO(HyperLeaf); 162 169 HyperLeaf.uLeaf = UINT32_C(0x40000000); 163 HyperLeaf.uEax = UINT32_C(0x4000000 5); /* Minimum value for Hyper-V*/170 HyperLeaf.uEax = UINT32_C(0x40000006); /* Minimum value for Hyper-V is 0x40000005. */ 164 171 HyperLeaf.uEbx = 0x7263694D; /* 'Micr' */ 165 172 HyperLeaf.uEcx = 0x666F736F; /* 'osof' */ … … 203 210 AssertLogRelRCReturn(rc, rc); 204 211 212 HyperLeaf.uLeaf = UINT32_C(0x40000006); 213 HyperLeaf.uEax = pHv->uHyperCaps; 214 HyperLeaf.uEbx = 0; 215 HyperLeaf.uEcx = 0; 216 HyperLeaf.uEdx = 0; 217 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf); 218 AssertLogRelRCReturn(rc, rc); 219 205 220 /* 206 221 * Insert all MSR ranges of Hyper-V. … … 321 336 rc = SSMR3PutU32(pSSM, pcHv->uMiscFeat); AssertRCReturn(rc, rc); 322 337 rc = SSMR3PutU32(pSSM, pcHv->uHyperHints); AssertRCReturn(rc, rc); 338 rc = SSMR3PutU32(pSSM, pcHv->uHyperCaps); AssertRCReturn(rc, rc); 323 339 324 340 /* … … 384 400 rc = SSMR3GetU32(pSSM, &pHv->uMiscFeat); AssertRCReturn(rc, rc); 385 401 rc = SSMR3GetU32(pSSM, &pHv->uHyperHints); AssertRCReturn(rc, rc); 402 rc = SSMR3GetU32(pSSM, &pHv->uHyperCaps); AssertRCReturn(rc, rc); 386 403 387 404 /* -
trunk/src/VBox/VMM/include/GIMHvInternal.h
r51961 r51981 471 471 /** Miscellaneous features. */ 472 472 uint32_t uMiscFeat; 473 /** Hypervisor hints . */473 /** Hypervisor hints to the guest. */ 474 474 uint32_t uHyperHints; 475 /** Alignment padding. */476 uint32_t u 32Alignment0;475 /** Hypervisor capabilities. */ 476 uint32_t uHyperCaps; 477 477 478 478 /** Per-VM R0 Spinlock for protecting EMT writes to the TSC page. */
Note:
See TracChangeset
for help on using the changeset viewer.