From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
xen-devel@lists.xensource.com
Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v2 2/4] xen: introduce grant_map_exists
Date: Fri, 3 Oct 2014 16:02:24 +0100 [thread overview]
Message-ID: <542EBA80.1040901@citrix.com> (raw)
In-Reply-To: <1412347845-27755-2-git-send-email-stefano.stabellini@eu.citrix.com>
On 03/10/14 15:50, Stefano Stabellini wrote:
> Check whether an mfn has been granted to a given domain on a target
> grant table.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> ---
>
> Changes in v2:
> - make the function static;
> - remove the spin_lock.
> ---
> xen/common/grant_table.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
> index 23266c3..7a6399b 100644
> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -484,6 +484,36 @@ static int _set_status(unsigned gt_version,
> return _set_status_v2(domid, readonly, mapflag, shah, act, status);
> }
>
> +static bool_t grant_map_exists(struct domain *ld,
> + struct grant_table *rgt,
> + unsigned long mfn)
> +{
> + struct active_grant_entry *act;
> + grant_ref_t ref;
> + bool_t ret = 0;
> +
> + ASSERT(&rgt->lock);
I presume you mean spin_is_locked()? This assertion is currently a
tautology.
~Andrew
> +
> + for ( ref = 0; ref != nr_grant_entries(rgt); ref++ )
> + {
> + act = &active_entry(rgt, ref);
> +
> + if ( !act->pin )
> + continue;
> +
> + if ( act->domid != ld->domain_id )
> + continue;
> +
> + if ( act->frame != mfn )
> + continue;
> +
> + ret = 1;
> + break;
> + }
> +
> + return ret;
> +}
> +
> static void mapcount(
> struct grant_table *lgt, struct domain *rd, unsigned long mfn,
> unsigned int *wrc, unsigned int *rdc)
next prev parent reply other threads:[~2014-10-03 15:02 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-03 14:47 [PATCH v2 0/4] xen/arm: introduce GNTTABOP_cache_flush Stefano Stabellini
2014-10-03 14:50 ` [PATCH v2 1/4] xen/arm: introduce invalidate_xen_dcache_va_range Stefano Stabellini
2014-10-03 14:50 ` [PATCH v2 2/4] xen: introduce grant_map_exists Stefano Stabellini
2014-10-03 15:02 ` Andrew Cooper [this message]
2014-10-03 16:20 ` Stefano Stabellini
2014-10-06 8:22 ` Jan Beulich
2014-10-06 9:37 ` Stefano Stabellini
2014-10-06 10:20 ` Jan Beulich
2014-10-06 13:08 ` Stefano Stabellini
2014-10-06 13:39 ` Jan Beulich
2014-10-06 13:46 ` Stefano Stabellini
2014-10-06 14:01 ` Jan Beulich
2014-10-06 14:34 ` Stefano Stabellini
2014-10-06 14:56 ` Jan Beulich
2014-10-06 14:57 ` Stefano Stabellini
2014-10-06 15:09 ` Jan Beulich
2014-10-06 9:41 ` Stefano Stabellini
2014-10-06 10:17 ` Jan Beulich
2014-10-03 14:50 ` [PATCH v2 3/4] xen/arm: introduce GNTTABOP_cache_flush Stefano Stabellini
2014-10-03 14:53 ` Stefano Stabellini
2014-10-03 15:16 ` Andrew Cooper
2014-10-03 16:33 ` Stefano Stabellini
2014-10-03 16:37 ` Andrew Cooper
2014-10-03 16:37 ` Ian Campbell
2014-10-06 8:49 ` Jan Beulich
2014-10-06 9:00 ` Jan Beulich
2014-10-06 15:21 ` David Vrabel
2014-10-08 11:54 ` Stefano Stabellini
2014-10-08 12:06 ` David Vrabel
2014-10-08 12:52 ` Stefano Stabellini
2014-10-08 13:01 ` Ian Campbell
2014-10-08 12:17 ` Ian Campbell
2014-10-08 12:45 ` David Vrabel
2014-10-03 14:50 ` [PATCH v2 4/4] Revert "xen/arm: introduce XENFEAT_grant_map_identity" Stefano Stabellini
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=542EBA80.1040901@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--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.