From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Julien Grall <julien.grall@linaro.org>, xen-devel@lists.xenproject.org
Cc: "Wei Liu" <wei.liu2@citrix.com>,
ian.campbell@citrix.com,
"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
tim@xen.org, "Ian Jackson" <ian.jackson@eu.citrix.com>,
stefano.stabellini@citrix.com, "Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v2] libxc: introduce a per architecture scratch pfn for temporary grant mapping
Date: Wed, 21 Jan 2015 16:42:43 +0000 [thread overview]
Message-ID: <54BFD703.6090908@citrix.com> (raw)
In-Reply-To: <1421846744-31795-1-git-send-email-julien.grall@linaro.org>
On 21/01/15 13:25, Julien Grall wrote:
> The code to initialize the grant table in libxc uses
> xc_domain_maximum_gpfn() + 1 to get a guest pfn for mapping the grant
> frame and to initialize it.
>
> This solution has two major issues:
> - The check of the return of xc_domain_maximum_gpfn is buggy because
> xen_pfn_t is unsigned and in case of an error -ERRNO is returned.
> Which is never catch with ( pfn <= 0 ).
> - The guest memory layout maybe filled up to the end, i.e
> xc_domain_maximum_gpfn() + 1 gives either 0 or an invalid PFN due to
> hardware limitation.
>
> Futhermore, on ARM, xc_domain_maximum_gpfn() is not implemented and
> return -ENOSYS. This will make libxc to use always the same PFN which
> may colapse with an already mapped region (see xen/include/public/arch-arm.h
> for the layout).
>
> This patch only address the problem for ARM, the x86 version use the same
> behavior (ie xc_domain_maximum_gpfn() + 1), as I'm not familiar with Xen x86.
>
> A new function xc_core_arch_get_scratch_gpfn is introduced to be able to
> choose the gpfn per architecture.
>
> For the ARM version, we use the GUEST_GNTTAB_GUEST which is the base of
> the region by the guest to map the grant table. At the build time,
> nothing is mapped there.
>
> At the same time correctly check the return of xc_domain_maximum_gpfn
> for x86.
>
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
For the x86 side of things, Reviewed-by: Andrew Cooper
<andrew.cooper3@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-01-21 16:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-21 13:25 [PATCH v2] libxc: introduce a per architecture scratch pfn for temporary grant mapping Julien Grall
2015-01-21 16:42 ` Andrew Cooper [this message]
2015-01-27 17:18 ` Ian Campbell
2015-01-27 18:22 ` Ian Jackson
2015-02-16 14:49 ` Ian Jackson
2015-01-28 15:52 ` [PATCH] tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory Andrew Cooper
2015-01-29 18:35 ` Julien Grall
2015-01-30 0:17 ` Andrew Cooper
2015-02-02 15:26 ` Ian Campbell
2015-02-16 14:57 ` [PATCH v2] libxc: introduce a per architecture scratch pfn for temporary grant mapping Andrew Cooper
2015-03-03 17:41 ` [PATCH] tools/libxc: Don't leave scratch_pfn uninitialised if the domain has no memory [and 3 more messages] Ian Jackson
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=54BFD703.6090908@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@linaro.org \
--cc=roger.pau@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--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.