[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/14] usb-ehci: Ensure frindex writes leave a valid
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 03/14] usb-ehci: Ensure frindex writes leave a valid frindex value |
Date: |
Tue, 24 Apr 2012 17:51:20 +0200 |
From: Hans de Goede <address@hidden>
frindex is a 14 bits counter, so bits 31-14 should always be 0, and
after the commit titled "usb-ehci: frindex always is a 14 bits counter"
we rely on frindex always being a multiple of 8. I've not seen this in
practice, but theoretically a guest can write a value >= 0x4000 or a value
which is not a multiple of 8 value to frindex, this patch ensures that
things will still work when that happens.
Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index c6f21ac..4ff4d40 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1101,6 +1101,10 @@ static void ehci_mem_writel(void *ptr,
target_phys_addr_t addr, uint32_t val)
val &= USBINTR_MASK;
break;
+ case FRINDEX:
+ val &= 0x00003ff8; /* frindex is 14bits and always a multiple of 8 */
+ break;
+
case CONFIGFLAG:
val &= 0x1;
if (val) {
--
1.7.1
- [Qemu-devel] [PULL 00/14] usb patch queue, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 02/14] usb-ehci: add missing usb_packet_init() call, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 09/14] usb-redir: An interface count of 0 is a valid value, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 05/14] usb-host: don't dereference invalid iovecs, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 06/14] usb-host: fix zero-length packets, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 04/14] usb-storage: fix request canceling, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 03/14] usb-ehci: Ensure frindex writes leave a valid frindex value,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 01/14] usb-ehci: remove hack, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 13/14] usb-uhci: update irq line on reset, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 10/14] usb-redir: Reset device address and speed on disconnect, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 08/14] usb-xhci: fix bit test, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 11/14] usb-redir: Not finding an async urb id is not an error, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 12/14] usb: add serial number generator, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 14/14] usb-host: add timeout handler, Gerd Hoffmann, 2012/04/24
- [Qemu-devel] [PATCH 07/14] usb-xhci: Use PCI DMA helper functions, Gerd Hoffmann, 2012/04/24