(resend)[PATCH 2/2] ps2: Fix mouse stream corruption due to lost data
This fixes an issue by adding bounds checking to multi-byte packets where the PS/2 mouse data stream may become corrupted due to data being discarded when the PS/2 ringbuffer is full.
Interrupts for Multi-byte responses are postponed until the final byte has been queued.
These changes fix a bug where windows guests drop the mouse device entirely requring the guest to be restarted.
Signed-off-by Geoffrey McRae <[email protected]>
--- hw/input/pckbd.c | 6 +-- hw/input/ps2.c | 160 +++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 110 insertions(+), 56 deletions(-)
hw/input/pckbd.c +2 -2
@@ -216,9 +216,9 @@ static uint64_t kbd_read_status(void *opaque, hwaddr addr,static void kbd_queue (KBDState *s,int b,int aux) {if (aux) -ps2_queue (s->mouse, b); +ps2_queue_raise (s->mouse, b);else -ps2_queue (s->kbd, b); +ps2_queue_raise (s->kbd, b); }static void outport_write (KBDState *s,uint32_t val)
hw/input/ps2.c +106 -52
322 lines not on this page · raw message
Signature · 1 line
2.14.2