From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Julien Grall <julien.grall@citrix.com>, xen-devel@lists.xenproject.org
Cc: Wei.Liu2@citrix.com, ian.campbell@citrix.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Tim Deegan <tim@xen.org>, Ian Jackson <ian.jackson@eu.citrix.com>,
stefano.stabellini@citrix.com, Jan Beulich <jbeulich@suse.com>,
Keir Fraser <keir@xen.org>
Subject: Re: [RFC 1/2] xen/mm: Clarify the granularity for each Frame Number
Date: Wed, 5 Aug 2015 12:40:07 +0100 [thread overview]
Message-ID: <55C1F617.8090208@citrix.com> (raw)
In-Reply-To: <1438774133-1564-2-git-send-email-julien.grall@citrix.com>
On 05/08/15 12:28, Julien Grall wrote:
> From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> ARM64 is able to support 64KB and 4KB page granularities. While the guest
> will support both granularities, Xen and hypercall interface will always
> be in 4KB.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@citrix.com>
> Signed-off-by: Julien Grall <julien.grall@citrix.com>
>
> ---
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
>
> I'm missing one term for Linux Frame Number but always in 4KB
> granularity. It's necessary in few places such as the balloon code where
> we need to map a Linux 4KB Frame Number into a Machine Frame Number.
>
> I was thinking to name it xen_pfn.
> ---
> xen/include/xen/mm.h | 20 ++++++++++++++------
> 1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
> index 876d370..8dfd61a 100644
> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -15,16 +15,24 @@
> *
> * mfn: Machine Frame Number
> * The values Xen puts into its own pagetables. This is the host physical
> - * memory address space with RAM, MMIO etc.
> + * memory address space with RAM, MMIO etc. Always 4KB granularity.
> *
> * gfn: Guest Frame Number
> - * The values a guest puts in its own pagetables. For an auto-translated
> - * guest (hardware assisted with 2nd stage translation, or shadowed), gfn !=
> - * mfn. For a non-translated guest which is aware of Xen, gfn == mfn.
> + * The values a guest puts in its own pagetables, except for 64KB
> + * granularity. Gfns are always based on 4KB granularity, while actually
> + * the guest could use other granularities. For an auto-translated guest
> + * (hardware assisted with 2nd stage translation, or shadowed), gfn != mfn.
> + * For a non-translated guest which is aware of Xen, gfn == mfn.
> + * Hypercalls take gfns, not mfns, as parameters unless clearly specified
> + * otherwise.
> *
> * pfn: Pseudophysical Frame Number
> - * A linear idea of a guest physical address space. For an auto-translated
> - * guest, pfn == gfn while for a non-translated guest, pfn != gfn.
> + * A linear idea of a guest physical address space. Pfns are in guest
> + * granularity, which can be 64KB or 4KB. PV guests must only use 4KB
> + * granularity. For an auto-translated guest, pfn == gfn << shift,
> + * where the shift is the different between the Xen and Linux page
> + * granularity, while for a non-translated guest, pfn != gfn. Pfns are
> + * internal to the guest and are not passed to hypercalls.
> *
> * WARNING: Some of these terms have changed over time while others have been
> * used inconsistently, meaning that a lot of existing code does not match the
I am not certain whether this is relevant information in these locations
specifically. These descriptions are for the address spaces themselves,
rather than for the representations therewithin.
64K granularity is also similar to 2M/1G superpages in their handling,
the difference being that 64K can't be subdivided if necessary?
I think a section about granularity is worthwhile, but probably a
separate paragraph. I think it is also worth keeping Xen's idea of
memory all at 4K, and in cases where 64K is in use, require appropriate
alignment in the parameter.
~Andrew
next prev parent reply other threads:[~2015-08-05 11:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 11:28 [RFC 0/2] xen: Clarify the page granularity for the hypercall Julien Grall
2015-08-05 11:28 ` [RFC 1/2] xen/mm: Clarify the granularity for each Frame Number Julien Grall
2015-08-05 11:40 ` Andrew Cooper [this message]
2015-08-05 11:51 ` Ian Campbell
2015-08-05 12:36 ` Julien Grall
2015-08-05 12:46 ` Andrew Cooper
2015-08-05 13:18 ` Julien Grall
2015-08-12 7:16 ` Jan Beulich
2015-08-12 9:57 ` Julien Grall
2015-08-12 10:33 ` Jan Beulich
2015-08-12 11:13 ` Julien Grall
2015-08-12 11:58 ` Jan Beulich
2015-08-12 12:57 ` Julien Grall
2015-08-12 13:25 ` Jan Beulich
2015-08-05 11:28 ` [RFC 2/2] xen/public: grant-table: Specificy the size of the grant Julien Grall
2015-08-05 16:51 ` Stefano Stabellini
2015-08-12 7:21 ` Jan Beulich
2015-08-12 10:00 ` Julien Grall
2015-08-12 10:35 ` Jan Beulich
2015-08-12 11:08 ` Julien Grall
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=55C1F617.8090208@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Wei.Liu2@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@citrix.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.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 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).