WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Must use __copy_to_user_inatomic() in swiotlb's sync_sin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Must use __copy_to_user_inatomic() in swiotlb's sync_single()
From: Xen patchbot -3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Apr 2006 14:08:14 +0000
Delivery-date: Fri, 14 Apr 2006 07:09:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f829258fe6348fbf550fbd32c5a7f5aa0d0158ff
# Parent  cf7c902c790b07d7c45cfd54afe3e19daf3bcbac
Must use __copy_to_user_inatomic() in swiotlb's sync_single()
function, as we cannot sleep there.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r cf7c902c790b -r f829258fe634 
linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c   Thu Apr 13 18:14:46 2006
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c   Fri Apr 14 11:04:41 2006
@@ -206,8 +206,8 @@
 }
 
 /*
- * We use __copy_to_user to transfer to the host buffer because the buffer
- * may be mapped read-only (e.g, in blkback driver) but lower-level
+ * We use __copy_to_user_inatomic to transfer to the host buffer because the
+ * buffer may be mapped read-only (e.g, in blkback driver) but lower-level
  * drivers map the buffer for DMA_BIDIRECTIONAL access. This causes an
  * unnecessary copy from the aperture to the host buffer, and a page fault.
  */
@@ -225,7 +225,7 @@
                        dev  = dma_addr + size - len;
                        host = kmp + buffer.offset;
                        if (dir == DMA_FROM_DEVICE) {
-                               if (__copy_to_user(host, dev, bytes))
+                               if (__copy_to_user_inatomic(host, dev, bytes))
                                        /* inaccessible */;
                        } else
                                memcpy(dev, host, bytes);
@@ -238,7 +238,7 @@
                char *host = (char *)phys_to_virt(
                        page_to_pseudophys(buffer.page)) + buffer.offset;
                if (dir == DMA_FROM_DEVICE) {
-                       if (__copy_to_user(host, dma_addr, size))
+                       if (__copy_to_user_inatomic(host, dma_addr, size))
                                /* inaccessible */;
                } else if (dir == DMA_TO_DEVICE)
                        memcpy(dma_addr, host, size);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>