Changeset 54819 in vbox
- Timestamp:
- Mar 17, 2015 5:58:30 PM (10 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/Makefile.kmk
r54799 r54819 151 151 VMMR3/GIM.cpp \ 152 152 VMMR3/GIMHv.cpp \ 153 VMMR3/GIMKvm.cpp \ 153 154 VMMR3/GIMMinimal.cpp \ 154 155 VMMR3/IEMR3.cpp \ … … 230 231 VMMAll/GIMAll.cpp \ 231 232 VMMAll/GIMAllHv.cpp \ 233 VMMAll/GIMAllKvm.cpp \ 232 234 VMMAll/TMAll.cpp \ 233 235 VMMAll/TMAllCpu.cpp \ … … 456 458 VMMRC/VMMRCA.asm \ 457 459 $(if-expr defined(VBOX_WITH_RAW_MODE), \ 458 VMMRC/CSAMRC.cpp \460 VMMRC/CSAMRC.cpp \ 459 461 VMMRC/PATMRC.cpp \ 460 ,) \462 ,) \ 461 463 VMMRZ/DBGFRZ.cpp \ 462 464 VMMRZ/PGMRZDynMap.cpp \ 463 465 VMMRZ/VMMRZ.cpp \ 464 466 VMMAll/CPUMAllRegs.cpp \ 465 VMMAll/CPUMAllMsrs.cpp \467 VMMAll/CPUMAllMsrs.cpp \ 466 468 VMMAll/DBGFAll.cpp \ 467 VMMAll/IEMAll.cpp \468 VMMAll/IEMAllAImpl.asm \469 VMMAll/IEMAllAImplC.cpp \470 469 VMMAll/IEMAll.cpp \ 470 VMMAll/IEMAllAImpl.asm \ 471 VMMAll/IEMAllAImplC.cpp \ 472 VMMAll/IOMAll.cpp \ 471 473 VMMAll/IOMAllMMIO.cpp \ 472 474 VMMAll/EMAll.cpp \ 473 475 VMMAll/EMAllA.asm \ 474 VMMAll/FTMAll.cpp \ 475 VMMAll/GIMAll.cpp \ 476 VMMAll/GIMAllHv.cpp \ 476 VMMAll/FTMAll.cpp \ 477 VMMAll/GIMAll.cpp \ 478 VMMAll/GIMAllHv.cpp \ 479 VMMAll/GIMAllKvm.cpp \ 477 480 VMMAll/MMAll.cpp \ 478 481 VMMAll/MMAllHyper.cpp \ … … 498 501 VMMAll/VMMAllA.asm \ 499 502 $(if-expr defined(VBOX_WITH_RAW_MODE), \ 500 VMMAll/CSAMAll.cpp \503 VMMAll/CSAMAll.cpp \ 501 504 VMMAll/PATMAll.cpp \ 502 505 ,) … … 552 555 VMMR0/CPUMR0.cpp \ 553 556 VMMR0/CPUMR0A.asm \ 554 VMMR0/GIMR0.cpp \555 VMMR0/GIMR0Hv.cpp \557 VMMR0/GIMR0.cpp \ 558 VMMR0/GIMR0Hv.cpp \ 556 559 VMMR0/GMMR0.cpp \ 557 560 VMMR0/GVMMR0.cpp \ 558 561 VMMR0/HMR0.cpp \ 559 562 VMMR0/HMR0A.asm \ 560 VMMR0/HMVMXR0.cpp \561 VMMR0/HMSVMR0.cpp \563 VMMR0/HMVMXR0.cpp \ 564 VMMR0/HMSVMR0.cpp \ 562 565 VMMR0/PDMR0Device.cpp \ 563 566 VMMR0/PDMR0Driver.cpp \ … … 570 573 VMMRZ/VMMRZ.cpp \ 571 574 VMMAll/CPUMAllRegs.cpp \ 572 VMMAll/CPUMAllMsrs.cpp \575 VMMAll/CPUMAllMsrs.cpp \ 573 576 VMMAll/CPUMStack.cpp \ 574 577 VMMAll/DBGFAll.cpp \ … … 576 579 VMMAll/EMAllA.asm \ 577 580 VMMAll/FTMAll.cpp \ 578 VMMAll/GIMAll.cpp \ 579 VMMAll/GIMAllHv.cpp \ 581 VMMAll/GIMAll.cpp \ 582 VMMAll/GIMAllHv.cpp \ 583 VMMAll/GIMAllKvm.cpp \ 580 584 VMMAll/HMAll.cpp \ 581 VMMAll/IEMAll.cpp \582 VMMAll/IEMAllAImpl.asm \583 VMMAll/IEMAllAImplC.cpp \585 VMMAll/IEMAll.cpp \ 586 VMMAll/IEMAllAImpl.asm \ 587 VMMAll/IEMAllAImplC.cpp \ 584 588 VMMAll/IOMAll.cpp \ 585 589 VMMAll/IOMAllMMIO.cpp \ … … 613 617 VMMR0_SOURCES += \ 614 618 VMMR0/VMMR0TripleFaultHack.cpp \ 615 VMMR0/VMMR0TripleFaultHackA.asm619 VMMR0/VMMR0TripleFaultHackA.asm 616 620 endif 617 621 ifdef VBOX_WITH_NETSHAPER … … 661 665 VMMLibDTrace_INST = $(VBOX_INST_DTRACE_LIB)$(KBUILD_TARGET_ARCH)/ 662 666 VMMLibDTrace_SOURCES = \ 663 dtrace/lib/vbox-types.d \664 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \665 $(VMMLibDTrace_0_OUTDIR)/vm.d \666 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \667 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \668 $(VMMLibDTrace_0_OUTDIR)/x86.d \667 dtrace/lib/vbox-types.d \ 668 dtrace/lib/$(KBUILD_TARGET_ARCH)/vbox-arch-types.d \ 669 $(VMMLibDTrace_0_OUTDIR)/vm.d \ 670 $(VMMLibDTrace_0_OUTDIR)/cpumctx.d \ 671 $(VMMLibDTrace_0_OUTDIR)/CPUMInternal.d \ 672 $(VMMLibDTrace_0_OUTDIR)/x86.d \ 669 673 670 674 -
trunk/src/VBox/VMM/VMMAll/GIMAll.cpp
r54654 r54819 154 154 return gimHvReadMsr(pVCpu, idMsr, pRange, puValue); 155 155 156 case GIMPROVIDERID_KVM: 157 return gimKvmReadMsr(pVCpu, idMsr, pRange, puValue); 158 156 159 default: 157 160 AssertMsgFailed(("GIMReadMsr: for unknown provider %u idMsr=%#RX32 -> #GP(0)", pVM->gim.s.enmProviderId, idMsr)); … … 188 191 return gimHvWriteMsr(pVCpu, idMsr, pRange, uRawValue); 189 192 193 case GIMPROVIDERID_KVM: 194 return gimKvmWriteMsr(pVCpu, idMsr, pRange, uRawValue); 195 190 196 default: 191 197 AssertMsgFailed(("GIMWriteMsr: for unknown provider %u idMsr=%#RX32 -> #GP(0)", pVM->gim.s.enmProviderId, idMsr)); -
trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp
r54701 r54819 154 154 155 155 default: 156 { 156 157 #ifdef IN_RING3 157 158 static uint32_t s_cTimes = 0; … … 161 162 LogFunc(("Unknown/invalid RdMsr (%#RX32) -> #GP(0)\n", idMsr)); 162 163 break; 164 } 163 165 } 164 166 … … 314 316 315 317 default: 318 { 316 319 #ifdef IN_RING3 317 320 static uint32_t s_cTimes = 0; 318 321 if (s_cTimes++ < 20) 319 LogRel(("GIM: HyperV: Unknown/invalid WrMsr (%#x,%#x`%08x) -> #GP(0)\n", idMsr, uRawValue & UINT64_C(0xffffffff00000000),320 uRawValue & UINT64_C(0xffffffff )));322 LogRel(("GIM: HyperV: Unknown/invalid WrMsr (%#x,%#x`%08x) -> #GP(0)\n", idMsr, 323 uRawValue & UINT64_C(0xffffffff00000000), uRawValue & UINT64_C(0xffffffff))); 321 324 #endif 322 325 LogFunc(("Unknown/invalid WrMsr (%#RX32,%#RX64) -> #GP(0)\n", idMsr, uRawValue)); 323 326 break; 327 } 324 328 } 325 329 -
trunk/src/VBox/VMM/VMMR0/GIMR0.cpp
r54655 r54819 96 96 return gimR0HvUpdateParavirtTsc(pVM, u64Offset); 97 97 98 case GIMPROVIDERID_KVM: 99 return VINF_SUCCESS; 100 98 101 case GIMPROVIDERID_NONE: 99 102 return VERR_GIM_NOT_ENABLED; -
trunk/src/VBox/VMM/VMMR3/GIM.cpp
r54654 r54819 30 30 * ease the guest in running under a recognized, virtualized environment. 31 31 * 32 * If the GIM provider configured for the VM needs to be recognized by the guest33 * OS inorder to make use of features supported by the interface. Since it34 * requires co-operation from the guest OS, a GIM provider isalso referred to32 * The GIM provider configured for the VM needs to be recognized by the guest OS 33 * in order to make use of features supported by the interface. Since it 34 * requires co-operation from the guest OS, a GIM provider may also referred to 35 35 * as a paravirtualization interface. 36 36 * 37 * One of the ideas behind this, is primarily for making guests more accurate38 * and efficient when operating in a virtualized environment. For instance, a39 * guest OS which interfaces to VirtualBox through a GIM provider may rely on40 * the provider (and VirtualBox ultimately) for providing the correct TSC41 * frequency of the host processor and may therefore not have to caliberatethe42 * TSC itself, resulting in higher accuracy and saving several CPU cycles.37 * One of the goals of having a paravirtualized interface is for enabling guests 38 * to be more accurate and efficient when operating in a virtualized 39 * environment. For instance, a guest OS which interfaces to VirtualBox through 40 * a GIM provider may rely on the provider for supplying the correct TSC 41 * frequency of the host processor. The guest can then avoid caliberating the 42 * TSC itself, resulting in higher accuracy and better performance. 43 43 * 44 44 * At most, only one GIM provider can be active for a running VM and cannot be … … 63 63 #include "GIMMinimalInternal.h" 64 64 #include "GIMHvInternal.h" 65 #include "GIMKvmInternal.h" 65 66 66 67 /******************************************************************************* … … 68 69 *******************************************************************************/ 69 70 static DECLCALLBACK(int) gimR3Save(PVM pVM, PSSMHANDLE pSSM); 70 static DECLCALLBACK(int) gimR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u Version, uint32_t uPass);71 static DECLCALLBACK(int) gimR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion, uint32_t uPass); 71 72 72 73 … … 136 137 rc = gimR3HvInit(pVM); 137 138 } 139 else if (!RTStrCmp(szProvider, "KVM")) 140 { 141 pVM->gim.s.enmProviderId = GIMPROVIDERID_KVM; 142 rc = gimR3KvmInit(pVM); 143 } 138 144 /** @todo KVM and others. */ 139 145 else … … 164 170 return gimR3HvInitCompleted(pVM); 165 171 172 case GIMPROVIDERID_KVM: 173 return gimR3KvmInitCompleted(pVM); 174 166 175 default: 167 176 break; 168 177 } 178 179 if (!TMR3CpuTickIsFixedRateMonotonic(pVM, true /* fWithParavirtEnabled */)) 180 LogRel(("GIM: Warning!!! Host TSC is unstable. The guest may behave unpredictably with a paravirtualized clock.\n")); 181 169 182 return VINF_SUCCESS; 170 183 } … … 186 199 if ( pVM->gim.s.enmProviderId == GIMPROVIDERID_NONE 187 200 || HMIsEnabled(pVM)) 188 {189 201 return; 190 }191 202 192 203 switch (pVM->gim.s.enmProviderId) … … 204 215 } 205 216 206 case GIMPROVIDERID_KVM: /** @todo KVM. */ 217 case GIMPROVIDERID_KVM: 218 { 219 gimR3KvmRelocate(pVM, offDelta); 220 break; 221 } 222 207 223 default: 208 224 { … … 252 268 break; 253 269 270 case GIMPROVIDERID_KVM: 271 rc = gimR3KvmSave(pVM, pSSM); 272 AssertRCReturn(rc, rc); 273 break; 274 254 275 default: 255 276 break; … … 269 290 * @param uPass The data pass. 270 291 */ 271 DECLCALLBACK(int) gimR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u Version, uint32_t uPass)292 DECLCALLBACK(int) gimR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion, uint32_t uPass) 272 293 { 273 294 if (uPass != SSM_PASS_FINAL) 274 295 return VINF_SUCCESS; 275 if (u Version != GIM_SAVED_STATE_VERSION)296 if (uSSMVersion != GIM_SAVED_STATE_VERSION) 276 297 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 277 298 … … 311 332 { 312 333 case GIMPROVIDERID_HYPERV: 313 rc = gimR3HvLoad(pVM, pSSM, uVersion); 334 rc = gimR3HvLoad(pVM, pSSM, uSSMVersion); 335 AssertRCReturn(rc, rc); 336 break; 337 338 case GIMPROVIDERID_KVM: 339 rc = gimR3KvmLoad(pVM, pSSM, uSSMVersion); 314 340 AssertRCReturn(rc, rc); 315 341 break; … … 339 365 return gimR3HvTerm(pVM); 340 366 367 case GIMPROVIDERID_KVM: 368 return gimR3KvmTerm(pVM); 369 341 370 default: 342 371 break; … … 361 390 case GIMPROVIDERID_HYPERV: 362 391 return gimR3HvReset(pVM); 392 393 case GIMPROVIDERID_KVM: 394 return gimR3KvmReset(pVM); 363 395 364 396 default: … … 403 435 return gimR3HvGetMmio2Regions(pVM, pcRegions); 404 436 405 case GIMPROVIDERID_KVM: /** @todo KVM. */406 437 default: 407 438 break; -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r54701 r54819 380 380 SSMR3PutU32(pSSM, GIM_HV_SAVED_STATE_VERSION); 381 381 382 /** @todo Save per-VCPU data. */383 384 382 /* 385 383 * Save per-VM MSRs. … … 451 449 if (uHvSavedStatVersion != GIM_HV_SAVED_STATE_VERSION) 452 450 return SSMR3SetLoadError(pSSM, VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION, RT_SRC_POS, 453 N_("Unsupported Hyper-V saved state version %u (expected %u)."), 454 uHvSavedStatVersion, GIM_HV_SAVED_STATE_VERSION); 455 456 /** @todo Load per-VCPU data. */ 451 N_("Unsupported Hyper-V saved-state version %u (expected %u)."), uHvSavedStatVersion, 452 GIM_HV_SAVED_STATE_VERSION); 457 453 458 454 /* -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r54793 r54819 4574 4574 4575 4575 /** @todo What about ballooning of large pages??! */ 4576 #if 0 4576 4577 Assert( PGM_PAGE_GET_PDE_TYPE(pPage) != PGM_PAGE_PDE_TYPE_PDE 4577 4578 && PGM_PAGE_GET_PDE_TYPE(pPage) != PGM_PAGE_PDE_TYPE_PDE_DISABLED); 4579 #endif 4578 4580 4579 4581 if ( PGM_PAGE_IS_ZERO(pPage) -
trunk/src/VBox/VMM/include/GIMInternal.h
r52772 r54819 21 21 #include <VBox/vmm/gim.h> 22 22 #include "GIMHvInternal.h" 23 #include "GIMKvmInternal.h" 23 24 #include "GIMMinimalInternal.h" 24 25 … … 73 74 { 74 75 GIMHV Hv; 75 76 /** @todo KVM and others. */ 76 GIMKVM Kvm; 77 77 } u; 78 78 } GIM; … … 86 86 typedef struct GIMCPU 87 87 { 88 union 89 { 90 GIMKVMCPU KvmCpu; 91 } u; 88 92 } GIMCPU; 89 93 /** Pointer to GIM VMCPU instance data. */
Note:
See TracChangeset
for help on using the changeset viewer.