From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com,
david.vrabel@citrix.com
Subject: Re: [PATCH 2/6] xenbus: Use grant-table wrapper functions
Date: Mon, 24 Oct 2011 17:57:59 -0400 [thread overview]
Message-ID: <20111024215759.GL2441@phenom.dumpdata.com> (raw)
In-Reply-To: <1319124957-32269-3-git-send-email-dgdegra@tycho.nsa.gov>
On Thu, Oct 20, 2011 at 11:35:53AM -0400, Daniel De Graaf wrote:
> The gnttab_set_{map,unmap}_op functions should be used instead of
> directly populating the fields of gnttab_map_grant_ref.
You could also mention that this has the side effect that under HVM, this happens
automatically:
op->host_addr = __pa(vaddr);
while under PV it is unchanged.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
> drivers/xen/xenbus/xenbus_client.c | 17 +++++++----------
> 1 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
> index 534e744..ca7c287 100644
> --- a/drivers/xen/xenbus/xenbus_client.c
> +++ b/drivers/xen/xenbus/xenbus_client.c
> @@ -544,12 +544,10 @@ EXPORT_SYMBOL_GPL(xenbus_map_ring_valloc);
> int xenbus_map_ring(struct xenbus_device *dev, int gnt_ref,
> grant_handle_t *handle, void *vaddr)
> {
> - struct gnttab_map_grant_ref op = {
> - .host_addr = (unsigned long)vaddr,
> - .flags = GNTMAP_host_map,
> - .ref = gnt_ref,
> - .dom = dev->otherend_id,
> - };
> + struct gnttab_map_grant_ref op;
> +
> + gnttab_set_map_op(&op, (phys_addr_t)vaddr, GNTMAP_host_map, gnt_ref,
> + dev->otherend_id);
>
> if (HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1))
> BUG();
> @@ -674,10 +672,9 @@ EXPORT_SYMBOL_GPL(xenbus_unmap_ring_vfree);
> int xenbus_unmap_ring(struct xenbus_device *dev,
> grant_handle_t handle, void *vaddr)
> {
> - struct gnttab_unmap_grant_ref op = {
> - .host_addr = (unsigned long)vaddr,
> - .handle = handle,
> - };
> + struct gnttab_unmap_grant_ref op;
> +
> + gnttab_set_unmap_op(&op, (phys_addr_t)vaddr, GNTMAP_host_map, handle);
>
> if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1))
> BUG();
> --
> 1.7.6.4
next prev parent reply other threads:[~2011-10-24 21:57 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-18 20:26 [PATCH 0/5] xen/{net, blk}back support for running in HVM Daniel De Graaf
2011-10-18 20:26 ` [PATCH 1/5] xen/netback: Use xenballooned pages for comms Daniel De Graaf
2011-10-19 9:04 ` Ian Campbell
2011-10-19 10:39 ` David Vrabel
2011-10-19 15:12 ` Ian Campbell
2011-10-19 15:01 ` Daniel De Graaf
2011-10-19 16:32 ` David Vrabel
2011-10-19 16:56 ` Daniel De Graaf
2011-10-24 21:40 ` Konrad Rzeszutek Wilk
2011-10-24 21:47 ` Daniel De Graaf
2011-10-24 22:08 ` Konrad Rzeszutek Wilk
2011-10-24 22:24 ` Daniel De Graaf
2011-10-18 20:26 ` [PATCH 2/5] xen/netback: Enable netback on HVM guests Daniel De Graaf
2011-10-18 20:26 ` [PATCH 3/5] xen/blkback: Use xenballooned pages for mapped areas Daniel De Graaf
2011-10-18 20:26 ` [PATCH 4/5] xen/blkback: don't add m2p overrides when using autotranslated physmap Daniel De Graaf
2011-10-19 9:10 ` Ian Campbell
2011-10-18 20:26 ` [PATCH 5/5] xen/blkback: Enable blkback on HVM guests Daniel De Graaf
2011-10-20 15:35 ` [PATCH v2 0/6] xen/{net, blk}back support for running in HVM Daniel De Graaf
2011-10-20 15:35 ` [PATCH 1/6] xenbus: Support HVM backends Daniel De Graaf
2011-10-20 16:48 ` [PATCH 1/6 v2] " Daniel De Graaf
2011-10-24 21:55 ` Konrad Rzeszutek Wilk
2011-10-20 15:35 ` [PATCH 2/6] xenbus: Use grant-table wrapper functions Daniel De Graaf
2011-10-24 21:57 ` Konrad Rzeszutek Wilk [this message]
2011-10-20 15:35 ` [PATCH 3/6] xen/grant-table: Support mappings required by blkback Daniel De Graaf
2011-10-24 22:00 ` Konrad Rzeszutek Wilk
2011-10-20 15:35 ` [PATCH 4/6] xen/blkback: use grant-table.c hypercall wrappers Daniel De Graaf
2011-10-20 15:35 ` [PATCH 5/6] xen/netback: Enable netback on HVM guests Daniel De Graaf
2011-10-24 9:31 ` Ian Campbell
2011-10-24 9:31 ` Ian Campbell
2011-10-24 9:34 ` David Miller
2011-10-24 14:19 ` [Xen-devel] " Konrad Rzeszutek Wilk
2011-10-20 15:35 ` [PATCH 6/6] xen/blkback: Enable blkback " Daniel De Graaf
-- strict thread matches above, loose matches on Subject: below --
2011-12-14 20:12 [PATCH v3 0/6] xen/{net, blk}back support for running in HVM Daniel De Graaf
2011-12-14 20:12 ` [PATCH 2/6] xenbus: Use grant-table wrapper functions Daniel De Graaf
2011-12-16 20:09 ` Konrad Rzeszutek Wilk
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=20111024215759.GL2441@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=xen-devel@lists.xensource.com \
/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.