]> git.proxmox.com Git - qemu.git/commit
uhci: Use an intermediate buffer for usb packet data
authorHans de Goede <hdegoede@redhat.com>
Mon, 6 May 2013 08:48:57 +0000 (10:48 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 7 May 2013 09:34:03 +0000 (11:34 +0200)
commit9822261ce3bfbc7aec8b2a3e378892dc368910ed
treea95b9532e90f17c2b41e02bb3e366f9c23e8ada1
parentc3268cc1135f41264cd26bcb269b3414d3c11453
uhci: Use an intermediate buffer for usb packet data

Due to various unfortunate reasons we cannot reliable detect a guest
cancelling a packet as soon as it happens, instead we detect cancels
with some delay.

When packets are handled async, and we directly pass the guest memory for
the packet to the usb-device as iovec, this means that the usb-device can
write to guest-memory which the guest has already re-used for other purposes
-> not good!

This patch fixes this by adding an intermediate buffer and writing back not
only the result, but also the data, of async completed packets when scanning
the schedule.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-uhci.c