ps2: prevent changing irq state on save and load
commita1f2ed2ad8b4ec28a5f1bc4fcb50ef57b69a28a2
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Fri, 11 May 2018 08:16:01 +0000 (11 11:16 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 2 Oct 2018 16:47:55 +0000 (2 18:47 +0200)
treefb89b08018044a4682569d59d5027a90dcc7608b
parentcf9270e5220671f49cc238deaf6136669cc07ae1
ps2: prevent changing irq state on save and load

Commit 2858ab09e6f708e381fc1a1cc87e747a690c4884 changed
PS/2 keyboard/mouse buffers to the standard size. However, its state
may change when migrating from the old buffer size and therefore irq needs
updating. But this change made wrong, because it throws the whole queue
if there are too much data instead of cropping it.

That commit also updates irq (because the queue state may change).
But updating the irq may change the VM state (and determinism of
the execution). E.g., when replaying the execution, one may save
the VM state and the state of the interrupt controller will be updated
at the moment of saving, instead of using the recorded update events.

This patch makes the queue update deterministic: it removes the update_irq
call and crops the queue to prevent losing the characters and changing
the required irq status.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Message-Id: <20180511081601.14610.39946.stgit@pasha-VirtualBox>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/input/ps2.c