Changeset 52699 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Sep 11, 2014 1:31:23 PM (10 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIM.cpp
r52675 r52699 149 149 150 150 151 VMMR3_INT_DECL(int) GIMR3InitFinalize(PVM pVM) 152 { 153 LogFlow(("GIMR3InitFinalize\n")); 154 151 /** 152 * Initializes the remaining bits of the GIM provider. 153 * This is called after initializing HM and most other VMM components. 154 * 155 * @returns VBox status code. 156 * @param pVM Pointer to the VM. 157 * @param enmWhat What has been completed. 158 * @thread EMT(0) 159 */ 160 VMMR3_INT_DECL(int) GIMR3InitCompleted(PVM pVM) 161 { 155 162 if (!pVM->gim.s.fEnabled) 156 163 return VINF_SUCCESS; 157 164 158 int rc = VINF_SUCCESS;159 165 switch (pVM->gim.s.enmProviderId) 160 166 { 161 167 case GIMPROVIDERID_MINIMAL: 162 {163 rc = GIMR3MinimalInitFinalize(pVM); 164 break;165 }168 return GIMR3MinimalInitCompleted(pVM); 169 170 case GIMPROVIDERID_HYPERV: 171 return GIMR3HvInitCompleted(pVM); 166 172 167 173 default: 168 174 break; 169 175 } 170 return rc;176 return VINF_SUCCESS; 171 177 } 172 178 -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r52685 r52699 111 111 pHv->uHyperHints = GIM_HV_HINT_MSR_FOR_SYS_RESET 112 112 | GIM_HV_HINT_RELAX_TIME_CHECKS; 113 114 /* Hypervisor capabilities; features used by the hypervisor. */115 /** @todo This is currently busted as it's too early. See @bugref{7270}116 * comment 130. */117 pHv->uHyperCaps = HMIsNestedPagingActive(pVM) ? GIM_HV_HOST_FEAT_NESTED_PAGING : 0;118 pHv->uHyperCaps |= HMAreMsrBitmapsAvailable(pVM) ? GIM_HV_HOST_FEAT_MSR_BITMAP : 0;119 113 } 120 114 … … 213 207 AssertLogRelRCReturn(rc, rc); 214 208 209 /* 210 * Insert all MSR ranges of Hyper-V. 211 */ 212 for (unsigned i = 0; i < RT_ELEMENTS(g_aMsrRanges_HyperV); i++) 213 { 214 rc = CPUMR3MsrRangesInsert(pVM, &g_aMsrRanges_HyperV[i]); 215 AssertLogRelRCReturn(rc, rc); 216 } 217 218 return VINF_SUCCESS; 219 } 220 221 222 /** 223 * Initializes remaining bits of the Hyper-V provider. 224 * This is called after initializing HM and almost all other VMM components. 225 * 226 * @returns VBox status code. 227 * @param pVM Pointer to the VM. 228 */ 229 VMMR3_INT_DECL(int) GIMR3HvInitCompleted(PVM pVM) 230 { 231 PGIMHV pHv = &pVM->gim.s.u.Hv; 232 233 /* 234 * Determine interface capabilities based on the version. 235 */ 236 if (!pVM->gim.s.u32Version) 237 { 238 /* Hypervisor capabilities; features used by the hypervisor. */ 239 pHv->uHyperCaps = HMIsNestedPagingActive(pVM) ? GIM_HV_HOST_FEAT_NESTED_PAGING : 0; 240 pHv->uHyperCaps |= HMAreMsrBitmapsAvailable(pVM) ? GIM_HV_HOST_FEAT_MSR_BITMAP : 0; 241 } 242 243 CPUMCPUIDLEAF HyperLeaf; 244 RT_ZERO(HyperLeaf); 215 245 HyperLeaf.uLeaf = UINT32_C(0x40000006); 216 246 HyperLeaf.uEax = pHv->uHyperCaps; … … 218 248 HyperLeaf.uEcx = 0; 219 249 HyperLeaf.uEdx = 0; 220 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);250 int rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf); 221 251 AssertLogRelRCReturn(rc, rc); 222 252 223 /* 224 * Insert all MSR ranges of Hyper-V. 225 */ 226 for (unsigned i = 0; i < RT_ELEMENTS(g_aMsrRanges_HyperV); i++) 227 { 228 rc = CPUMR3MsrRangesInsert(pVM, &g_aMsrRanges_HyperV[i]); 229 AssertLogRelRCReturn(rc, rc); 230 } 231 232 return VINF_SUCCESS; 253 return rc; 233 254 } 234 255 -
trunk/src/VBox/VMM/VMMR3/GIMMinimal.cpp
r52676 r52699 36 36 *******************************************************************************/ 37 37 38 /** 39 * Initializes the Minimal provider. 40 * 41 * @returns VBox status code. 42 * @param pVM Pointer to the VM. 43 */ 38 44 VMMR3_INT_DECL(int) GIMR3MinimalInit(PVM pVM) 39 45 { … … 50 56 51 57 52 VMMR3_INT_DECL(int) GIMR3MinimalInitFinalize(PVM pVM) 58 /** 59 * Initializes remaining bits of the Minimal provider. 60 * This is called after initializing HM and almost all other VMM components. 61 * 62 * @returns VBox status code. 63 * @param pVM Pointer to the VM. 64 */ 65 VMMR3_INT_DECL(int) GIMR3MinimalInitCompleted(PVM pVM) 53 66 { 54 67 /* … … 92 105 } 93 106 107 108 /** 109 * Applies relocations to data and code managed by this component. This function 110 * will be called at init and whenever the VMM need to relocate itself inside 111 * the GC. 112 * 113 * @param pVM Pointer to the VM. 114 * @param offDelta Relocation delta relative to old location. 115 */ 94 116 VMMR3_INT_DECL(void) GIMR3MinimalRelocate(PVM pVM, RTGCINTPTR offDelta) 95 117 { -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r52675 r52699 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1012 1012 #endif 1013 1013 if (RT_SUCCESS(rc)) 1014 rc = GIMR3InitFinalize(pVM);1015 if (RT_SUCCESS(rc))1016 1014 { 1017 1015 PGMR3MemSetup(pVM, false /*fAtReset*/); … … 1176 1174 rc = HMR3InitCompleted(pVM, enmWhat); 1177 1175 if (RT_SUCCESS(rc)) 1178 rc = PGMR3InitCompleted(pVM, enmWhat); 1176 rc = PGMR3InitCompleted(pVM, enmWhat); /** @todo Why is this not inside VMMR3InitCompleted()? */ 1179 1177 #ifndef VBOX_WITH_RAW_MODE 1180 1178 if (enmWhat == VMINITCOMPLETED_RING3) -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r52081 r52699 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 84 84 #include <VBox/vmm/pdmapi.h> 85 85 #include <VBox/vmm/cpum.h> 86 #include <VBox/vmm/gim.h> 86 87 #include <VBox/vmm/mm.h> 87 88 #include <VBox/vmm/iom.h> … … 708 709 709 710 /* 711 * Last chance for GIM to update its CPUID leafs if it requires knowledge/information 712 * from HM initialization. 713 */ 714 rc = GIMR3InitCompleted(pVM); 715 AssertRCReturn(rc, rc); 716 717 /* 710 718 * CPUM's post-initialization (print CPUIDs). 711 719 */
Note:
See TracChangeset
for help on using the changeset viewer.