From: Gerd Hoffmann <kraxel@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] usb: Fix (another) bug in usb_packet_map() for IOMMU handling
Date: Wed, 14 Nov 2012 09:33:31 +0100 [thread overview]
Message-ID: <50A3575B.1040800@redhat.com> (raw)
In-Reply-To: <1352870630-18311-1-git-send-email-david@gibson.dropbear.id.au>
On 11/14/12 06:23, David Gibson wrote:
> Elements in qemu SGLists can cross IOMMU page boundaries. So, in commit
> 39c138c8420f51a7da7b35233a8d7400a0b589ac "usb: Fix usb_packet_map() in the
> presence of IOMMUs", I changed usb_packet_map() to split up each SGList
> element on IOMMU page boundaries and each resulting piece of qemu's memory
> space separately to the iovec the usb code uses internally.
>
> That was correct in concept, but the patch has a bug. The 'base' variable
> correctly steps through the dma address of each piece, but then we call
> the dma_memory_map() function on the base address of the whole SGList
> element every time.
>
> This patch fixes at least one problem using XHCI on the pseries guest
> machine. It didn't affect OHCI because that doesn't use usb_packet_map().
> In theory it also affects EHCI, but we haven't observed that in practice.
> I think the transfers were small enough on EHCI that they never crossed an
> IOMMU page boundary in practice.
Patch added to usb patch queue.
thanks,
Gerd
prev parent reply other threads:[~2012-11-14 8:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 5:23 [Qemu-devel] [PATCH] usb: Fix (another) bug in usb_packet_map() for IOMMU handling David Gibson
2012-11-14 8:33 ` Gerd Hoffmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50A3575B.1040800@redhat.com \
--to=kraxel@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).