- Timestamp:
- Apr 11, 2013 11:20:33 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r45498 r45501 50 50 #endif 51 51 52 #define VMX_SEL_UNUSABLE RT_BIT(16) 52 #define VMX_SEL_UNUSABLE RT_BIT(16) 53 #define VMX_FLUSH_TAGGED_TLB_EPT_VPID 0 54 #define VMX_FLUSH_TAGGED_TLB_EPT 1 55 #define VMX_FLUSH_TAGGED_TLB_VPID 2 56 #define VMX_FLUSH_TAGGED_TLB_NONE 3 53 57 54 58 /** … … 1424 1428 1425 1429 /** 1430 * Flushes the guest TLB entry based on CPU capabilities. 1431 * 1432 * @param pVCpu Pointer to the VMCPU. 1433 */ 1434 DECLINLINE(void) hmR0VmxFlushTaggedTlb(PVMCPU pVCpu) 1435 { 1436 PVM pVM = pVCpu->CTX_SUFF(pVM); 1437 switch (pVM->hm.s.vmx.uFlushTaggedTlb) 1438 { 1439 case VMX_FLUSH_TAGGED_TLB_EPT_VPID: hmR0VmxFlushTaggedTlbBoth(pVM, pVCpu); break; 1440 case VMX_FLUSH_TAGGED_TLB_EPT: hmR0VmxFlushTaggedTlbEpt(pVM, pVCpu); break; 1441 case VMX_FLUSH_TAGGED_TLB_VPID: hmR0VmxFlushTaggedTlbVpid(pVM, pVCpu); break; 1442 case VMX_FLUSH_TAGGED_TLB_NONE: hmR0VmxFlushTaggedTlbNone(pVM, pVCpu); break; 1443 default: 1444 AssertMsgFailed(("Invalid flush-tag function identifier\n")); 1445 break; 1446 } 1447 } 1448 1449 1450 /** 1426 1451 * Sets up the appropriate tagged TLB-flush level and handler for flushing guest 1427 1452 * TLB entries from the host TLB before VM-entry. … … 1503 1528 */ 1504 1529 if (pVM->hm.s.fNestedPaging && pVM->hm.s.vmx.fVpid) 1505 pVM->hm.s.vmx. pfnFlushTaggedTlb = hmR0VmxFlushTaggedTlbBoth;1530 pVM->hm.s.vmx.uFlushTaggedTlb = VMX_FLUSH_TAGGED_TLB_EPT_VPID; 1506 1531 else if (pVM->hm.s.fNestedPaging) 1507 pVM->hm.s.vmx. pfnFlushTaggedTlb = hmR0VmxFlushTaggedTlbEpt;1532 pVM->hm.s.vmx.uFlushTaggedTlb = VMX_FLUSH_TAGGED_TLB_EPT; 1508 1533 else if (pVM->hm.s.vmx.fVpid) 1509 pVM->hm.s.vmx. pfnFlushTaggedTlb = hmR0VmxFlushTaggedTlbVpid;1534 pVM->hm.s.vmx.uFlushTaggedTlb = VMX_FLUSH_TAGGED_TLB_VPID; 1510 1535 else 1511 pVM->hm.s.vmx. pfnFlushTaggedTlb = hmR0VmxFlushTaggedTlbNone;1536 pVM->hm.s.vmx.uFlushTaggedTlb = VMX_FLUSH_TAGGED_TLB_NONE; 1512 1537 return VINF_SUCCESS; 1513 1538 } … … 5549 5574 } 5550 5575 5551 /* Clear the VT-x state bits to prevent any stale injection. */5576 /* Clear the VT-x state bits to prevent any stale injection. This can happen when InjectEventVmcs() */ 5552 5577 int rc2 = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, 0); 5553 5578 AssertRC(rc2); … … 6457 6482 pVmxTransient->u8GuestTpr = pVCpu->hm.s.vmx.pbVirtApic[0x80]; 6458 6483 6459 Assert(pVM->hm.s.vmx.pfnFlushTaggedTlb);6460 6484 ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true); /* Used for TLB-shootdowns, set this across the world switch. */ 6461 pVM->hm.s.vmx.pfnFlushTaggedTlb(pVM, pVCpu); /* Flush the TLB of guest entries as necessary. */6485 hmR0VmxFlushTaggedTlb(pVCpu); /* Invalidate the appropriate guest entries from the TLB. */ 6462 6486 6463 6487 /* Setup TSC-offsetting or intercept RDTSC(P)s and update the preemption timer. */ -
trunk/src/VBox/VMM/include/HMInternal.h
r45410 r45501 383 383 R0PTRTYPE(uint8_t *) pbScratch; 384 384 #endif 385 386 #ifndef VBOX_WITH_OLD_VTX_CODE 387 unsigned uFlushTaggedTlb; 388 #else 385 389 /** Ring 0 handlers for VT-x. */ 386 390 DECLR0CALLBACKMEMBER(void, pfnFlushTaggedTlb, (PVM pVM, PVMCPU pVCpu)); 391 #endif 387 392 388 393 #if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) … … 453 458 AVLOU32TREE PatchTree; 454 459 uint32_t cPatches; 455 HMTPRPATCH aPatches[64];460 HMTPRPATCH aPatches[64]; 456 461 457 462 struct
Note:
See TracChangeset
for help on using the changeset viewer.