Changeset 14650 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Nov 26, 2008 3:25:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r14649 r14650 413 413 414 414 /* Init TSC offset to zero. */ 415 rc = VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_FULL, 0); 416 #if HC_ARCH_BITS == 32 417 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_HIGH, 0); 418 #endif 419 AssertRC(rc); 420 421 rc = VMXWriteVMCS(VMX_VMCS_CTRL_IO_BITMAP_A_FULL, 0); 422 #if HC_ARCH_BITS == 32 423 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_IO_BITMAP_A_HIGH, 0); 424 #endif 425 AssertRC(rc); 426 427 rc = VMXWriteVMCS(VMX_VMCS_CTRL_IO_BITMAP_B_FULL, 0); 428 #if HC_ARCH_BITS == 32 429 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_IO_BITMAP_B_HIGH, 0); 430 #endif 415 rc = VMXWriteVMCS64(VMX_VMCS_CTRL_TSC_OFFSET_FULL, 0); 416 AssertRC(rc); 417 418 rc = VMXWriteVMCS64(VMX_VMCS_CTRL_IO_BITMAP_A_FULL, 0); 419 AssertRC(rc); 420 421 rc = VMXWriteVMCS64(VMX_VMCS_CTRL_IO_BITMAP_B_FULL, 0); 431 422 AssertRC(rc); 432 423 … … 435 426 { 436 427 /* Optional */ 437 rc = VMXWriteVMCS(VMX_VMCS_CTRL_MSR_BITMAP_FULL, pVM->hwaccm.s.vmx.pMSRBitmapPhys); 438 #if HC_ARCH_BITS == 32 439 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_MSR_BITMAP_HIGH, pVM->hwaccm.s.vmx.pMSRBitmapPhys >> 32ULL); 440 #endif 428 rc = VMXWriteVMCS64(VMX_VMCS_CTRL_MSR_BITMAP_FULL, pVM->hwaccm.s.vmx.pMSRBitmapPhys); 441 429 AssertRC(rc); 442 430 } 443 431 444 432 /* Clear MSR controls. */ 445 rc = VMXWriteVMCS(VMX_VMCS_CTRL_VMEXIT_MSR_STORE_FULL, 0); 446 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_VMEXIT_MSR_LOAD_FULL, 0); 447 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_VMENTRY_MSR_LOAD_FULL, 0); 448 #if HC_ARCH_BITS == 32 449 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_VMEXIT_MSR_STORE_HIGH, 0); 450 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_VMEXIT_MSR_LOAD_HIGH, 0); 451 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_VMEXIT_MSR_LOAD_HIGH, 0); 452 #endif 433 rc = VMXWriteVMCS64(VMX_VMCS_CTRL_VMEXIT_MSR_STORE_FULL, 0); 434 rc |= VMXWriteVMCS64(VMX_VMCS_CTRL_VMEXIT_MSR_LOAD_FULL, 0); 435 rc |= VMXWriteVMCS64(VMX_VMCS_CTRL_VMENTRY_MSR_LOAD_FULL, 0); 453 436 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_EXIT_MSR_STORE_COUNT, 0); 454 437 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_EXIT_MSR_LOAD_COUNT, 0); … … 460 443 /* Optional */ 461 444 rc = VMXWriteVMCS(VMX_VMCS_CTRL_TPR_THRESHOLD, 0); 462 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_VAPIC_PAGEADDR_FULL, pVM->hwaccm.s.vmx.pAPICPhys); 463 #if HC_ARCH_BITS == 32 464 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_VAPIC_PAGEADDR_HIGH, pVM->hwaccm.s.vmx.pAPICPhys >> 32ULL); 465 #endif 445 rc |= VMXWriteVMCS64(VMX_VMCS_CTRL_VAPIC_PAGEADDR_FULL, pVM->hwaccm.s.vmx.pAPICPhys); 466 446 AssertRC(rc); 467 447 } 468 448 469 449 /* Set link pointer to -1. Not currently used. */ 470 #if HC_ARCH_BITS == 32 471 rc = VMXWriteVMCS(VMX_VMCS_GUEST_LINK_PTR_FULL, 0xFFFFFFFF); 472 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_LINK_PTR_HIGH, 0xFFFFFFFF); 473 #else 474 rc = VMXWriteVMCS(VMX_VMCS_GUEST_LINK_PTR_FULL, 0xFFFFFFFFFFFFFFFF); 475 #endif 450 rc = VMXWriteVMCS64(VMX_VMCS_GUEST_LINK_PTR_FULL, 0xFFFFFFFFFFFFFFFF); 476 451 AssertRC(rc); 477 452 … … 908 883 { 909 884 Pdpe = PGMGstGetPaePDPtr(pVM, i); 910 int rc = VMXWriteVMCS(VMX_VMCS_GUEST_PDPTR0_FULL + i*2, Pdpe.u); 911 #if HC_ARCH_BITS == 32 912 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_PDPTR0_FULL + i*2 + 1, Pdpe.u >> 32ULL); 913 #endif 885 int rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL + i*2, Pdpe.u); 914 886 AssertRC(rc); 915 887 } … … 1289 1261 | (VMX_EPT_PAGE_WALK_LENGTH_DEFAULT << VMX_EPT_PAGE_WALK_LENGTH_SHIFT); 1290 1262 1291 rc = VMXWriteVMCS(VMX_VMCS_CTRL_EPTP_FULL, pVCpu->hwaccm.s.vmx.GCPhysEPTP); 1292 #if HC_ARCH_BITS == 32 1293 rc = VMXWriteVMCS(VMX_VMCS_CTRL_EPTP_HIGH, (uint32_t)(pVCpu->hwaccm.s.vmx.GCPhysEPTP >> 32ULL)); 1294 #endif 1263 rc = VMXWriteVMCS64(VMX_VMCS_CTRL_EPTP_FULL, pVCpu->hwaccm.s.vmx.GCPhysEPTP); 1295 1264 AssertRC(rc); 1296 1265 … … 1359 1328 1360 1329 /* IA32_DEBUGCTL MSR. */ 1361 rc = VMXWriteVMCS(VMX_VMCS_GUEST_DEBUGCTL_FULL, 0); 1362 rc |= VMXWriteVMCS(VMX_VMCS_GUEST_DEBUGCTL_HIGH, 0); 1330 rc = VMXWriteVMCS64(VMX_VMCS_GUEST_DEBUGCTL_FULL, 0); 1363 1331 AssertRC(rc); 1364 1332 … … 1397 1365 { 1398 1366 /* Note: VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT takes precedence over TSC_OFFSET */ 1399 rc = VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_FULL, u64TSCOffset); 1400 #if HC_ARCH_BITS == 32 1401 rc |= VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_HIGH, (uint32_t)(u64TSCOffset >> 32ULL)); 1402 #endif 1367 rc = VMXWriteVMCS64(VMX_VMCS_CTRL_TSC_OFFSET_FULL, u64TSCOffset); 1403 1368 AssertRC(rc); 1404 1369 … … 2373 2338 Assert(pVM->hwaccm.s.fNestedPaging); 2374 2339 2375 #if HC_ARCH_BITS == 64 2376 rc = VMXReadVMCS(VMX_VMCS_EXIT_PHYS_ADDR_FULL, &GCPhys); 2377 AssertRC(rc); 2378 #else 2379 uint32_t val_hi; 2380 rc = VMXReadVMCS(VMX_VMCS_EXIT_PHYS_ADDR_FULL, &val); 2381 AssertRC(rc); 2382 rc = VMXReadVMCS(VMX_VMCS_EXIT_PHYS_ADDR_HIGH, &val_hi); 2383 AssertRC(rc); 2384 GCPhys = RT_MAKE_U64(val, val_hi); 2385 #endif 2386 2340 rc = VMXReadVMCS64(VMX_VMCS_EXIT_PHYS_ADDR_FULL, &GCPhys); 2341 AssertRC(rc); 2387 2342 Assert(((exitQualification >> 7) & 3) != 2); 2388 2343 … … 2435 2390 Assert(pVM->hwaccm.s.fNestedPaging); 2436 2391 2437 #if HC_ARCH_BITS == 64 2438 rc = VMXReadVMCS(VMX_VMCS_EXIT_PHYS_ADDR_FULL, &GCPhys); 2439 AssertRC(rc); 2440 #else 2441 uint32_t val_hi; 2442 rc = VMXReadVMCS(VMX_VMCS_EXIT_PHYS_ADDR_FULL, &val); 2443 AssertRC(rc); 2444 rc = VMXReadVMCS(VMX_VMCS_EXIT_PHYS_ADDR_HIGH, &val_hi); 2445 AssertRC(rc); 2446 GCPhys = RT_MAKE_U64(val, val_hi); 2447 #endif 2392 rc = VMXReadVMCS64(VMX_VMCS_EXIT_PHYS_ADDR_FULL, &GCPhys); 2393 AssertRC(rc); 2448 2394 2449 2395 Log(("VMX_EXIT_EPT_MISCONFIG for %VGp\n", GCPhys));
Note:
See TracChangeset
for help on using the changeset viewer.