[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: arm: introduce raw_copy_to_guest_flush_dcache() function



commit 31389a2b12131cef5c9572ebd43b0d21aaf40f15
Author:     Oleksandr Dmytryshyn <oleksandr.dmytryshyn@xxxxxxxxxxxxxxx>
AuthorDate: Wed Nov 27 19:09:51 2013 +0200
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    xen: arm: introduce raw_copy_to_guest_flush_dcache() function
    
    This function flushes the dcache while copying the data.
    
    Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@xxxxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Acked-by: Julien Grall<julien.grall@xxxxxxxxxx>
---
 xen/arch/arm/guestcopy.c           |   16 +++++++++++++++-
 xen/include/asm-arm/guest_access.h |    2 ++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index d146cd6..08800a4 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -5,7 +5,8 @@
 #include <asm/mm.h>
 #include <asm/guest_access.h>
 
-unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
+static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
+                                              unsigned len, unsigned 
flush_dcache)
 {
     /* XXX needs to handle faults */
     unsigned offset = (vaddr_t)to & ~PAGE_MASK;
@@ -24,6 +25,8 @@ unsigned long raw_copy_to_guest(void *to, const void *from, 
unsigned len)
         p = map_domain_page(g>>PAGE_SHIFT);
         p += offset;
         memcpy(p, from, size);
+        if ( flush_dcache )
+            flush_xen_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
         len -= size;
@@ -35,6 +38,17 @@ unsigned long raw_copy_to_guest(void *to, const void *from, 
unsigned len)
     return 0;
 }
 
+unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
+{
+    return raw_copy_to_guest_helper(to, from, len, 0);
+}
+
+unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
+                                             unsigned len)
+{
+    return raw_copy_to_guest_helper(to, from, len, 1);
+}
+
 unsigned long raw_clear_guest(void *to, unsigned len)
 {
     /* XXX needs to handle faults */
diff --git a/xen/include/asm-arm/guest_access.h 
b/xen/include/asm-arm/guest_access.h
index 8ff088f..5876988 100644
--- a/xen/include/asm-arm/guest_access.h
+++ b/xen/include/asm-arm/guest_access.h
@@ -11,6 +11,8 @@
     (likely(count < (~0UL/size)) && access_ok(addr,count*size))
 
 unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
+unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
+                                             unsigned len);
 unsigned long raw_copy_from_guest(void *to, const void *from, unsigned len);
 unsigned long raw_clear_guest(void *to, unsigned len);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.