From: david.vrabel@citrix.com (David Vrabel)
To: linux-arm-kernel@lists.infradead.org
Subject: [Xen-devel] [PATCH v3 2/2] xen/arm: introduce GNTTABOP_cache_flush
Date: Thu, 9 Oct 2014 12:00:23 +0100 [thread overview]
Message-ID: <54366AC7.2080106@citrix.com> (raw)
In-Reply-To: <1412773496-15364-2-git-send-email-stefano.stabellini@eu.citrix.com>
On 08/10/14 14:04, Stefano Stabellini wrote:
> Introduce support for new hypercall GNTTABOP_cache_flush.
> Use it to perform cache flashing on pages used for dma when necessary.
This still think all these additional hypercalls in the hot path are
going to limit performance but on the understanding that this is only
used for non-coherent devices and a lack of anything better:
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
With one comment below.
> --- a/arch/arm/xen/mm32.c
> +++ b/arch/arm/xen/mm32.c
> @@ -4,6 +4,9 @@
> #include <linux/highmem.h>
>
> #include <xen/features.h>
> +#include <xen/interface/grant_table.h>
> +
> +#include <asm/xen/hypercall.h>
>
>
> /* functions called by SWIOTLB */
> @@ -22,16 +25,32 @@ static void dma_cache_maint(dma_addr_t handle, unsigned long offset,
> size_t len = left;
> void *vaddr;
>
> + if (len + offset > PAGE_SIZE)
> + len = PAGE_SIZE - offset;
Since this looks like it would result in failing the clean/invalidate
the trailing part of the buffer, I think this needs a comment explaining
why this is safe. i.e., buffers in highmem or foreign pages cannot
cross page boundaries.
David
WARNING: multiple messages have this Message-ID (diff)
From: David Vrabel <david.vrabel@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
<xen-devel@lists.xensource.com>
Cc: <Ian.Campbell@citrix.com>, <linux-kernel@vger.kernel.org>,
<david.vrabel@citrix.com>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [Xen-devel] [PATCH v3 2/2] xen/arm: introduce GNTTABOP_cache_flush
Date: Thu, 9 Oct 2014 12:00:23 +0100 [thread overview]
Message-ID: <54366AC7.2080106@citrix.com> (raw)
In-Reply-To: <1412773496-15364-2-git-send-email-stefano.stabellini@eu.citrix.com>
On 08/10/14 14:04, Stefano Stabellini wrote:
> Introduce support for new hypercall GNTTABOP_cache_flush.
> Use it to perform cache flashing on pages used for dma when necessary.
This still think all these additional hypercalls in the hot path are
going to limit performance but on the understanding that this is only
used for non-coherent devices and a lack of anything better:
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
With one comment below.
> --- a/arch/arm/xen/mm32.c
> +++ b/arch/arm/xen/mm32.c
> @@ -4,6 +4,9 @@
> #include <linux/highmem.h>
>
> #include <xen/features.h>
> +#include <xen/interface/grant_table.h>
> +
> +#include <asm/xen/hypercall.h>
>
>
> /* functions called by SWIOTLB */
> @@ -22,16 +25,32 @@ static void dma_cache_maint(dma_addr_t handle, unsigned long offset,
> size_t len = left;
> void *vaddr;
>
> + if (len + offset > PAGE_SIZE)
> + len = PAGE_SIZE - offset;
Since this looks like it would result in failing the clean/invalidate
the trailing part of the buffer, I think this needs a comment explaining
why this is safe. i.e., buffers in highmem or foreign pages cannot
cross page boundaries.
David
WARNING: multiple messages have this Message-ID (diff)
From: David Vrabel <david.vrabel@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
xen-devel@lists.xensource.com
Cc: Ian.Campbell@citrix.com, linux-kernel@vger.kernel.org,
david.vrabel@citrix.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [Xen-devel] [PATCH v3 2/2] xen/arm: introduce GNTTABOP_cache_flush
Date: Thu, 9 Oct 2014 12:00:23 +0100 [thread overview]
Message-ID: <54366AC7.2080106@citrix.com> (raw)
In-Reply-To: <1412773496-15364-2-git-send-email-stefano.stabellini@eu.citrix.com>
On 08/10/14 14:04, Stefano Stabellini wrote:
> Introduce support for new hypercall GNTTABOP_cache_flush.
> Use it to perform cache flashing on pages used for dma when necessary.
This still think all these additional hypercalls in the hot path are
going to limit performance but on the understanding that this is only
used for non-coherent devices and a lack of anything better:
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
With one comment below.
> --- a/arch/arm/xen/mm32.c
> +++ b/arch/arm/xen/mm32.c
> @@ -4,6 +4,9 @@
> #include <linux/highmem.h>
>
> #include <xen/features.h>
> +#include <xen/interface/grant_table.h>
> +
> +#include <asm/xen/hypercall.h>
>
>
> /* functions called by SWIOTLB */
> @@ -22,16 +25,32 @@ static void dma_cache_maint(dma_addr_t handle, unsigned long offset,
> size_t len = left;
> void *vaddr;
>
> + if (len + offset > PAGE_SIZE)
> + len = PAGE_SIZE - offset;
Since this looks like it would result in failing the clean/invalidate
the trailing part of the buffer, I think this needs a comment explaining
why this is safe. i.e., buffers in highmem or foreign pages cannot
cross page boundaries.
David
next prev parent reply other threads:[~2014-10-09 11:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 13:03 [PATCH v3 0/2] introduce GNTTABOP_cache_flush Stefano Stabellini
2014-10-08 13:03 ` Stefano Stabellini
2014-10-08 13:03 ` Stefano Stabellini
2014-10-08 13:04 ` [PATCH v3 1/2] xen/arm: remove handling of XENFEAT_grant_map_identity Stefano Stabellini
2014-10-08 13:04 ` Stefano Stabellini
2014-10-08 13:04 ` Stefano Stabellini
2014-10-09 10:52 ` [Xen-devel] " David Vrabel
2014-10-09 10:52 ` David Vrabel
2014-10-09 10:52 ` David Vrabel
2014-10-08 13:04 ` [PATCH v3 2/2] xen/arm: introduce GNTTABOP_cache_flush Stefano Stabellini
2014-10-08 13:04 ` Stefano Stabellini
2014-10-08 13:04 ` Stefano Stabellini
2014-10-09 11:00 ` David Vrabel [this message]
2014-10-09 11:00 ` [Xen-devel] " David Vrabel
2014-10-09 11:00 ` David Vrabel
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=54366AC7.2080106@citrix.com \
--to=david.vrabel@citrix.com \
--cc=linux-arm-kernel@lists.infradead.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.