xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tamas K Lengyel <tamas.lengyel@zentific.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: Tamas K Lengyel <tamas.lengyel@zentific.com>,
	Julien Grall <julien.grall@arm.com>
Subject: Re: [PATCH v2 1/2] arm/mem_access: adjust check_and_get_page to not rely on current
Date: Tue, 3 Jan 2017 08:29:02 -0700	[thread overview]
Message-ID: <CAErYnshgnWDnUCwUkrDsiAkj56m4LKee+RgOZyhiUwsQfVygXw@mail.gmail.com> (raw)
In-Reply-To: <20161209195925.21420-1-tamas.lengyel@zentific.com>

On Fri, Dec 9, 2016 at 12:59 PM, Tamas K Lengyel
<tamas.lengyel@zentific.com> wrote:
> The only caller of this function is get_page_from_gva which already takes
> a vcpu pointer as input. Pass this along to make the function in-line with
> its intended use-case.
>
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Julien Grall <julien.grall@arm.com>

Patch ping.

> ---
>  xen/arch/arm/p2m.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index cc5634b..837be1d 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1461,7 +1461,8 @@ mfn_t gfn_to_mfn(struct domain *d, gfn_t gfn)
>   * we indeed found a conflicting mem_access setting.
>   */
>  static struct page_info*
> -p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag)
> +p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag,
> +                                  const struct vcpu *v)
>  {
>      long rc;
>      paddr_t ipa;
> @@ -1470,7 +1471,7 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag)
>      xenmem_access_t xma;
>      p2m_type_t t;
>      struct page_info *page = NULL;
> -    struct p2m_domain *p2m = &current->domain->arch.p2m;
> +    struct p2m_domain *p2m = &v->domain->arch.p2m;
>
>      rc = gva_to_ipa(gva, &ipa, flag);
>      if ( rc < 0 )
> @@ -1482,7 +1483,7 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag)
>       * We do this first as this is faster in the default case when no
>       * permission is set on the page.
>       */
> -    rc = __p2m_get_mem_access(current->domain, gfn, &xma);
> +    rc = __p2m_get_mem_access(v->domain, gfn, &xma);
>      if ( rc < 0 )
>          goto err;
>
> @@ -1546,7 +1547,7 @@ p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag)
>
>      page = mfn_to_page(mfn_x(mfn));
>
> -    if ( unlikely(!get_page(page, current->domain)) )
> +    if ( unlikely(!get_page(page, v->domain)) )
>          page = NULL;
>
>  err:
> @@ -1587,7 +1588,7 @@ struct page_info *get_page_from_gva(struct vcpu *v, vaddr_t va,
>
>  err:
>      if ( !page && p2m->mem_access_enabled )
> -        page = p2m_mem_access_check_and_get_page(va, flags);
> +        page = p2m_mem_access_check_and_get_page(va, flags, v);
>
>      p2m_read_unlock(p2m);
>
> --
> 2.10.2
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-01-03 15:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 19:59 [PATCH v2 1/2] arm/mem_access: adjust check_and_get_page to not rely on current Tamas K Lengyel
2016-12-09 19:59 ` [PATCH v2 2/2] p2m: split mem_access into separate files Tamas K Lengyel
2017-01-03 15:31   ` Tamas K Lengyel
2017-01-11 16:33     ` Konrad Rzeszutek Wilk
2017-01-30 21:11   ` Stefano Stabellini
2016-12-12  7:42 ` [PATCH v2 1/2] arm/mem_access: adjust check_and_get_page to not rely on current Jan Beulich
2016-12-12  7:47   ` Tamas K Lengyel
2016-12-12 11:46     ` Julien Grall
2016-12-12 18:42       ` Tamas K Lengyel
2016-12-12 19:11         ` Julien Grall
2016-12-12 19:41           ` Tamas K Lengyel
2016-12-12 21:28             ` Julien Grall
2016-12-12 23:47               ` Tamas K Lengyel
2016-12-13 12:50                 ` Julien Grall
2016-12-13 18:03                   ` Tamas K Lengyel
2016-12-13 18:39                   ` Tamas K Lengyel
2016-12-13 18:28                 ` Andrew Cooper
2016-12-13 18:41                   ` Julien Grall
2016-12-13 19:39                     ` Andrew Cooper
2016-12-14 12:05                       ` Julien Grall
2016-12-15  4:54                         ` George Dunlap
2016-12-15 16:16                           ` Julien Grall
2017-01-03 15:29 ` Tamas K Lengyel [this message]
2017-01-30 21:11 ` 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=CAErYnshgnWDnUCwUkrDsiAkj56m4LKee+RgOZyhiUwsQfVygXw@mail.gmail.com \
    --to=tamas.lengyel@zentific.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).