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 1/6 v2] xenbus: Support HVM backends
Date: Mon, 24 Oct 2011 17:55:46 -0400 [thread overview]
Message-ID: <20111024215546.GK2441@phenom.dumpdata.com> (raw)
In-Reply-To: <1319129284-521-1-git-send-email-dgdegra@tycho.nsa.gov>
On Thu, Oct 20, 2011 at 12:48:04PM -0400, Daniel De Graaf wrote:
> Initial version lacked the list_del in xenbus_unmap_ring_vfree_hvm
>
> -------------------------------------------------------->8
>
> Add HVM implementations of xenbus_(map,unmap)_ring_v(alloc,free) so
> that ring mappings can be done without using GNTMAP_contains_pte which
> is not supported on HVM.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> ---
> drivers/xen/xenbus/xenbus_client.c | 155 +++++++++++++++++++++++++++++-------
> 1 files changed, 125 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
> index 52bc57f..4b2fbcc 100644
> --- a/drivers/xen/xenbus/xenbus_client.c
> +++ b/drivers/xen/xenbus/xenbus_client.c
> @@ -32,15 +32,26 @@
>
> #include <linux/slab.h>
> #include <linux/types.h>
> +#include <linux/spinlock.h>
> #include <linux/vmalloc.h>
> #include <asm/xen/hypervisor.h>
> #include <asm/xen/page.h>
> #include <xen/interface/xen.h>
> #include <xen/interface/event_channel.h>
> +#include <xen/balloon.h>
> #include <xen/events.h>
> #include <xen/grant_table.h>
> #include <xen/xenbus.h>
>
> +struct xenbus_map_node {
> + struct list_head next;
> + struct page *page;
> + grant_handle_t handle;
> +};
> +
> +static DEFINE_SPINLOCK(xenbus_valloc_lock);
> +static LIST_HEAD(xenbus_valloc_pages);
> +
> const char *xenbus_strstate(enum xenbus_state state)
> {
> static const char *const name[] = {
> @@ -419,21 +430,8 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port)
> EXPORT_SYMBOL_GPL(xenbus_free_evtchn);
>
>
> -/**
> - * xenbus_map_ring_valloc
> - * @dev: xenbus device
> - * @gnt_ref: grant reference
> - * @vaddr: pointer to address to be filled out by mapping
> - *
> - * Based on Rusty Russell's skeleton driver's map_page.
> - * Map a page of memory into this domain from another domain's grant table.
> - * xenbus_map_ring_valloc allocates a page of virtual address space, maps the
> - * page to that address, and sets *vaddr to that address.
> - * Returns 0 on success, and GNTST_* (see xen/include/interface/grant_table.h)
> - * or -ENOMEM on error. If an error is returned, device will switch to
> - * XenbusStateClosing and the error message will be saved in XenStore.
> - */
> -int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr)
> +static int xenbus_map_ring_valloc_pv(struct xenbus_device *dev,
> + int gnt_ref, void **vaddr)
> {
> struct gnttab_map_grant_ref op = {
> .flags = GNTMAP_host_map | GNTMAP_contains_pte,
> @@ -468,6 +466,64 @@ int xenbus_map_ring_valloc(struct xenbus_device *dev, int gnt_ref, void **vaddr)
> *vaddr = area->addr;
> return 0;
> }
> +
> +static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev,
> + int gnt_ref, void **vaddr)
> +{
> + struct xenbus_map_node *node;
> + int err;
> + void *addr;
> +
> + *vaddr = NULL;
> +
> + node = kzalloc(sizeof(*node), GFP_KERNEL);
> + if (!node)
> + return -ENOMEM;
> +
> + err = alloc_xenballooned_pages(1, &node->page, false);
Add /* lowmem */ on the 'false' parameter.
next prev parent reply other threads:[~2011-10-24 21:55 UTC|newest]
Thread overview: 33+ 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 [this message]
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
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-19 17:51 [PATCH 1/6] xenbus: Support HVM backends Daniel De Graaf
2011-12-19 17:54 ` [PATCH 1/6 v2] " Daniel De Graaf
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=20111024215546.GK2441@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.