- Timestamp:
- Oct 22, 2011 12:37:15 AM (13 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r39078 r39084 679 679 DECLINLINE(void) gmmR0FreeSharedPage(PGMM pGMM, PGVM pGVM, uint32_t idPage, PGMMPAGE pPage); 680 680 static int gmmR0UnmapChunkLocked(PGMM pGMM, PGVM pGVM, PGMMCHUNK pChunk); 681 #ifdef VBOX_WITH_PAGE_SHARING 681 682 static void gmmR0SharedModuleCleanup(PGMM pGMM, PGVM pGVM); 683 #endif 682 684 683 685 … … 4163 4165 * @param pRegions Shared region(s) 4164 4166 */ 4165 GMMR0DECL(int) GMMR0RegisterSharedModule(PVM pVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule, 4167 GMMR0DECL(int) GMMR0RegisterSharedModule(PVM pVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName, 4168 char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule, 4166 4169 unsigned cRegions, VMMDEVSHAREDREGIONDESC *pRegions) 4167 4170 { … … 4325 4328 return rc; 4326 4329 #else 4330 4331 NOREF(pVM); NOREF(idCpu); NOREF(enmGuestOS); NOREF(pszModuleName); NOREF(pszVersion); 4332 NOREF(GCBaseAddr); NOREF(cbModule); NOREF(cRegions); NOREF(pRegions); 4327 4333 return VERR_NOT_IMPLEMENTED; 4328 4334 #endif … … 4364 4370 * @param cbModule Module size 4365 4371 */ 4366 GMMR0DECL(int) GMMR0UnregisterSharedModule(PVM pVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule) 4372 GMMR0DECL(int) GMMR0UnregisterSharedModule(PVM pVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion, 4373 RTGCPTR GCBaseAddr, uint32_t cbModule) 4367 4374 { 4368 4375 #ifdef VBOX_WITH_PAGE_SHARING … … 4441 4448 return rc; 4442 4449 #else 4450 4451 NOREF(pVM); NOREF(idCpu); NOREF(pszModuleName); NOREF(pszVersion); NOREF(GCBaseAddr); NOREF(cbModule); 4443 4452 return VERR_NOT_IMPLEMENTED; 4444 4453 #endif … … 4787 4796 return rc; 4788 4797 #else 4798 NOREF(pVM); NOREF(idCpu); 4789 4799 return VERR_NOT_IMPLEMENTED; 4790 4800 #endif … … 4920 4930 return rc; 4921 4931 #else 4932 NOREF(pVM); NOREF(pVCpu); 4922 4933 return VERR_NOT_IMPLEMENTED; 4923 4934 #endif -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r39078 r39084 672 672 # ifdef VBOX_STRICT 673 673 { "pgmassertcr3", 0, 0, NULL, 0, 0, pgmR3CmdAssertCR3, "", "Check the shadow CR3 mapping." }, 674 # if HC_ARCH_BITS == 64674 # ifdef VBOX_WITH_PAGE_SHARING 675 675 { "pgmcheckduppages", 0, 0, NULL, 0, 0, pgmR3CmdCheckDuplicatePages, "", "Check for duplicate pages in all running VMs." }, 676 676 { "pgmsharedmodules", 0, 0, NULL, 0, 0, pgmR3CmdShowSharedModules, "", "Print shared modules info." }, -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r39078 r39084 923 923 924 924 #if HC_ARCH_BITS == 64 && (defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) || defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) 925 925 926 /** 926 927 * Rendezvous callback used by PGMR3ChangeMemBalloon that changes the memory balloon size … … 1042 1043 } 1043 1044 1045 1044 1046 /** 1045 1047 * Frees a range of ram pages, replacing them with ZERO pages; helper for PGMR3PhysFreeRamPages … … 1064 1066 RTMemFree(paPhysPage); 1065 1067 } 1066 #endif 1068 1069 #endif /* 64-bit host && (Windows || Solaris || Linux || FreeBSD) */ 1067 1070 1068 1071 /** … … 1109 1112 } 1110 1113 return rc; 1114 1111 1115 #else 1116 NOREF(pVM); NOREF(fInflate); NOREF(cPages); NOREF(paPhysPage); 1112 1117 return VERR_NOT_IMPLEMENTED; 1113 1118 #endif 1114 1119 } 1120 1115 1121 1116 1122 /** -
trunk/src/VBox/VMM/VMMR3/PGMSharedPage.cpp
r39078 r39084 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 36 36 #include "PGMInline.h" 37 37 38 38 39 /******************************************************************************* 39 40 * Global Variables * 40 41 *******************************************************************************/ 41 #if defined(VBOX_ STRICT) && HC_ARCH_BITS == 6442 #if defined(VBOX_WITH_PAGE_SHARING) && defined(VBOX_STRICT) 42 43 /** Keep a copy of all registered shared modules for the .pgmcheckduppages debugger command. */ 43 static PGMMREGISTERSHAREDMODULEREQ g_apSharedModules[512] = {0};44 static unsigned g_cSharedModules = 0;44 static PGMMREGISTERSHAREDMODULEREQ g_apSharedModules[512] = {0}; 45 static unsigned g_cSharedModules = 0; 45 46 #endif 47 46 48 47 49 /** … … 58 60 * @param pRegions Shared region(s) 59 61 */ 60 VMMR3DECL(int) PGMR3SharedModuleRegister(PVM pVM, VBOXOSFAMILY enmGuestOS, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule, 61 unsigned cRegions, VMMDEVSHAREDREGIONDESC *pRegions) 62 VMMR3DECL(int) PGMR3SharedModuleRegister(PVM pVM, VBOXOSFAMILY enmGuestOS, char *pszModuleName, char *pszVersion, 63 RTGCPTR GCBaseAddr, uint32_t cbModule, unsigned cRegions, 64 VMMDEVSHAREDREGIONDESC *pRegions) 62 65 { 63 66 #ifdef VBOX_WITH_PAGE_SHARING 64 PGMMREGISTERSHAREDMODULEREQ pReq;65 66 67 Log(("PGMR3SharedModuleRegister family=%d name=%s version=%s base=%RGv size=%x cRegions=%d\n", enmGuestOS, pszModuleName, pszVersion, GCBaseAddr, cbModule, cRegions)); 67 68 … … 69 70 AssertReturn(cRegions < VMMDEVSHAREDREGIONDESC_MAX, VERR_INVALID_PARAMETER); 70 71 72 PGMMREGISTERSHAREDMODULEREQ pReq; 71 73 pReq = (PGMMREGISTERSHAREDMODULEREQ)RTMemAllocZ(RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions])); 72 74 AssertReturn(pReq, VERR_NO_MEMORY); … … 87 89 88 90 int rc = GMMR3RegisterSharedModule(pVM, pReq); 89 # if defined(VBOX_STRICT) && HC_ARCH_BITS == 6491 # ifdef VBOX_STRICT 90 92 if (rc == VINF_SUCCESS) 91 93 { … … 106 108 if (ppSharedModule) 107 109 { 108 *ppSharedModule = (PGMMREGISTERSHAREDMODULEREQ)RTMemAllocZ(RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));109 memcpy(*ppSharedModule, pReq, RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));110 size_t const cbSharedModule = RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]); 111 *ppSharedModule = (PGMMREGISTERSHAREDMODULEREQ)RTMemDup(pReq, cbSharedModule); 110 112 g_cSharedModules++; 111 113 } 112 114 } 113 115 } 114 # endif 116 # endif /* VBOX_STRICT */ 115 117 116 118 RTMemFree(pReq); … … 120 122 121 123 return VINF_SUCCESS; 122 #else 124 #else /* !VBOX_WITH_PAGE_SHARING */ 125 126 NOREF(pVM); NOREF(enmGuestOS); NOREF(pszModuleName); NOREF(pszVersion); NOREF(GCBaseAddr); 127 NOREF(cbModule); NOREF(cRegions); NOREF(pRegions); 123 128 return VERR_NOT_IMPLEMENTED; 124 #endif 125 } 129 #endif /* !VBOX_WITH_PAGE_SHARING */ 130 } 131 126 132 127 133 /** … … 148 154 pReq->cbModule = cbModule; 149 155 150 if ( 151 || 156 if ( RTStrCopy(pReq->szName, sizeof(pReq->szName), pszModuleName) != VINF_SUCCESS 157 || RTStrCopy(pReq->szVersion, sizeof(pReq->szVersion), pszVersion) != VINF_SUCCESS) 152 158 { 153 159 RTMemFree(pReq); … … 157 163 RTMemFree(pReq); 158 164 159 # if defined(VBOX_STRICT) && HC_ARCH_BITS == 64165 # ifdef VBOX_STRICT 160 166 for (unsigned i = 0; i < g_cSharedModules; i++) 161 167 { … … 170 176 } 171 177 } 172 # endif 178 # endif /* VBOX_STRICT */ 173 179 return rc; 174 #else 180 #else /* !VBOX_WITH_PAGE_SHARING */ 181 182 NOREF(pVM); NOREF(pszModuleName); NOREF(pszVersion); NOREF(GCBaseAddr); NOREF(cbModule); 175 183 return VERR_NOT_IMPLEMENTED; 176 #endif 184 #endif /* !VBOX_WITH_PAGE_SHARING */ 177 185 } 178 186 179 187 #ifdef VBOX_WITH_PAGE_SHARING 188 180 189 /** 181 190 * Rendezvous callback that will be called once. … … 221 230 AssertRCSuccess(rc); 222 231 } 223 #endif 232 233 #endif /* !VBOX_WITH_PAGE_SHARING */ 224 234 225 235 /** … … 235 245 return VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)pgmR3CheckSharedModulesHelper, 2, pVM, VMMGetCpuId(pVM)); 236 246 #else 247 NOREF(pVM); 237 248 return VERR_NOT_IMPLEMENTED; 238 249 #endif 239 250 } 240 251 252 241 253 /** 242 254 * Query the state of a page in a shared module 243 255 * 244 256 * @returns VBox status code. 245 * @param pVM VM handle 246 * @param GCPtrPage Page address 247 * @param pfShared Shared status (out) 248 * @param p uPageFlags Page flags (out)249 */ 250 VMMR3DECL(int) PGMR3SharedModuleGetPageState(PVM pVM, RTGCPTR GCPtrPage, bool *pfShared, uint64_t *p uPageFlags)257 * @param pVM VM handle. 258 * @param GCPtrPage Page address. 259 * @param pfShared Shared status (out). 260 * @param pfPageFlags Page flags (out). 261 */ 262 VMMR3DECL(int) PGMR3SharedModuleGetPageState(PVM pVM, RTGCPTR GCPtrPage, bool *pfShared, uint64_t *pfPageFlags) 251 263 { 252 264 #if defined(VBOX_WITH_PAGE_SHARING) && defined(DEBUG) … … 266 278 { 267 279 *pfShared = PGM_PAGE_IS_SHARED(pPage); 268 *p uPageFlags = fFlags;280 *pfPageFlags = fFlags; 269 281 } 270 282 else … … 277 289 case VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT: 278 290 *pfShared = false; 279 *p uPageFlags = 0;291 *pfPageFlags = 0; 280 292 rc = VINF_SUCCESS; 281 293 break; … … 288 300 return rc; 289 301 #else 302 NOREF(pVM); NOREF(GCPtrPage); NOREF(pfShared); NOREF(pfPageFlags); 290 303 return VERR_NOT_IMPLEMENTED; 291 304 #endif 292 305 } 293 306 294 #if defined(VBOX_ STRICT) && HC_ARCH_BITS == 64307 #if defined(VBOX_WITH_PAGE_SHARING) && defined(VBOX_STRICT) 295 308 296 309 /** … … 415 428 } 416 429 417 #endif /* VBOX_STRICT && HC_ARCH_BITS == 64*/430 #endif /* VBOX_STRICT && VBOX_WITH_PAGE_SHARING */ -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r38636 r39084 54 54 static void SigInterrupt(int iSignal) 55 55 { 56 NOREF(iSignal); 56 57 signal(SIGINT, SigInterrupt); 57 58 g_fSignaled = true; … … 63 64 static int scriptGPReg(PVM pVM, char *pszVar, char *pszValue, void *pvUser) 64 65 { 66 NOREF(pszVar); 65 67 uint32_t u32; 66 68 int rc = RTStrToUInt32Ex(pszValue, NULL, 16, &u32); … … 74 76 static int scriptSelReg(PVM pVM, char *pszVar, char *pszValue, void *pvUser) 75 77 { 78 NOREF(pszVar); 76 79 uint16_t u16; 77 80 int rc = RTStrToUInt16Ex(pszValue, NULL, 16, &u16); … … 85 88 static int scriptSysReg(PVM pVM, char *pszVar, char *pszValue, void *pvUser) 86 89 { 90 NOREF(pszVar); 87 91 uint32_t u32; 88 92 int rc = RTStrToUInt32Ex(pszValue, NULL, 16, &u32); … … 97 101 static int scriptDtrReg(PVM pVM, char *pszVar, char *pszValue, void *pvUser) 98 102 { 103 NOREF(pszVar); 99 104 char *pszPart2 = strchr(pszValue, ':'); 100 105 if (!pszPart2) … … 125 130 static int scriptCommand(PVM pVM, const char *pszIn, size_t cch) 126 131 { 132 NOREF(cch); 127 133 int rc = VINF_SUCCESS; 128 134 char *psz = RTStrDup(pszIn); -
trunk/src/VBox/VMM/testcase/tstCompressionBenchmark.cpp
r38636 r39084 64 64 static DECLCALLBACK(int) ComprOutCallback(void *pvUser, const void *pvBuf, size_t cbBuf) 65 65 { 66 NOREF(pvUser); 66 67 AssertReturn(g_cbCompr + cbBuf <= g_cbComprAlloc, VERR_BUFFER_OVERFLOW); 67 68 memcpy(&g_pabCompr[g_cbCompr], pvBuf, cbBuf); … … 75 76 static DECLCALLBACK(int) DecomprInCallback(void *pvUser, void *pvBuf, size_t cbBuf, size_t *pcbBuf) 76 77 { 78 NOREF(pvUser); 77 79 size_t cb = RT_MIN(cbBuf, g_cbCompr - g_offComprIn); 78 80 if (pcbBuf) -
trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp
r38636 r39084 62 62 { 63 63 LogFlow((TESTCASE ": %s: pVM=%p pvUser=%p pvUser2=%p\n", __FUNCTION__, pVM, pvUser, pvUser2)); 64 NOREF(rc); 64 65 65 66 uint32_t cTasksStillLeft = ASMAtomicDecU32(&g_cTasksLeft); -
trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp
r38636 r39084 392 392 PPDMACTESTFILE pTestFile = (PPDMACTESTFILE)pvUser2; 393 393 PPDMACTESTFILETASK pTestTask = (PPDMACTESTFILETASK)pvUser; 394 NOREF(pVM); NOREF(rcReq); 394 395 395 396 if (pTestTask->fWrite) -
trunk/src/VBox/VMM/testcase/tstVMM-HwAccm.cpp
r38636 r39084 39 39 40 40 41 DECLCALLBACK(int) CFGMConstructor(PVM pVM, void *pvUser)41 static DECLCALLBACK(int) CFGMConstructor(PVM pVM, void *pvUser) 42 42 { 43 NOREF(pvUser); 44 43 45 /* 44 46 * Get root node first. -
trunk/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp
r38636 r39084 56 56 int foo(int i, int iZero, int iMinusOne) 57 57 { 58 NOREF(iZero); 59 58 60 /* allocate a buffer which we fill up to the end. */ 59 61 size_t cb = (i % 1555) + 32; -
trunk/src/VBox/VMM/testcase/tstVMREQ.cpp
r38636 r39084 51 51 static DECLCALLBACK(void) MyAtRuntimeError(PVM pVM, void *pvUser, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va) 52 52 { 53 NOREF(pVM); 53 54 if (strcmp((const char *)pvUser, "user argument")) 54 55 { … … 87 88 static DECLCALLBACK(int) PassVACallback(PVM pVM, unsigned u4K, unsigned u1G, const char *pszFormat, va_list *pva) 88 89 { 90 NOREF(pVM); 89 91 if (u4K != _4K) 90 92 { … … 163 165 * Thread function which allocates and frees requests like wildfire. 164 166 */ 165 static DECLCALLBACK(int) Thread(RTTHREAD Thread, void *pvUser)167 static DECLCALLBACK(int) Thread(RTTHREAD hThreadSelf, void *pvUser) 166 168 { 167 169 int rc = VINF_SUCCESS; 168 170 PVM pVM = (PVM)pvUser; 171 NOREF(hThreadSelf); 172 169 173 for (unsigned i = 0; i < 100000; i++) 170 174 { -
trunk/src/VBox/VMM/testcase/tstX86-1.cpp
r36865 r39084 89 89 { 90 90 ucontext_t *pCtx = (ucontext_t *)pvSigCtx; 91 NOREF(pSigInfo); 91 92 92 93 # if defined(RT_ARCH_AMD64) && defined(RT_OS_DARWIN)
Note:
See TracChangeset
for help on using the changeset viewer.