Changeset 92390 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Nov 12, 2021 9:24:33 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r92368 r92390 5843 5843 AssertMsgReturn(iClear <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), ("%d", iClear), VERR_PGM_HANDY_PAGE_IPE); 5844 5844 Log(("PGMR3PhysAllocateHandyPages: %d -> %d\n", iClear, RT_ELEMENTS(pVM->pgm.s.aHandyPages))); 5845 int rcAlloc = VINF_SUCCESS;5846 int rcSeed = VINF_SUCCESS;5847 5845 int rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_HANDY_PAGES, 0, NULL); 5848 5846 /** @todo we should split this up into an allocate and flush operation. sometimes you want to flush and not allocate more (which will trigger the vm account limit error) */ … … 5858 5856 AssertMsg(rc == VINF_SUCCESS, ("%Rrc\n", rc)); 5859 5857 Assert(pVM->pgm.s.cHandyPages > 0); 5860 VM_FF_CLEAR(pVM, VM_FF_PGM_NEED_HANDY_PAGES);5861 VM_FF_CLEAR(pVM, VM_FF_PGM_NO_MEMORY);5862 5863 5858 #ifdef VBOX_STRICT 5864 5859 uint32_t i; … … 5881 5876 } 5882 5877 #endif 5883 /*5884 * Clear the pages.5885 */5886 while (iClear < pVM->pgm.s.cHandyPages)5887 {5888 PGMMPAGEDESC pPage = &pVM->pgm.s.aHandyPages[iClear];5889 if (!pPage->fZeroed)5890 {5891 void *pv;5892 rc = pgmPhysPageMapByPageID(pVM, pPage->idPage, pPage->HCPhysGCPhys, &pv);5893 AssertLogRelMsgBreak(RT_SUCCESS(rc),5894 ("%u/%u: idPage=%#x HCPhysGCPhys=%RHp rc=%Rrc\n",5895 iClear, pVM->pgm.s.cHandyPages, pPage->idPage, pPage->HCPhysGCPhys, rc));5896 ASMMemZeroPage(pv);5897 pPage->fZeroed = true;5898 }5899 #ifdef VBOX_STRICT5900 else5901 {5902 void *pv;5903 rc = pgmPhysPageMapByPageID(pVM, pPage->idPage, pPage->HCPhysGCPhys, &pv);5904 AssertLogRelMsgBreak(RT_SUCCESS(rc),5905 ("%u/%u: idPage=%#x HCPhysGCPhys=%RHp rc=%Rrc\n",5906 iClear, pVM->pgm.s.cHandyPages, pPage->idPage, pPage->HCPhysGCPhys, rc));5907 Assert(ASMMemIsZeroPage(pv));5908 }5909 #endif5910 iClear++;5911 Log3(("PGMR3PhysAllocateHandyPages: idPage=%#x HCPhys=%RGp\n", pPage->idPage, pPage->HCPhysGCPhys));5912 }5913 5878 } 5914 5879 else 5915 5880 { 5916 uint64_t cAllocPages, cMaxPages, cBalloonPages;5917 5918 5881 /* 5919 5882 * We should never get here unless there is a genuine shortage of … … 5923 5886 */ 5924 5887 /* Report the failure. */ 5925 LogRel(("PGM: Failed to procure handy pages; rc=%Rrc rcAlloc=%Rrc rcSeed=%RrccHandyPages=%#x\n"5888 LogRel(("PGM: Failed to procure handy pages; rc=%Rrc cHandyPages=%#x\n" 5926 5889 " cAllPages=%#x cPrivatePages=%#x cSharedPages=%#x cZeroPages=%#x\n", 5927 rc, rcAlloc, rcSeed, 5928 pVM->pgm.s.cHandyPages, 5929 pVM->pgm.s.cAllPages, 5930 pVM->pgm.s.cPrivatePages, 5931 pVM->pgm.s.cSharedPages, 5932 pVM->pgm.s.cZeroPages)); 5933 5934 if (GMMR3QueryMemoryStats(pVM, &cAllocPages, &cMaxPages, &cBalloonPages) == VINF_SUCCESS) 5935 { 5936 LogRel(("GMM: Statistics:\n" 5937 " Allocated pages: %RX64\n" 5938 " Maximum pages: %RX64\n" 5939 " Ballooned pages: %RX64\n", cAllocPages, cMaxPages, cBalloonPages)); 5940 } 5890 rc, pVM->pgm.s.cHandyPages, 5891 pVM->pgm.s.cAllPages, pVM->pgm.s.cPrivatePages, pVM->pgm.s.cSharedPages, pVM->pgm.s.cZeroPages)); 5941 5892 5942 5893 if ( rc != VERR_NO_MEMORY 5943 5894 && rc != VERR_NO_PHYS_MEMORY 5944 5895 && rc != VERR_LOCK_FAILED) 5945 {5946 5896 for (uint32_t i = 0; i < RT_ELEMENTS(pVM->pgm.s.aHandyPages); i++) 5947 5897 { … … 5964 5914 } 5965 5915 } 5966 }5967 5916 5968 5917 if (rc == VERR_NO_MEMORY)
Note:
See TracChangeset
for help on using the changeset viewer.