From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZH2n-0007Gd-IB for qemu-devel@nongnu.org; Mon, 06 May 2013 04:45:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZH2j-0003Ty-TS for qemu-devel@nongnu.org; Mon, 06 May 2013 04:45:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZH2j-0003Sp-Lm for qemu-devel@nongnu.org; Mon, 06 May 2013 04:45:09 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r468j73C012605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 May 2013 04:45:07 -0400 From: Hans de Goede Date: Mon, 6 May 2013 10:48:56 +0200 Message-Id: <1367830137-9382-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH v2 0/1] uhci: Use an intermediate buffer for usb packet data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org Hi, 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. Changes in v2: Use usb_packet_addbuf instead of directly calling iovec_add Signed-off-by: Hans de Goede Regards, Hans