Changeset 42585 in vbox
- Timestamp:
- Aug 3, 2012 4:50:05 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 79767
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VMMDevTesting.h
r41416 r42585 79 79 /** Report a failure, sending reason (zero terminated string). (RTTestSkipped) */ 80 80 #define VMMDEV_TESTING_CMD_SKIPPED UINT32_C(0xcab1e006) 81 /** Report a value found in a VMM register, sending a string on the form 82 * "value-name:register-name". */ 83 #define VMMDEV_TESTING_CMD_VALUE_REG UINT32_C(0xcab1e007) 81 84 /** @} */ 82 85 -
trunk/include/VBox/VMMDevTesting.mac
r41416 r42585 21 21 %define VMMDEV_TESTING_CMD_VALUE 0xcab1e005 22 22 %define VMMDEV_TESTING_CMD_SKIPPED 0xcab1e006 23 %define VMMDEV_TESTING_CMD_VALUE_REG 0xcab1e007 23 24 %define VMMDEV_TESTING_UNIT_PCT 0x01 24 25 %define VMMDEV_TESTING_UNIT_BYTES 0x02 -
trunk/include/VBox/err.mac
r42396 r42585 208 208 %define VERR_CPUM_RAISE_GP_0 (-1750) 209 209 %define VERR_CPUM_INCOMPATIBLE_CONFIG (-1751) 210 %define VERR_CPUM_HIDDEN_CS_LOAD_ERROR (-1752) 210 211 %define VERR_SSM_UNIT_EXISTS (-1800) 211 212 %define VERR_SSM_UNIT_NOT_FOUND (-1801) -
trunk/include/iprt/x86.mac
r42396 r42585 626 626 %ifndef VBOX_FOR_DTRACE_LIB 627 627 %endif 628 %define X86_SEL_SHIFT 3 629 %define X86_SEL_MASK 0xfff8 630 %define X86_SEL_LDT 0x0004 631 %define X86_SEL_RPL 0x0003 628 %define X86_SEL_SHIFT 3 629 %define X86_SEL_MASK 0xfff8 630 %define X86_SEL_MASK_OFF_RPL 0xfffc 631 %define X86_SEL_LDT 0x0004 632 %define X86_SEL_RPL 0x0003 633 %define X86_SEL_RPL_LDT 0x0007 632 634 %define X86_TRAP_ERR_EXTERNAL 1 633 635 %define X86_TRAP_ERR_IDT 2 -
trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp
r41416 r42585 2 2 /** @file 3 3 * VMMDev - Testing Extensions. 4 * 5 * To enable: VBoxManage setextradata vmname VBoxInternal/Devices/VMMDev/0/Config/TestingEnabled 1 4 6 */ 5 7 … … 22 24 #define LOG_GROUP LOG_GROUP_DEV_VMM 23 25 #include <VBox/VMMDev.h> 26 #include <VBox/vmm/vmapi.h> 24 27 #include <VBox/log.h> 25 28 #include <VBox/err.h> … … 111 114 } 112 115 116 #ifdef IN_RING3 117 118 /** 119 * Executes the VMMDEV_TESTING_CMD_VALUE_REG command when the data is ready. 120 * 121 * @param pDevIns The PDM device instance. 122 * @param pThis The instance VMMDev data. 123 */ 124 static void vmmdevTestingCmdExec_ValueReg(PPDMDEVINS pDevIns, VMMDevState *pThis) 125 { 126 char *pszRegNm = strchr(pThis->TestingData.String.sz, ':'); 127 if (pszRegNm) 128 { 129 *pszRegNm++ = '\0'; 130 pszRegNm = RTStrStrip(pszRegNm); 131 } 132 char *pszValueNm = RTStrStrip(pThis->TestingData.String.sz); 133 size_t const cchValueNm = strlen(pszValueNm); 134 if (cchValueNm && pszRegNm && *pszRegNm) 135 { 136 PVM pVM = PDMDevHlpGetVM(pDevIns); 137 VMCPUID idCpu = VMMGetCpuId(pVM); 138 uint64_t u64Value; 139 int rc2 = DBGFR3RegNmQueryU64(pVM, idCpu, pszRegNm, &u64Value); 140 if (RT_SUCCESS(rc2)) 141 { 142 const char *pszWarn = rc2 == VINF_DBGF_TRUNCATED_REGISTER ? "truncated" : ""; 143 VMMDEV_TESTING_OUTPUT(("testing: VALUE '%s'%*s: %'9llu (%#llx) [0] {reg=%s}\n", 144 pszValueNm, 145 (ssize_t)cchValueNm - 12 > 48 ? 0 : 48 - ((ssize_t)cchValueNm - 12), "", 146 u64Value, u64Value, pszRegNm, pszWarn)); 147 } 148 else 149 VMMDEV_TESTING_OUTPUT(("testing: error querying register '%s' for value '%s': %Rrc\n", 150 pszRegNm, pszValueNm, rc2)); 151 } 152 else 153 VMMDEV_TESTING_OUTPUT(("testing: malformed register value '%s'/'%s'\n", pszValueNm, pszRegNm)); 154 } 155 156 #endif /* IN_RING3 */ 113 157 114 158 /** … … 121 165 switch (Port) 122 166 { 167 /* 168 * The NOP I/O ports are used for performance measurements. 169 */ 123 170 case VMMDEV_TESTING_IOPORT_NOP: 124 171 switch (cb) … … 134 181 return VINF_SUCCESS; 135 182 183 /* The timestamp I/O ports are read-only. */ 136 184 case VMMDEV_TESTING_IOPORT_TS_LOW: 137 break;138 139 185 case VMMDEV_TESTING_IOPORT_TS_HIGH: 140 186 break; 141 187 188 /* 189 * The command port (DWORD write only). 190 */ 142 191 case VMMDEV_TESTING_IOPORT_CMD: 143 192 if (cb == 4) … … 150 199 break; 151 200 201 /* 202 * The data port. Used of providing data for a command. 203 */ 152 204 case VMMDEV_TESTING_IOPORT_DATA: 153 205 { … … 266 318 break; 267 319 320 321 /* 322 * RTTestValue with the return from DBGFR3RegNmQuery. 323 */ 324 case VMMDEV_TESTING_CMD_VALUE_REG: 325 { 326 if ( off < sizeof(pThis->TestingData.String.sz) - 1 327 && cb == 1) 328 { 329 pThis->TestingData.String.sz[off] = u32; 330 if (u32) 331 pThis->offTestingData = off + 1; 332 else 333 #ifdef IN_RING3 334 vmmdevTestingCmdExec_ValueReg(pDevIns, pThis); 335 #else 336 return VINF_IOM_R3_IOPORT_WRITE; 337 #endif 338 return VINF_SUCCESS; 339 } 340 break; 341 342 } 343 268 344 default: 269 345 break; … … 290 366 switch (Port) 291 367 { 368 /* 369 * The NOP I/O ports are used for performance measurements. 370 */ 292 371 case VMMDEV_TESTING_IOPORT_NOP: 293 372 switch (cb) … … 304 383 return VINF_SUCCESS; 305 384 385 /* 386 * The timestamp I/O ports are obviously used for getting a good fix 387 * on the current time (as seen by the host?). 388 * 389 * The high word is latched when reading the low, so reading low + high 390 * gives you a 64-bit timestamp value. 391 */ 306 392 case VMMDEV_TESTING_IOPORT_TS_LOW: 307 393 if (cb == 4) … … 322 408 break; 323 409 410 /* 411 * The command and data registers are write-only. 412 */ 324 413 case VMMDEV_TESTING_IOPORT_CMD: 325 414 case VMMDEV_TESTING_IOPORT_DATA:
Note:
See TracChangeset
for help on using the changeset viewer.