Changeset 62354 in vbox
- Timestamp:
- Jul 20, 2016 12:19:28 PM (8 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
-
VMMR3/GIM.cpp (modified) (1 diff)
-
VMMR3/GIMHv.cpp (modified) (2 diffs)
-
include/GIMHvInternal.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIM.cpp
r61771 r62354 93 93 AssertCompile(sizeof(pVM->gim.s) <= sizeof(pVM->gim.padding)); 94 94 AssertCompile(sizeof(pVM->aCpus[0].gim.s) <= sizeof(pVM->aCpus[0].gim.padding)); 95 96 95 97 96 /* -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r61776 r62354 869 869 870 870 /** 871 * Enables the Hyper-V APIC-assist page. 872 * 873 * @returns VBox status code. 874 * @param pVM The cross context VM structure. 875 * @param GCPhysTscPage Where to map the APIC-assist page. 876 */ 877 VMMR3_INT_DECL(int) gimR3HvEnableApicAssistPage(PVM pVM, RTGCPHYS GCPhysApicAssistPage) 878 { 879 PPDMDEVINSR3 pDevIns = pVM->gim.s.pDevInsR3; 880 AssertPtrReturn(pDevIns, VERR_GIM_DEVICE_NOT_REGISTERED); 881 882 /* 883 * Map the APIC-assist-page at the specified address. 884 */ 885 /** @todo this is buggy when large pages are used due to a PGM limitation, see 886 * @bugref{7532}. Instead of the overlay style mapping, we just 887 * rewrite guest memory directly. */ 888 size_t const cbApicAssistPage = PAGE_SIZE; 889 void *pvApicAssist = RTMemAllocZ(cbApicAssistPage); 890 if (RT_LIKELY(pvApicAssist)) 891 { 892 int rc = PGMPhysSimpleWriteGCPhys(pVM, GCPhysApicAssistPage, pvApicAssist, cbApicAssistPage); 893 if (RT_SUCCESS(rc)) 894 { 895 /** @todo Inform APIC. */ 896 LogRel(("GIM: HyperV: Enabled APIC-assist page at %#RGp\n", GCPhysApicAssistPage)); 897 } 898 else 899 { 900 LogRelFunc(("GIM: HyperV: PGMPhysSimpleWriteGCPhys failed. rc=%Rrc\n", rc)); 901 rc = VERR_GIM_OPERATION_FAILED; 902 } 903 904 RTMemFree(pvApicAssist); 905 return rc; 906 } 907 908 LogRelFunc(("GIM: HyperV: Failed to alloc %u bytes\n", cbApicAssistPage)); 909 return VERR_NO_MEMORY; 910 } 911 912 913 /** 914 * Disables the Hyper-V APIC-assist page. 915 * 916 * @returns VBox status code. 917 * @param pVM The cross context VM structure. 918 */ 919 VMMR3_INT_DECL(int) gimR3HvDisableApicAssistPage(PVM pVM) 920 { 921 LogRel(("GIM: HyperV: Disabled APIC-assist page\n")); 922 /** @todo inform APIC */ 923 return VINF_SUCCESS; 924 } 925 926 927 /** 871 928 * Enables the Hyper-V TSC page. 872 929 * … … 1002 1059 pRegion->fMapped = false; 1003 1060 #endif 1004 LogRel(("GIM: HyperV: Disabled TSC -page\n"));1061 LogRel(("GIM: HyperV: Disabled TSC page\n")); 1005 1062 1006 1063 TMR3CpuTickParavirtDisable(pVM); -
trunk/src/VBox/VMM/include/GIMHvInternal.h
r61544 r62354 455 455 /** @} */ 456 456 457 /** @name Hyper-V MSR - APIC-assist page (MSR_GIM_HV_APIC_ASSIST_PAGE). 458 * @{ 459 */ 460 /** Guest-physical page frame number of the APIC-assist page. */ 461 #define MSR_GIM_HV_APICASSIST_GUEST_PFN(a) ((a) >> 12) 462 /** The hypercall enable bit. */ 463 #define MSR_GIM_HV_APICASSIST_PAGE_ENABLE_BIT RT_BIT_64(0) 464 /** Whether the hypercall-page is enabled or not. */ 465 #define MSR_GIM_HV_APICASSIST_PAGE_IS_ENABLED(a) RT_BOOL((a) & MSR_GIM_HV_APICASSIST_PAGE_ENABLE_BIT) 466 /** @} */ 467 468 /** 469 * Hyper-V APIC-assist (HV_REFERENCE_TSC_PAGE) structure placed in the TSC 470 * reference page. 471 */ 472 typedef struct GIMHVAPICASSIST 473 { 474 uint32_t fNoEoiRequired : 1; 475 uint32_t u31Reserved0 : 31; 476 } GIMHVAPICASSIST; 477 /** Pointer to Hyper-V reference TSC. */ 478 typedef GIMHVAPICASSIST *PGIMHVAPICASSIST; 479 /** Pointer to a const Hyper-V reference TSC. */ 480 typedef GIMHVAPICASSIST const *PCGIMHVAPICASSIST; 481 AssertCompileSize(GIMHVAPICASSIST, 4); 457 482 458 483 /** … … 1124 1149 VMMR3_INT_DECL(int) gimR3HvGetDebugSetup(PVM pVM, PGIMDEBUGSETUP pDbgSetup); 1125 1150 1151 VMMR3_INT_DECL(int) gimR3HvDisableApicAssistPage(PVM pVM); 1152 VMMR3_INT_DECL(int) gimR3HvEnableApicAssistPage(PVM pVM, RTGCPHYS GCPhysTscPage); 1126 1153 VMMR3_INT_DECL(int) gimR3HvDisableTscPage(PVM pVM); 1127 1154 VMMR3_INT_DECL(int) gimR3HvEnableTscPage(PVM pVM, RTGCPHYS GCPhysTscPage, bool fUseThisTscSeq, uint32_t uTscSeq);
Note:
See TracChangeset
for help on using the changeset viewer.

