Changeset 37094 in vbox
- Timestamp:
- May 16, 2011 6:56:22 AM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
-
Devices/Serial/DevSerial.cpp (modified) (1 diff)
-
VMM/VMMR3/PATMA.asm (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DevSerial.cpp
r35772 r37094 278 278 f->count++; 279 279 else if (fifo == XMIT_FIFO) /* need to at least adjust tail to maintain pipe state consistency */ 280 ++f->tail;280 ++f->tail; 281 281 else if (fifo == RECV_FIFO) 282 282 s->lsr |= UART_LSR_OE; -
trunk/src/VBox/VMM/VMMR3/PATMA.asm
r35348 r37094 75 75 DD PATM_ALLPATCHCALLS 76 76 DD 0 77 DD PATM_PERPATCHCALLS77 DD PATM_PERPATCHCALLS 78 78 DD 0 79 79 DD PATM_INTERRUPTFLAG … … 124 124 DD 0 125 125 DD PATMClearPIF_End - PATMClearPIF_Start 126 DD1126 DD 1 127 127 DD PATM_INTERRUPTFLAG 128 128 DD 0 … … 138 138 pushf 139 139 140 testdword [ss:PATM_VMFLAGS], X86_EFL_IF141 jzPATMClearInhibitIRQFaultIF0_Fault140 test dword [ss:PATM_VMFLAGS], X86_EFL_IF 141 jz PATMClearInhibitIRQFaultIF0_Fault 142 142 143 143 ; if interrupts are pending, then we must go back to the host context to handle them! … … 177 177 DD 0 178 178 DD PATMClearInhibitIRQFaultIF0_End - PATMClearInhibitIRQFaultIF0_Start 179 DD12179 DD 12 180 180 DD PATM_INTERRUPTFLAG 181 181 DD 0 … … 213 213 pushf 214 214 215 testdword [ss:PATM_VMFLAGS], X86_EFL_IF216 jzPATMClearInhibitIRQContIF0_Continue215 test dword [ss:PATM_VMFLAGS], X86_EFL_IF 216 jz PATMClearInhibitIRQContIF0_Continue 217 217 218 218 ; if interrupts are pending, then we must go back to the host context to handle them! … … 247 247 DD 0 248 248 DD PATMClearInhibitIRQContIF0_End - PATMClearInhibitIRQContIF0_Start 249 DD11249 DD 11 250 250 DD PATM_INTERRUPTFLAG 251 251 DD 0 … … 416 416 PATMTrapNoRing1: 417 417 418 ; correct EFLAGS on the stack to include the current IOPL419 pusheax420 mov eax, dword [ss:PATM_VMFLAGS]421 and eax, X86_EFL_IOPL422 and dword [esp+16], ~X86_EFL_IOPL; esp+16 = eflags = esp+8+4(efl)+4(eax)423 or dword [esp+16], eax424 pop eax418 ; correct EFLAGS on the stack to include the current IOPL 419 push eax 420 mov eax, dword [ss:PATM_VMFLAGS] 421 and eax, X86_EFL_IOPL 422 and dword [esp+16], ~X86_EFL_IOPL ; esp+16 = eflags = esp+8+4(efl)+4(eax) 423 or dword [esp+16], eax 424 pop eax 425 425 426 426 popf … … 501 501 PATMTrapErrorCodeNoRing1: 502 502 503 ; correct EFLAGS on the stack to include the current IOPL504 pusheax505 mov eax, dword [ss:PATM_VMFLAGS]506 and eax, X86_EFL_IOPL507 and dword [esp+20], ~X86_EFL_IOPL; esp+20 = eflags = esp+8+4(efl)+4(error code)+4(eax)508 or dword [esp+20], eax509 pop eax503 ; correct EFLAGS on the stack to include the current IOPL 504 push eax 505 mov eax, dword [ss:PATM_VMFLAGS] 506 and eax, X86_EFL_IOPL 507 and dword [esp+20], ~X86_EFL_IOPL ; esp+20 = eflags = esp+8+4(efl)+4(error code)+4(eax) 508 or dword [esp+20], eax 509 pop eax 510 510 511 511 popf … … 586 586 PATMIntNoRing1: 587 587 588 ; correct EFLAGS on the stack to include the current IOPL589 pusheax590 mov eax, dword [ss:PATM_VMFLAGS]591 and eax, X86_EFL_IOPL592 and dword [esp+16], ~X86_EFL_IOPL; esp+16 = eflags = esp+8+4(efl)+4(eax)593 or dword [esp+16], eax594 pop eax588 ; correct EFLAGS on the stack to include the current IOPL 589 push eax 590 mov eax, dword [ss:PATM_VMFLAGS] 591 and eax, X86_EFL_IOPL 592 and dword [esp+16], ~X86_EFL_IOPL ; esp+16 = eflags = esp+8+4(efl)+4(eax) 593 or dword [esp+16], eax 594 pop eax 595 595 596 596 popf … … 668 668 PATMIntNoRing1_ErrorCode: 669 669 670 ; correct EFLAGS on the stack to include the current IOPL671 pusheax672 mov eax, dword [ss:PATM_VMFLAGS]673 and eax, X86_EFL_IOPL674 and dword [esp+20], ~X86_EFL_IOPL; esp+20 = eflags = esp+8+4(efl)+4(eax)+4(error code)675 or dword [esp+20], eax676 pop eax670 ; correct EFLAGS on the stack to include the current IOPL 671 push eax 672 mov eax, dword [ss:PATM_VMFLAGS] 673 and eax, X86_EFL_IOPL 674 and dword [esp+20], ~X86_EFL_IOPL ; esp+20 = eflags = esp+8+4(efl)+4(eax)+4(error code) 675 or dword [esp+20], eax 676 pop eax 677 677 678 678 popf … … 1252 1252 1253 1253 iret_continue : 1254 ; This section must *always* be executed (!!)1255 ; Extract the IOPL from the return flags, save them to our virtual flags and1256 ; put them back to zero1254 ; This section must *always* be executed (!!) 1255 ; Extract the IOPL from the return flags, save them to our virtual flags and 1256 ; put them back to zero 1257 1257 ; @note we assume iretd doesn't fault!!! 1258 pusheax1259 mov eax, dword [esp+16]1260 and eax, X86_EFL_IOPL1261 and dword [ss:PATM_VMFLAGS], ~X86_EFL_IOPL1262 or dword [ss:PATM_VMFLAGS], eax1263 pop eax1264 anddword [esp+12], ~X86_EFL_IOPL1258 push eax 1259 mov eax, dword [esp+16] 1260 and eax, X86_EFL_IOPL 1261 and dword [ss:PATM_VMFLAGS], ~X86_EFL_IOPL 1262 or dword [ss:PATM_VMFLAGS], eax 1263 pop eax 1264 and dword [esp+12], ~X86_EFL_IOPL 1265 1265 1266 1266 ; Set IF again; below we make sure this won't cause problems. … … 1306 1306 or dword [esp+8], 1 1307 1307 1308 ; This section must *always* be executed (!!)1309 ; Extract the IOPL from the return flags, save them to our virtual flags and1310 ; put them back to zero1311 pusheax1312 mov eax, dword [esp+16]1313 and eax, X86_EFL_IOPL1314 and dword [ss:PATM_VMFLAGS], ~X86_EFL_IOPL1315 or dword [ss:PATM_VMFLAGS], eax1316 pop eax1317 anddword [esp+12], ~X86_EFL_IOPL1308 ; This section must *always* be executed (!!) 1309 ; Extract the IOPL from the return flags, save them to our virtual flags and 1310 ; put them back to zero 1311 push eax 1312 mov eax, dword [esp+16] 1313 and eax, X86_EFL_IOPL 1314 and dword [ss:PATM_VMFLAGS], ~X86_EFL_IOPL 1315 or dword [ss:PATM_VMFLAGS], eax 1316 pop eax 1317 and dword [esp+12], ~X86_EFL_IOPL 1318 1318 1319 1319 ; Clear IF … … 2442 2442 mov dword [ss:PATM_INTERRUPTFLAG], 0 2443 2443 pushf 2444 testdword [ss:PATM_VMFLAGS], X86_EFL_IF2445 jnzPATMCheckIF_Safe2446 nop2447 2448 ; IF=0 -> unsafe, so we must call the duplicated function (which we don't do here)2449 popf2450 mov dword [ss:PATM_INTERRUPTFLAG], 1 2451 jmp PATMCheckIF_End2444 test dword [ss:PATM_VMFLAGS], X86_EFL_IF 2445 jnz PATMCheckIF_Safe 2446 nop 2447 2448 ; IF=0 -> unsafe, so we must call the duplicated function (which we don't do here) 2449 popf 2450 mov dword [ss:PATM_INTERRUPTFLAG], 1 2451 jmp PATMCheckIF_End 2452 2452 2453 2453 PATMCheckIF_Safe: … … 2465 2465 pop eax 2466 2466 %endif 2467 popf2468 mov dword [ss:PATM_INTERRUPTFLAG], 1 2469 ; IF=1 -> we can safely jump back to the original instruction2467 popf 2468 mov dword [ss:PATM_INTERRUPTFLAG], 1 2469 ; IF=1 -> we can safely jump back to the original instruction 2470 2470 DB 0xE9 2471 2471 PATMCheckIF_Jump: … … 2509 2509 mov dword [ss:PATM_INTERRUPTFLAG], 0 2510 2510 pushf 2511 testdword [ss:PATM_VMFLAGS], X86_EFL_IF2512 jnzPATMJumpToGuest_IF1_Safe2513 nop2514 2515 ; IF=0 -> unsafe, so fault2516 popf2517 mov dword [ss:PATM_INTERRUPTFLAG], 1 2518 PATM_INT32511 test dword [ss:PATM_VMFLAGS], X86_EFL_IF 2512 jnz PATMJumpToGuest_IF1_Safe 2513 nop 2514 2515 ; IF=0 -> unsafe, so fault 2516 popf 2517 mov dword [ss:PATM_INTERRUPTFLAG], 1 2518 PATM_INT3 2519 2519 2520 2520 PATMJumpToGuest_IF1_Safe: 2521 ; IF=1 -> we can safely jump back to the original instruction2522 popf2521 ; IF=1 -> we can safely jump back to the original instruction 2522 popf 2523 2523 mov dword [ss:PATM_INTERRUPTFLAG], 1 2524 2524 DB 0xE9
Note:
See TracChangeset
for help on using the changeset viewer.

