Commit 2b803de
authored
fix(whp): respect IO port access size in IoPortAccess exit handler (#1387)
The WHP IoPortAccess exit handler was returning the full 8 bytes of
RAX regardless of the guest's operand width. For outb (1-byte writes
like serial port console output), this produced 8 bytes per character,
resulting in garbled multi-byte sequences in the host's eprint! output.
Extract AccessSize from IoPortAccess.AccessInfo (bits 1..3) and
truncate the returned data vec to the actual operand width (1 for
outb, 2 for outw, 4 for outl).
Signed-off-by: danbugs <danilochiarlone@gmail.com>1 parent e41799c commit 2b803de
1 file changed
+13
-5
lines changedLines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
| 314 | + | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| |||
357 | 360 | | |
358 | 361 | | |
359 | 362 | | |
360 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
361 | 369 | | |
362 | 370 | | |
363 | 371 | | |
| |||
0 commit comments