[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] 644f66: hw/input: expand trace info reported
From: |
Peter Maydell |
Subject: |
[Qemu-commits] [qemu/qemu] 644f66: hw/input: expand trace info reported for ps2 device |
Date: |
Wed, 26 May 2021 13:05:29 -0700 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: 644f66bf5d09f98d1da7a6bcec6bd9ce795f868c
https://github.com/qemu/qemu/commit/644f66bf5d09f98d1da7a6bcec6bd9ce795f868c
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/ps2.c
M hw/input/trace-events
Log Message:
-----------
hw/input: expand trace info reported for ps2 device
It is interesting to know if the PS2 keyboard is in translated mode, and
which of the three scancode sets are in use.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210309155804.306051-1-berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: 76968101f549fb6bb51b4bdea65e8a48307c765d
https://github.com/qemu/qemu/commit/76968101f549fb6bb51b4bdea65e8a48307c765d
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/ps2.c
Log Message:
-----------
ps2: fix mouse stream corruption
Commit 7abe7eb294 "ps2: Fix mouse stream corruption due to lost data"
added code to avoid mouse stream corruptions but the calculation of
the needed free queue size was wrong. Fix this.
To reproduce, open a text file with the vim 7.3 32 bit for DOS exe-
cutable in a FreeDOS client started with -display sdl and move the
mouse around for a few seconds. You will quickly see erratic mouse
movements and unexpected mouse clicks. CuteMouse (ctmouse.exe) in
FreeDOS doesn't try to re-sync the mouse stream.
Fixes: 7abe7eb294 ("ps2: Fix mouse stream corruption due to lost data")
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-1-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: 7704bb02dd73070b218fb091cdda79679dab2b8f
https://github.com/qemu/qemu/commit/7704bb02dd73070b218fb091cdda79679dab2b8f
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/ps2.c
Log Message:
-----------
ps2: don't raise an interrupt if queue is full
ps2_queue() behaves differently than the very similar functions
ps2_queue_2() to ps2_queue_4(). The first one calls update_irq()
even if the queue is full, the others don't. Change ps2_queue()
to be consistent with the others.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-2-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: cec3252416bb76d3c5cee178825a6321950cedec
https://github.com/qemu/qemu/commit/cec3252416bb76d3c5cee178825a6321950cedec
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/ps2.c
Log Message:
-----------
ps2: don't deassert irq twice if queue is empty
Don't deassert the irq twice if the queue is empty. While the
second deassertion doesn't do any harm, it's unnecessary.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-3-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: c3c4a96116ac6e7a1486a74eff7e5eae04c4fac2
https://github.com/qemu/qemu/commit/c3c4a96116ac6e7a1486a74eff7e5eae04c4fac2
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: split out interrupt line changing code
Split out the interrupt line changing code from kbd_update_irq().
This is a preparation for the next patch. There is no functional
change.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-4-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: ff6e1624b33dc40545fb19cb751ea68a565036fe
https://github.com/qemu/qemu/commit/ff6e1624b33dc40545fb19cb751ea68a565036fe
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/core/machine.c
M hw/input/pckbd.c
Log Message:
-----------
pckbd: don't update OBF flags if KBD_STAT_OBF is set
Don't update the OBF flags in the status register and the cor-
responding IRQ lines if KBD_STAT_OBF is set. Otherwise this
may change the PS/2 event type. If the guest ISR was already
scheduled, the changed event type will be rather surprising for
the guest.
This fixes a mouse event stream corruption. To reproduce the
problem start a FreeDOS 1.2 guest with -machine pc,accel=kvm
and -display gtk. The KVM in-kernel irqchip has to be enabled.
Now open a text file with edit.exe in the guest and hold down
the cursor right key and at the same time move the mouse around.
You will quickly notice erratic mouse movements and unexpected
mouse clicks.
A trace file shows the mouse event stream corruption. Guest
rip 0xce93 (f000:ce93) is the in al,0x60 instruction in the
seabios mouse ISR, guest rip 0xceca (f000:ceca) is the
in al,0x60 instruction in the seabios keyboard ISR.
qemu-system-x86-5659 [007] .... 280.971116:
tracing_mark_write: pckbd_kbd_update_irq kbd=0 aux=1
# gtk queues a mouse event
qemu-system-x86-5665 [000] .... 280.971121:
kvm_exit: reason EXTERNAL_INTERRUPT rip 0x22da info 0 800000fd
qemu-system-x86-5665 [000] d..1 280.971122:
kvm_entry: vcpu 0, rip 0x22da
qemu-system-x86-5665 [000] .... 280.971123:
kvm_exit: reason EXTERNAL_INTERRUPT rip 0x22da info 0 800000fd
qemu-system-x86-5665 [000] d..1 280.971124:
kvm_entry: vcpu 0, rip 0x22da
qemu-system-x86-5665 [000] .... 280.971126:
kvm_exit: reason IO_INSTRUCTION rip 0x110c8c info 640008 0
qemu-system-x86-5665 [000] .... 280.971176:
tracing_mark_write: pckbd_kbd_read_status 0x3d
# KBD_STAT_OBF and KBD_STAT_MOUSE_OBF set, the mouse ISR will
# read data from the PS/2 controller.
qemu-system-x86-5665 [000] d..1 280.971180:
kvm_entry: vcpu 0, rip 0x110c8d
qemu-system-x86-5665 [000] .... 280.971191:
kvm_exit: reason EXTERNAL_INTERRUPT rip 0x110c8d info 0 800000f6
qemu-system-x86-5665 [000] d..1 280.971191:
kvm_entry: vcpu 0, rip 0x110c8d
qemu-system-x86-5665 [000] .... 280.971193:
kvm_exit: reason IO_INSTRUCTION rip 0xce93 info 600048 0
# the mouse ISR wants to read data from the PS/2 controller
qemu-system-x86-5659 [007] .... 280.971231:
tracing_mark_write: pckbd_kbd_update_irq kbd=1 aux=0
qemu-system-x86-5659 [007] .... 280.971238:
tracing_mark_write: pckbd_kbd_update_irq kbd=1 aux=0
# gtk queues a keyboard event 0xe0 0x4d (key right)
qemu-system-x86-5665 [000] .... 280.971257:
tracing_mark_write: pckbd_kbd_update_irq kbd=0 aux=1
qemu-system-x86-5665 [000] .... 280.971262:
tracing_mark_write: pckbd_kbd_update_irq kbd=1 aux=0
# ps2_read_data() deasserts and reasserts the keyboard IRQ
qemu-system-x86-5665 [000] .... 280.971266:
tracing_mark_write: pckbd_kbd_read_data 0xe0 kbd
# -> the mouse ISR receives keyboard data
qemu-system-x86-5665 [000] d..1 280.971268:
kvm_entry: vcpu 0, rip 0xce95
qemu-system-x86-5665 [000] .... 280.971269:
kvm_exit: reason IO_INSTRUCTION rip 0xe828 info a00040 0
qemu-system-x86-5665 [000] .... 280.971270:
kvm_ack_irq: irqchip PIC slave pin 12
qemu-system-x86-5665 [000] d..1 280.971270:
kvm_entry: vcpu 0, rip 0xe82a
qemu-system-x86-5665 [000] .... 280.971271:
kvm_exit: reason IO_INSTRUCTION rip 0xe82a info 200040 0
qemu-system-x86-5665 [000] .... 280.971271:
kvm_ack_irq: irqchip PIC master pin 2
qemu-system-x86-5665 [000] d..1 280.971271:
kvm_entry: vcpu 0, rip 0xe82c
qemu-system-x86-5665 [000] .... 280.971272:
kvm_exit: reason PENDING_INTERRUPT rip 0x22da info 0 0
qemu-system-x86-5665 [000] d..1 280.971273:
kvm_entry: vcpu 0, rip 0x22da
qemu-system-x86-5665 [000] .... 280.971274:
kvm_exit: reason IO_INSTRUCTION rip 0x110c8c info 640008 0
qemu-system-x86-5665 [000] .... 280.971275:
tracing_mark_write: pckbd_kbd_read_status 0x1d
qemu-system-x86-5665 [000] d..1 280.971276:
kvm_entry: vcpu 0, rip 0x110c8d
qemu-system-x86-5665 [000] .... 280.971277:
kvm_exit: reason IO_INSTRUCTION rip 0xceca info 600048 0
# the keyboard ISR wants to read data from the PS/2 controller
qemu-system-x86-5665 [000] .... 280.971279:
tracing_mark_write: pckbd_kbd_update_irq kbd=0 aux=1
qemu-system-x86-5665 [000] .... 280.971282:
tracing_mark_write: pckbd_kbd_read_data 0x4d kbd
# the keyboard ISR receives the second byte of the keyboard event
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-5-vr_qemu@t-online.de>
[ kraxel: add missing include ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: d1e45668d2128b064e2cd8080ca662f9b0f33bd6
https://github.com/qemu/qemu/commit/d1e45668d2128b064e2cd8080ca662f9b0f33bd6
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: PS/2 keyboard throttle
Limit the keyboard data rate to the serial link speed. Some old
DOS software relies on being able to read an incoming scan-code
more than once. After reading keyboard data from the i8042
controller, the guest software has 1ms to read the same data
again.
Use -global i8042.kbd-throttle=on to enable this feature.
To see how this patch works, start a FreeDOS 1.2 guest with the
qemu option -global i8042.kbd-throttle=on and open a text file
with the vim 7.3 32 bit for DOS executable. Then use the cursor
keys (not the cursor keys on the numeric keypad) to move through
the text. Without the kbd-throttle option enabled each keystroke
will move the cursor two positions.
Buglink: https://bugs.launchpad.net/bugs/1895363
Buglink: https://bugs.launchpad.net/bugs/1897568
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-6-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: ac9192bd0a9cae217eac8b3b34d3caae93638e51
https://github.com/qemu/qemu/commit/ac9192bd0a9cae217eac8b3b34d3caae93638e51
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: add state variable for interrupt source
Currently there is only one flag to distinguish between two
interrupt sources and there are no available flags for more
sources. Add an internal state variable to store the interrupt
source. The next patch will introduce an additional interrupt
source. There is no functional change.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-7-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: aa67a42f8d28cb7db743a070afa8f143235a4e7f
https://github.com/qemu/qemu/commit/aa67a42f8d28cb7db743a070afa8f143235a4e7f
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: add controller response queue
Add a separate queue for PS/2 controller responses. The
responses no longer get queued in the keyboard or mouse queues.
The advantage of this can be seen after the next two patches,
where the guest can disable the PS/2 communication with keyboard
and mouse and still talk to the PS/2 controller.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-8-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: e4697fabb58133c3cfa5d3afe727db80beda5af7
https://github.com/qemu/qemu/commit/e4697fabb58133c3cfa5d3afe727db80beda5af7
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: add function kbd_pending()
Replace reads of the variable s->pending with a call to a new
function kbd_pending() to ease the review of the next patch.
There is no functional change.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-9-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: f6f57a82989725fa6f23a4e55cebbc85a54b77c7
https://github.com/qemu/qemu/commit/f6f57a82989725fa6f23a4e55cebbc85a54b77c7
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: correctly disable PS/2 communication
Currently the PS/2 controller command KBD_CCMD_MOUSE_DISABLE
doesn't disable the PS/2 mouse communication at all, and the
PS/2 controller commands KBD_CCMD_KBD_DISABLE and
KBD_CCMD_KBD_ENABLE only disable and enable the keyboard
interrupt, which is very different from what a real PS/2
controller does. A guest may notice the difference.
Mask out pending data on disabled queues to correctly disable
the PS/2 controller communication.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-10-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: 314f9064b67f117f6a82b1a1f1c70cd75a88e943
https://github.com/qemu/qemu/commit/314f9064b67f117f6a82b1a1f1c70cd75a88e943
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: remove duplicated keyboard and mouse defines
In 2005 the author of commit daa579632d "PS2 mouse and keyboard
separation (Paul Brook)" and 0e43e99c04 "PS2 mouse and keyboard
separation (Paul Brook)" separated the PS/2 controller code and
the PS/2 keyboard and mouse code. It seems he forgot to remove
a few defines. Remove them now.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-11-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: 9d74e6c3e763ef4095c8a5f853e175b4a9c710a2
https://github.com/qemu/qemu/commit/9d74e6c3e763ef4095c8a5f853e175b4a9c710a2
Author: Volker Rümelin <vr_qemu@t-online.de>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/pckbd.c
Log Message:
-----------
pckbd: clear outport_present in outer pre_load()
The variable outport_present is a flag to show if the outport
subsection was loaded. Clear the outport_present flag in the
outer pre_load() function. This method is recommended in the QEMU
manual for developers in the chapter "Migration, Subsections".
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20210525181441.27768-12-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: 96376ab154cfb7a8f0b985e26db5b0074b86c2ee
https://github.com/qemu/qemu/commit/96376ab154cfb7a8f0b985e26db5b0074b86c2ee
Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/input/ps2.c
Log Message:
-----------
hw/input/ps2: Use ps2_raise_irq() instead of open coding it
Inspired-by: Volker Rümelin <vr_qemu@t-online.de>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210513171244.3940519-1-f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Commit: 2ab2dad01f6dc3667c0d53d2b1ba46b511031207
https://github.com/qemu/qemu/commit/2ab2dad01f6dc3667c0d53d2b1ba46b511031207
Author: Peter Maydell <peter.maydell@linaro.org>
Date: 2021-05-26 (Wed, 26 May 2021)
Changed paths:
M hw/core/machine.c
M hw/input/pckbd.c
M hw/input/ps2.c
M hw/input/trace-events
Log Message:
-----------
Merge remote-tracking branch
'remotes/kraxel/tags/input-20210526-pull-request' into staging
input: a bunch of ps2 fixes.
# gpg: Signature made Wed 26 May 2021 15:06:12 BST
# gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138
* remotes/kraxel/tags/input-20210526-pull-request:
hw/input/ps2: Use ps2_raise_irq() instead of open coding it
pckbd: clear outport_present in outer pre_load()
pckbd: remove duplicated keyboard and mouse defines
pckbd: correctly disable PS/2 communication
pckbd: add function kbd_pending()
pckbd: add controller response queue
pckbd: add state variable for interrupt source
pckbd: PS/2 keyboard throttle
pckbd: don't update OBF flags if KBD_STAT_OBF is set
pckbd: split out interrupt line changing code
ps2: don't deassert irq twice if queue is empty
ps2: don't raise an interrupt if queue is full
ps2: fix mouse stream corruption
hw/input: expand trace info reported for ps2 device
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Compare: https://github.com/qemu/qemu/compare/0319ad22bd57...2ab2dad01f6d