yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From c5deaa70b6b347189a53bd2b058164dffc439a59 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 11 Jul 2014 14:20:56 +0200
Subject: [PATCH 22/43] uhci: invalidate queue on device address changes

Message-id: <1405088470-24115-24-git-send-email-kraxel@redhat.com>
Patchwork-id: 59851
O-Subject: [RHEL-7.1 qemu-kvm PATCH 23/37] uhci: invalidate queue on device address changes
Bugzilla: 1111450
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit c348e481759057c925cce4bf54336f1518b8c702)
---
 hw/usb/hcd-uhci.c | 2 ++
 1 file changed, 2 insertions(+)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/usb/hcd-uhci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 989c37a..f38f737 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -254,9 +254,11 @@ static bool uhci_queue_verify(UHCIQueue *queue, uint32_t qh_addr, UHCI_TD *td,
                               uint32_t td_addr, bool queuing)
 {
     UHCIAsync *first = QTAILQ_FIRST(&queue->asyncs);
+    uint32_t queue_token_addr = (queue->token >> 8) & 0x7f;
 
     return queue->qh_addr == qh_addr &&
            queue->token == uhci_queue_token(td) &&
+           queue_token_addr == queue->ep->dev->addr &&
            (queuing || !(td->ctrl & TD_CTRL_ACTIVE) || first == NULL ||
             first->td_addr == td_addr);
 }
-- 
1.8.3.1