Changeset 53625 in vbox for trunk/src/VBox
- Timestamp:
- Dec 31, 2014 3:33:55 PM (10 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp
r46919 r53625 68 68 return VINF_SUCCESS; 69 69 70 case VMMDEV_TESTING_MMIO_NOP_R3: 71 switch (cb) 72 { 73 case 8: 74 case 4: 75 case 2: 76 case 1: 77 #ifndef IN_RING3 78 return VINF_IOM_R3_MMIO_READ_WRITE; 79 #else 80 return VINF_SUCCESS; 81 #endif 82 default: 83 AssertFailed(); 84 return VERR_INTERNAL_ERROR_5; 85 } 86 70 87 default: 71 88 break; … … 82 99 switch (GCPhysAddr) 83 100 { 101 case VMMDEV_TESTING_MMIO_NOP_R3: 102 #ifndef IN_RING3 103 switch (cb) 104 { 105 case 8: 106 case 4: 107 case 2: 108 case 1: 109 return VINF_IOM_R3_MMIO_READ; 110 } 111 #endif 112 /* fall thru. */ 84 113 case VMMDEV_TESTING_MMIO_NOP: 85 114 switch (cb) … … 102 131 } 103 132 return VINF_SUCCESS; 104 105 133 106 134 default: … … 189 217 } 190 218 return VINF_SUCCESS; 219 220 case VMMDEV_TESTING_IOPORT_NOP_R3: 221 switch (cb) 222 { 223 case 4: 224 case 2: 225 case 1: 226 #ifndef IN_RING3 227 return VINF_IOM_R3_IOPORT_WRITE; 228 #else 229 return VINF_SUCCESS; 230 #endif 231 default: 232 AssertFailed(); 233 return VERR_INTERNAL_ERROR_2; 234 } 191 235 192 236 /* The timestamp I/O ports are read-only. */ … … 424 468 return VINF_SUCCESS; 425 469 470 case VMMDEV_TESTING_IOPORT_NOP_R3: 471 switch (cb) 472 { 473 case 4: 474 case 2: 475 case 1: 476 #ifndef IN_RING3 477 return VINF_IOM_R3_IOPORT_READ; 478 #else 479 *pu32 = VMMDEV_TESTING_NOP_RET; 480 return VINF_SUCCESS; 481 #endif 482 default: 483 AssertFailed(); 484 return VERR_INTERNAL_ERROR_2; 485 } 486 426 487 /* 427 488 * The timestamp I/O ports are obviously used for getting a good fix -
trunk/src/VBox/ValidationKit/bootsectors/bootsector2-test1-template.mac
r53195 r53625 5 5 6 6 ; 7 ; Copyright (C) 2007-201 4Oracle Corporation7 ; Copyright (C) 2007-2015 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 166 166 %ifndef HaveIoPortPrologue 167 167 %define HaveIoPortPrologue 168 %macro IoPortPrologue 0168 %macro IoPortPrologue 2 169 169 push xBP 170 170 mov xBP, xSP … … 179 179 180 180 ; Do the test. 181 mov dx, VMMDEV_TESTING_IOPORT_NOP182 mov ecx, TEST_INSTRUCTION_COUNT_IO/ 5181 mov dx, %2 182 mov ecx, (%1) / 5 183 183 %endmacro 184 184 %endif … … 189 189 %ifndef HaveIoPortEpilogue 190 190 %define HaveIoPortEpilogue 191 %macro IoPortEpilogue 0191 %macro IoPortEpilogue 1 192 192 ; Calc the elapsed time and report the result. 193 193 mov xAX, xSP … … 195 195 196 196 mov xCX, .s_szTestName 197 mov edx, TEST_INSTRUCTION_COUNT_IO197 mov edx, (%1) 198 198 mov xAX, xSP 199 199 call TMPL_NM_CMN(ReportResult) … … 215 215 ; 216 216 BEGINPROC TMPL_NM(BenchmarkIoPortNop32In) 217 IoPortPrologue 218 .again: 219 in eax, dx 220 in eax, dx 221 in eax, dx 222 in eax, dx 223 in eax, dx 224 dec ecx 225 jnz .again 226 IoPortEpilogue 217 IoPortPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_IOPORT_NOP 218 .again: 219 in eax, dx 220 in eax, dx 221 in eax, dx 222 in eax, dx 223 in eax, dx 224 dec ecx 225 jnz .again 226 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO 227 227 .s_szTestName: 228 228 db TMPL_MODE_STR, ', 32-bit IN', 0 … … 236 236 ; 237 237 BEGINPROC TMPL_NM(BenchmarkIoPortNop32Out) 238 IoPortPrologue 239 .again: 240 out dx, eax 241 out dx, eax 242 out dx, eax 243 out dx, eax 244 out dx, eax 245 dec ecx 246 jnz .again 247 IoPortEpilogue 238 IoPortPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_IOPORT_NOP 239 .again: 240 out dx, eax 241 out dx, eax 242 out dx, eax 243 out dx, eax 244 out dx, eax 245 dec ecx 246 jnz .again 247 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO 248 248 .s_szTestName: 249 249 db TMPL_MODE_STR, ', 32-bit OUT', 0 … … 257 257 ; 258 258 BEGINPROC TMPL_NM(BenchmarkIoPortNop16In) 259 IoPortPrologue 259 IoPortPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_IOPORT_NOP 260 260 .again: 261 261 in ax, dx … … 266 266 dec ecx 267 267 jnz .again 268 IoPortEpilogue 268 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO 269 269 .s_szTestName: 270 270 db TMPL_MODE_STR, ', 16-bit IN', 0 … … 278 278 ; 279 279 BEGINPROC TMPL_NM(BenchmarkIoPortNop16Out) 280 IoPortPrologue 280 IoPortPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_IOPORT_NOP 281 281 .again: 282 282 out dx, ax … … 287 287 dec ecx 288 288 jnz .again 289 IoPortEpilogue 289 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO 290 290 .s_szTestName: 291 291 db TMPL_MODE_STR, ', 16-bit OUT', 0 … … 299 299 ; 300 300 BEGINPROC TMPL_NM(BenchmarkIoPortNop8In) 301 IoPortPrologue 301 IoPortPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_IOPORT_NOP 302 302 .again: 303 303 in al, dx … … 308 308 dec ecx 309 309 jnz .again 310 IoPortEpilogue 310 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO 311 311 .s_szTestName: 312 312 db TMPL_MODE_STR, ', 8-bit IN', 0 … … 320 320 ; 321 321 BEGINPROC TMPL_NM(BenchmarkIoPortNop8Out) 322 IoPortPrologue 322 IoPortPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_IOPORT_NOP 323 323 .again: 324 324 out dx, al … … 329 329 dec ecx 330 330 jnz .again 331 IoPortEpilogue 331 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO 332 332 .s_szTestName: 333 333 db TMPL_MODE_STR, ', 8-bit OUT', 0 334 334 ENDPROC TMPL_NM(BenchmarkIoPortNop8Out) 335 336 337 ;; 338 ; Benchmarks: IN eax, NOP_R3 339 ; 340 ; @uses nothing 341 ; 342 BEGINPROC TMPL_NM(BenchmarkIoPortRing3Nop32In) 343 IoPortPrologue TEST_INSTRUCTION_COUNT_IO / 4, VMMDEV_TESTING_IOPORT_NOP_R3 344 .again: 345 in eax, dx 346 in eax, dx 347 in eax, dx 348 in eax, dx 349 in eax, dx 350 dec ecx 351 jnz .again 352 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO / 4 353 .s_szTestName: 354 db TMPL_MODE_STR, ', 32-bit IN-to-ring-3', 0 355 ENDPROC TMPL_NM(BenchmarkIoPortRing3Nop32In) 356 357 358 ;; 359 ; Benchmarks: OUT NOP_R3, eax 360 ; 361 ; @uses nothing 362 ; 363 BEGINPROC TMPL_NM(BenchmarkIoPortRing3Nop32Out) 364 IoPortPrologue TEST_INSTRUCTION_COUNT_IO / 4, VMMDEV_TESTING_IOPORT_NOP_R3 365 .again: 366 out dx, eax 367 out dx, eax 368 out dx, eax 369 out dx, eax 370 out dx, eax 371 dec ecx 372 jnz .again 373 IoPortEpilogue TEST_INSTRUCTION_COUNT_IO / 4 374 .s_szTestName: 375 db TMPL_MODE_STR, ', 32-bit OUT-to-ring-3', 0 376 ENDPROC TMPL_NM(BenchmarkIoPortRing3Nop32Out) 335 377 336 378 … … 360 402 call TMPL_NM(BenchmarkIoPortNop8Out) 361 403 %endif 404 call TMPL_NM(BenchmarkIoPortRing3Nop32In) 405 call TMPL_NM(BenchmarkIoPortRing3Nop32Out) 362 406 363 407 call TMPL_NM(Bs2ExitMode) … … 377 421 %ifndef HaveMmioPrologue 378 422 %define HaveMmioPrologue 379 %macro MmioPrologue 0423 %macro MmioPrologue 2 380 424 push xBP 381 425 mov xBP, xSP … … 396 440 mov bx, VMMDEV_TESTING_MMIO_RM_SEL 397 441 mov ds, bx 398 mov ebx, VMMDEV_TESTING_MMIO_RM_OFF( VMMDEV_TESTING_MMIO_NOP)442 mov ebx, VMMDEV_TESTING_MMIO_RM_OFF(%2) 399 443 %else 400 444 mov bx, BS2_SEL_MMIO16 401 445 mov ds, bx 402 mov ebx, VMMDEV_TESTING_MMIO_NOP- BS2_SEL_MMIO16_BASE446 mov ebx, %2 - BS2_SEL_MMIO16_BASE 403 447 %endif 404 448 %else 405 mov xBX, VMMDEV_TESTING_MMIO_NOP406 %endif 407 mov ecx, TEST_INSTRUCTION_COUNT_MMIO/ 5449 mov xBX, %2 450 %endif 451 mov ecx, (%1) / 5 408 452 %endmacro 409 453 %endif … … 413 457 %ifndef HaveMmioEpilogue 414 458 %define HaveMmioEpilogue 415 %macro MmioEpilogue 0459 %macro MmioEpilogue 1 416 460 %ifdef TMPL_16BIT 417 461 mov ds, dx ; restore ds … … 423 467 424 468 mov xCX, .s_szTestName 425 mov edx, TEST_INSTRUCTION_COUNT_MMIO469 mov edx, (%1) 426 470 mov xAX, xSP 427 471 call TMPL_NM_CMN(ReportResult) … … 444 488 ; 445 489 BEGINPROC TMPL_NM(BenchmarkMmioNop32Read) 446 MmioPrologue 447 .again: 448 mov eax, [sBX] 449 mov eax, [sBX] 450 mov eax, [sBX] 451 mov eax, [sBX] 452 mov eax, [sBX] 453 dec ecx 454 jnz .again 455 MmioEpilogue 490 MmioPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_MMIO_NOP 491 .again: 492 mov eax, [sBX] 493 mov eax, [sBX] 494 mov eax, [sBX] 495 mov eax, [sBX] 496 mov eax, [sBX] 497 dec ecx 498 jnz .again 499 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO 456 500 .s_szTestName: 457 501 db TMPL_MODE_STR, ', 32-bit read', 0 … … 460 504 461 505 ;; 462 ; Benchmarks: OUT NOP, eax506 ; Benchmarks: MOV [NOP], eax 463 507 ; 464 508 ; @uses nothing 465 509 ; 466 510 BEGINPROC TMPL_NM(BenchmarkMmioNop32Write) 467 MmioPrologue 468 .again: 469 mov [sBX], eax 470 mov [sBX], eax 471 mov [sBX], eax 472 mov [sBX], eax 473 mov [sBX], eax 474 dec ecx 475 jnz .again 476 MmioEpilogue 511 MmioPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_MMIO_NOP 512 .again: 513 mov [sBX], eax 514 mov [sBX], eax 515 mov [sBX], eax 516 mov [sBX], eax 517 mov [sBX], eax 518 dec ecx 519 jnz .again 520 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO 477 521 .s_szTestName: 478 522 db TMPL_MODE_STR, ', 32-bit write', 0 … … 486 530 ; 487 531 BEGINPROC TMPL_NM(BenchmarkMmioNop16Read) 488 MmioPrologue 532 MmioPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_MMIO_NOP 489 533 .again: 490 534 mov ax, [xBX] … … 495 539 dec ecx 496 540 jnz .again 497 MmioEpilogue 541 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO 498 542 .s_szTestName: 499 543 db TMPL_MODE_STR, ', 16-bit read', 0 … … 502 546 503 547 ;; 504 ; Benchmarks: OUT NOP, ax548 ; Benchmarks: MOV [NOP], ax 505 549 ; 506 550 ; @uses nothing 507 551 ; 508 552 BEGINPROC TMPL_NM(BenchmarkMmioNop16Write) 509 MmioPrologue 553 MmioPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_MMIO_NOP 510 554 .again: 511 555 mov [xBX], ax … … 516 560 dec ecx 517 561 jnz .again 518 MmioEpilogue 562 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO 519 563 .s_szTestName: 520 564 db TMPL_MODE_STR, ', 16-bit write', 0 … … 528 572 ; 529 573 BEGINPROC TMPL_NM(BenchmarkMmioNop8Read) 530 MmioPrologue 574 MmioPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_MMIO_NOP 531 575 .again: 532 576 mov al, [xBX] … … 537 581 dec ecx 538 582 jnz .again 539 MmioEpilogue 583 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO 540 584 .s_szTestName: 541 585 db TMPL_MODE_STR, ', 8-bit read', 0 … … 544 588 545 589 ;; 546 ; Benchmarks: OUT NOP, al590 ; Benchmarks: MOV [NOP], al 547 591 ; 548 592 ; @uses nothing 549 593 ; 550 594 BEGINPROC TMPL_NM(BenchmarkMmioNop8Write) 551 MmioPrologue 595 MmioPrologue TEST_INSTRUCTION_COUNT_IO, VMMDEV_TESTING_MMIO_NOP 552 596 .again: 553 597 mov [xBX], al … … 558 602 dec ecx 559 603 jnz .again 560 MmioEpilogue 604 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO 561 605 .s_szTestName: 562 606 db TMPL_MODE_STR, ', 8-bit write', 0 563 607 ENDPROC TMPL_NM(BenchmarkMmioNop8Write) 608 609 610 ;; 611 ; Benchmarks: MOV eax, [NOP_R3] 612 ; 613 ; @uses nothing 614 ; 615 BEGINPROC TMPL_NM(BenchmarkMmioRing3Nop32Read) 616 MmioPrologue TEST_INSTRUCTION_COUNT_IO / 4, VMMDEV_TESTING_MMIO_NOP_R3 617 .again: 618 mov eax, [sBX] 619 mov eax, [sBX] 620 mov eax, [sBX] 621 mov eax, [sBX] 622 mov eax, [sBX] 623 dec ecx 624 jnz .again 625 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO / 4 626 .s_szTestName: 627 db TMPL_MODE_STR, ', 32-bit read-to-ring-3', 0 628 ENDPROC TMPL_NM(BenchmarkMmioRing3Nop32Read) 629 630 631 ;; 632 ; Benchmarks: MOV [NOP_R3], eax 633 ; 634 ; @uses nothing 635 ; 636 BEGINPROC TMPL_NM(BenchmarkMmioRing3Nop32Write) 637 MmioPrologue TEST_INSTRUCTION_COUNT_IO / 4, VMMDEV_TESTING_MMIO_NOP_R3 638 .again: 639 mov [sBX], eax 640 mov [sBX], eax 641 mov [sBX], eax 642 mov [sBX], eax 643 mov [sBX], eax 644 dec ecx 645 jnz .again 646 MmioEpilogue TEST_INSTRUCTION_COUNT_MMIO / 4 647 .s_szTestName: 648 db TMPL_MODE_STR, ', 32-bit write-to-ring-3', 0 649 ENDPROC TMPL_NM(BenchmarkMmioRing3Nop32Write) 564 650 565 651 … … 589 675 call TMPL_NM(BenchmarkMmioNop8Write) 590 676 %endif 677 call TMPL_NM(BenchmarkMmioRing3Nop32Read) 678 call TMPL_NM(BenchmarkMmioRing3Nop32Write) 591 679 592 680 call TMPL_NM(Bs2ExitMode)
Note:
See TracChangeset
for help on using the changeset viewer.