From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
Cc: andrii.anisov@ti.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v3 1/2] xen: arm: introduce raw_copy_to_guest_flush_dcache() function
Date: Wed, 27 Nov 2013 16:59:17 +0000 [thread overview]
Message-ID: <529624E5.3030903@citrix.com> (raw)
In-Reply-To: <1385571342-2726-2-git-send-email-oleksandr.dmytryshyn@globallogic.com>
On 27/11/13 16:55, Oleksandr Dmytryshyn wrote:
> This function flushes the dcache while copying the data.
>
> Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
> ---
> xen/arch/arm/guestcopy.c | 16 +++++++++++++++-
> xen/include/asm-arm/guest_access.h | 2 ++
> 2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
> index d146cd6..4d4af09 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)
I know this is nitpicking, but Xens coding style requires spaces inside
the brackets for the if.
So "if ( flush_dcache )"
~Andrew
> + 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);
>
next prev parent reply other threads:[~2013-11-27 16:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 16:55 [PATCH v3 0/2] xen: arm: introduce a function and flush dcache while preparing the device tree for Dom0 Oleksandr Dmytryshyn
2013-11-27 16:55 ` [PATCH v3 1/2] xen: arm: introduce raw_copy_to_guest_flush_dcache() function Oleksandr Dmytryshyn
2013-11-27 16:59 ` Andrew Cooper [this message]
2013-11-27 17:05 ` Oleksandr Dmytryshyn
2013-11-27 16:55 ` [PATCH v3 2/2] xen: arm: flush dcache while preparing the device tree for Dom0 Oleksandr Dmytryshyn
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=529624E5.3030903@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=andrii.anisov@ti.com \
--cc=oleksandr.dmytryshyn@globallogic.com \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.