All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Julien Grall <julien.grall@linaro.org>, xen-devel@lists.xenproject.org
Cc: stefano.stabellini@citrix.com,
	George Dunlap <george.dunlap@citrix.com>,
	tim@xen.org, ian.campbell@citrix.com, patches@linaro.org
Subject: Re: [PATCH] xen/arm: Correctly implement domain_page_map_to_mfn
Date: Wed, 5 Feb 2014 14:51:31 +0000	[thread overview]
Message-ID: <52F24FF3.5050107@eu.citrix.com> (raw)
In-Reply-To: <1391609794-505-1-git-send-email-julien.grall@linaro.org>

On 02/05/2014 02:16 PM, Julien Grall wrote:
> The function domain_page_map_to_mfn can be used to translate a virtual
> address mapped by both map_domain_page and map_domain_page_global.
> The former is using vmap to map the mfn, therefore domain_page_map_to_mfn
> will always fail because the address is not in DOMHEAP range.
>
> Check if the address is in vmap range and use __pa to translate it.
>
> This patch fix guest shutdown when the event fifo is used.
>
> Signed-off-by: Julien Grall <julien.grall@linaro.org>

I assume this brings the arm paths into line with the x86 functionality?

  -George


>
> ---
>      This is a bug fix for Xen 4.4. Without this patch, it's impossible to
> use Linux 3.14 (and higher) as guest with the event fifo driver.
> ---
>   xen/arch/arm/mm.c |   10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 127cce0..bdca68a 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -325,11 +325,15 @@ void unmap_domain_page(const void *va)
>       local_irq_restore(flags);
>   }
>   
> -unsigned long domain_page_map_to_mfn(const void *va)
> +unsigned long domain_page_map_to_mfn(const void *ptr)
>   {
> +    unsigned long va = (unsigned long)ptr;
>       lpae_t *map = this_cpu(xen_dommap);
> -    int slot = ((unsigned long) va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
> -    unsigned long offset = ((unsigned long)va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
> +    int slot = (va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
> +    unsigned long offset = (va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
> +
> +    if ( va >= VMAP_VIRT_START && va < VMAP_VIRT_END )
> +        return virt_to_mfn(va);
>   
>       ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
>       ASSERT(map[slot].pt.avail != 0);

  reply	other threads:[~2014-02-05 14:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 14:16 [PATCH] xen/arm: Correctly implement domain_page_map_to_mfn Julien Grall
2014-02-05 14:51 ` George Dunlap [this message]
2014-02-06 12:02   ` Ian Campbell
2014-02-06 12:03     ` George Dunlap
2014-02-06 13:07       ` Ian Campbell
2014-02-05 16:27 ` Stefano Stabellini
2014-02-06 12:26 ` Ian Campbell

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=52F24FF3.5050107@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.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 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.