Changeset 26947 in vbox for trunk/src/VBox
- Timestamp:
- Mar 2, 2010 2:11:43 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r26718 r26947 841 841 /** Can use a page directory entry to map the continous range. */ 842 842 #define PGM_PAGE_PDE_TYPE_PDE 2 843 /** Can use a page directory entry to map the continous range - temporarily disabled (by page monitoring). */ 844 #define PGM_PAGE_PDE_TYPE_PDE_DISABLED 3 843 845 /** @} */ 844 846 -
trunk/src/VBox/VMM/PGMPhys.cpp
r26616 r26947 839 839 840 840 /** 841 * Frees a range of ram pages, replacing them with ZERO pages 841 * Frees a range of ram pages, replacing them with ZERO pages; helper for PGMR3PhysFreeRamPages 842 842 * 843 843 * @returns VBox status code. … … 846 846 * @param paPhysPage Array of guest physical addresses 847 847 */ 848 VMMR3DECL(int) PGMR3PhysFreeRamPages(PVM pVM, unsigned cPages, RTGCPHYS *paPhysPage)848 static DECLCALLBACK(void) pgmR3PhysFreeRamPagesHelper(PVM pVM, unsigned cPages, RTGCPHYS *paPhysPage) 849 849 { 850 850 uintptr_t paUser[2]; … … 854 854 int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, pgmR3PhysFreeRamPagesRendezvous, (void *)paUser); 855 855 AssertRC(rc); 856 857 /* Made a copy in PGMR3PhysFreeRamPages; free it here. */ 858 RTMemFree(paPhysPage); 859 } 860 861 /** 862 * Frees a range of ram pages, replacing them with ZERO pages 863 * 864 * @returns VBox status code. 865 * @param pVM The VM handle. 866 * @param cPages Number of pages to free 867 * @param paPhysPage Array of guest physical addresses 868 */ 869 VMMR3DECL(int) PGMR3PhysFreeRamPages(PVM pVM, unsigned cPages, RTGCPHYS *paPhysPage) 870 { 871 int rc; 872 873 /* Currently only used by the VMM device in responds to a balloon request. */ 874 if (pVM->cCpus > 1) 875 { 876 unsigned cbPhysPage = cPages * sizeof(paPhysPage[0]); 877 RTGCPHYS *paPhysPageCopy = (RTGCPHYS *)RTMemAlloc(cbPhysPage); 878 AssertReturn(paPhysPageCopy, VERR_NO_MEMORY); 879 880 memcpy(paPhysPageCopy, paPhysPage, cbPhysPage); 881 882 /* We own the IOM lock here and could cause a deadlock by waiting for another VCPU that is blocking on the IOM lock. */ 883 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)pgmR3PhysFreeRamPagesHelper, 3, pVM, cPages, paPhysPageCopy); 884 AssertRC(rc); 885 } 886 else 887 { 888 uintptr_t paUser[2]; 889 890 paUser[0] = cPages; 891 paUser[1] = (uintptr_t)paPhysPage; 892 rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, pgmR3PhysFreeRamPagesRendezvous, (void *)paUser); 893 AssertRC(rc); 894 } 856 895 return rc; 857 896 } 897 858 898 859 899 /**
Note:
See TracChangeset
for help on using the changeset viewer.