Changeset 48236 in vbox for trunk/src/VBox
- Timestamp:
- Sep 2, 2013 7:14:55 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/Makefile.kmk
r48221 r48236 65 65 ifdef VBOX_WITH_64ON32_IDT 66 66 VMM_COMMON_DEFS += VBOX_WITH_64ON32_IDT 67 endif 68 ifdef VBOX_WITH_64ON32_CMOS_DEBUG 69 VMM_COMMON_DEFS += VBOX_WITH_64ON32_CMOS_DEBUG 67 70 endif 68 71 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r48201 r48236 115 115 #endif 116 116 LogFlow(("ModuleInit:\n")); 117 118 #ifdef VBOX_WITH_64ON32_CMOS_DEBUG 119 /* 120 * Display the CMOS debug code. 121 */ 122 ASMOutU8(0x72, 0x03); 123 uint8_t bDebugCode = ASMInU8(0x73); 124 LogRel(("CMOS Debug Code: %#x (%d)\n", bDebugCode, bDebugCode)); 125 RTLogComPrintf("CMOS Debug Code: %#x (%d)\n", bDebugCode, bDebugCode); 126 #endif 117 127 118 128 /* -
trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
r48221 r48236 30 30 %define HM64ON32OP_HMRCSaveGuestDebug64 4 31 31 %define HM64ON32OP_HMRCTestSwitcher64 5 32 33 ;; 34 ; This macro is used for storing a debug code in a CMOS location. 35 ; 36 ; If we tripple fault or something, the debug code can be retrieved and we 37 ; might have a clue as to where the problem occurred. The code is currently 38 ; using CMOS register 3 in the 2nd bank as this _seems_ to be unused on my 39 ; Extreme4 X79 asrock mainboard. 40 ; 41 ; @param %1 The debug code (byte) 42 ; @note Trashes AL. 43 ; 44 %macro DEBUG_CMOS_TRASH_AL 1 45 %ifdef VBOX_WITH_64ON32_CMOS_DEBUG 46 mov al, 3 47 out 72h, al 48 mov al, %1 49 out 73h, al 50 in al, 73h 51 %endif 52 %endmacro 53 54 ;; 55 ; Version of DEBUG_CMOS_TRASH_AL that saves AL on the stack and therefore 56 ; doesn't trash any registers. 57 ; 58 %macro DEBUG_CMOS_STACK64 1 59 %ifdef VBOX_WITH_64ON32_CMOS_DEBUG 60 push rax 61 DEBUG_CMOS_TRASH_AL %1 62 pop rax 63 %endif 64 %endmacro 65 66 ;; 67 ; Version of DEBUG_CMOS_TRASH_AL that saves AL on the stack and therefore 68 ; doesn't trash any registers. 69 ; 70 %macro DEBUG_CMOS_STACK32 1 71 %ifdef VBOX_WITH_64ON32_CMOS_DEBUG 72 push eax 73 DEBUG_CMOS_TRASH_AL %1 74 pop eax 75 %endif 76 %endmacro 77 32 78 33 79 ;; Stubs for making OS/2 compile (though, not work). … … 113 159 pushf 114 160 cli 161 DEBUG_CMOS_STACK32 10h 115 162 116 163 ; … … 151 198 152 199 gth_x2apic: 200 ;DEBUG_CMOS_STACK32 7ch 153 201 push eax ; save eax 154 202 push ebx ; save it for fApicDisVectors … … 191 239 192 240 ; restore original flags 241 ;DEBUG_CMOS_STACK32 7eh 193 242 popf 194 243 pop ebp … … 203 252 %endif 204 253 254 ;DEBUG_CMOS_STACK32 7fh 205 255 ret 206 256 … … 399 449 400 450 ; Load new gdt so we can do a far jump after going into 64 bits mode 451 ;DEBUG_CMOS_STACK32 16h 401 452 lgdt [edx + CPUMCPU.Hyper.gdtr] 402 453 … … 414 465 mov cr3, eax 415 466 DEBUG32_CHAR('?') 467 DEBUG_CMOS_TRASH_AL 17h 416 468 417 469 ;; … … 509 561 ALIGNCODE(16) 510 562 GLOBALNAME ICEnterTarget 563 DEBUG_CMOS_TRASH_AL 1ah 511 564 ; Load CPUM pointer into rdx 512 565 mov rdx, [NAME(pCpumIC) wrt rip] … … 716 769 push rbp 717 770 mov rbp, rsp 771 DEBUG_CMOS_STACK64 20h 718 772 719 773 ; Make sure VT-x instructions are allowed. … … 815 869 mov eax, VMX_VMCS_HOST_FIELD_SS 816 870 vmwrite rax, rdx 871 872 %if 0 ; Another experiment regarding tripple faults... Seems not to be necessary. 873 sub rsp, 16 874 str [rsp] 875 movsx rdx, word [rsp] 876 mov eax, VMX_VMCS_HOST_FIELD_TR 877 vmwrite rax, rdx 878 add rsp, 16 879 %endif 817 880 818 881 sub rsp, 16 … … 1078 1141 mov rbp, rsp 1079 1142 pushf 1143 DEBUG_CMOS_STACK64 30h 1080 1144 1081 1145 ; Manual save and restore: … … 1169 1233 ; */ 1170 1234 BEGINPROC HMRCSaveGuestFPU64 1235 DEBUG_CMOS_STACK64 40h 1171 1236 mov rax, cr0 1172 1237 mov rcx, rax ; save old CR0 … … 1189 1254 ; */ 1190 1255 BEGINPROC HMRCSaveGuestDebug64 1256 DEBUG_CMOS_STACK64 41h 1191 1257 mov rax, dr0 1192 1258 mov qword [rsi + CPUMCTX.dr + 0*8], rax … … 1215 1281 ; */ 1216 1282 BEGINPROC HMRCTestSwitcher64 1283 DEBUG_CMOS_STACK64 42h 1217 1284 mov eax, [rsp+8] 1218 1285 ret … … 1430 1497 %endif 1431 1498 1499 %if 1 1500 ;; For debugging purposes. 1501 BEGINPROC vmm64On32DumpCmos 1502 push rax 1503 push rdx 1504 push rcx 1505 push rsi ; paranoia 1506 push rdi ; ditto 1507 sub rsp, 16 1508 1509 %if 0 1510 mov al, 3 1511 out 72h, al 1512 mov al, 68h 1513 out 73h, al 1514 %endif 1515 1516 COM64_S_NEWLINE 1517 COM64_S_CHAR 'c' 1518 COM64_S_CHAR 'm' 1519 COM64_S_CHAR 'o' 1520 COM64_S_CHAR 's' 1521 COM64_S_CHAR '0' 1522 COM64_S_CHAR ':' 1523 1524 xor ecx, ecx 1525 .loop1: 1526 mov al, cl 1527 out 70h, al 1528 in al, 71h 1529 COM64_S_BYTE_REG eax 1530 COM64_S_CHAR ' ' 1531 inc ecx 1532 cmp ecx, 128 1533 jb .loop1 1534 1535 COM64_S_NEWLINE 1536 COM64_S_CHAR 'c' 1537 COM64_S_CHAR 'm' 1538 COM64_S_CHAR 'o' 1539 COM64_S_CHAR 's' 1540 COM64_S_CHAR '1' 1541 COM64_S_CHAR ':' 1542 xor ecx, ecx 1543 .loop2: 1544 mov al, cl 1545 out 72h, al 1546 in al, 73h 1547 COM64_S_BYTE_REG eax 1548 COM64_S_CHAR ' ' 1549 inc ecx 1550 cmp ecx, 128 1551 jb .loop2 1552 1553 %if 0 1554 COM64_S_NEWLINE 1555 COM64_S_CHAR 'c' 1556 COM64_S_CHAR 'm' 1557 COM64_S_CHAR 'o' 1558 COM64_S_CHAR 's' 1559 COM64_S_CHAR '2' 1560 COM64_S_CHAR ':' 1561 xor ecx, ecx 1562 .loop3: 1563 mov al, cl 1564 out 74h, al 1565 in al, 75h 1566 COM64_S_BYTE_REG eax 1567 COM64_S_CHAR ' ' 1568 inc ecx 1569 cmp ecx, 128 1570 jb .loop3 1571 1572 COM64_S_NEWLINE 1573 COM64_S_CHAR 'c' 1574 COM64_S_CHAR 'm' 1575 COM64_S_CHAR 'o' 1576 COM64_S_CHAR 's' 1577 COM64_S_CHAR '3' 1578 COM64_S_CHAR ':' 1579 xor ecx, ecx 1580 .loop4: 1581 mov al, cl 1582 out 72h, al 1583 in al, 73h 1584 COM64_S_BYTE_REG eax 1585 COM64_S_CHAR ' ' 1586 inc ecx 1587 cmp ecx, 128 1588 jb .loop4 1589 1590 COM64_S_NEWLINE 1591 %endif 1592 1593 add rsp, 16 1594 pop rdi 1595 pop rsi 1596 pop rcx 1597 pop rdx 1598 pop rax 1599 ret 1600 ENDPROC vmm64On32DumpCmos 1601 %endif 1602 1432 1603 %endif ; VBOX_WITH_64ON32_IDT 1433 1604 … … 1568 1739 GLOBALNAME ICExitTarget 1569 1740 DEBUG32_CHAR('9') 1741 ;DEBUG_CMOS_TRASH_AL 70h 1570 1742 1571 1743 ; load the hypervisor data selector into ds & es … … 1646 1818 1647 1819 ; store the return code in eax 1820 DEBUG_CMOS_TRASH_AL 79h 1648 1821 mov eax, [edx + CPUMCPU.u32RetCode] 1649 1822 retf
Note:
See TracChangeset
for help on using the changeset viewer.