From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: tim@xen.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH 6/6] xen: arm: use superpages in p2m when pages are suitably aligned
Date: Tue, 10 Jun 2014 13:10:15 +0100 [thread overview]
Message-ID: <5396F5A7.1030001@linaro.org> (raw)
In-Reply-To: <1402394278-9850-6-git-send-email-ian.campbell@citrix.com>
Hi Ian,
This patch looks good in general. I've only few comments, see them below.
On 06/10/2014 10:57 AM, Ian Campbell wrote:
> +void p2m_dump_info(struct domain *d)
> +{
> + struct p2m_domain *p2m = &d->arch.p2m;
> +
> + spin_lock(&p2m->lock);
> + printk("p2m mappings for domain %d (vmid %d):\n",
> + d->domain_id, p2m->vmid);
> + BUG_ON(p2m->stats.mappings[0] || p2m->stats.shattered[0]);
> + printk(" 1G mappings: %d (shattered %d)\n",
> + p2m->stats.mappings[1], p2m->stats.shattered[1]);
> + printk(" 2M mappings: %d (shattered %d)\n",
> + p2m->stats.mappings[2], p2m->stats.shattered[2]);
> + printk(" 4K mappings: %d\n", p2m->stats.mappings[3]);
I wondering if we can have more than 2^32-1 4K mapping sometimes...
[..]
> + else
> + {
> + clear_page(p);
> + }
> +
Spurious {}.
[..]
> +/*
> + * 0 == (P2M_ONE_DESCEND) continue to decend the tree
s/decend/descend/
[..]
> @@ -574,7 +803,7 @@ int guest_physmap_add_entry(struct domain *d,
> {
> return apply_p2m_changes(d, INSERT,
> pfn_to_paddr(gpfn),
> - pfn_to_paddr(gpfn + (1 << page_order)),
> + pfn_to_paddr(gpfn + (1 << page_order)) - 1,
> @@ -584,7 +813,7 @@ void guest_physmap_remove_page(struct domain *d,
> {
> apply_p2m_changes(d, REMOVE,
> pfn_to_paddr(gpfn),
> - pfn_to_paddr(gpfn + (1<<page_order)),
> + pfn_to_paddr(gpfn + (1<<page_order)) - 1,
Why did you add -1 on both function? This is inconsistent with
p2m_populate_ram which use the range [start, end[.
I think we should document how we pass the argument to apply_p2m_changes
somewhere. Even better, use gmfn and nr_gfn, as x86 does, for
apply_p2m_changes and handle internally the pfn_to_paddr stuff. This
would avoid this kind of problem.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-06-10 12:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 9:55 [PATCH 0/6] xen: arm: Use super pages in p2m Ian Campbell
2014-06-10 9:57 ` [PATCH 1/6] xen: arm: dump vcpu gic info in arch_dump_vcpu_info Ian Campbell
2014-06-10 11:08 ` Julien Grall
2014-06-10 9:57 ` [PATCH 2/6] tools: arm: allocate superpages to guests Ian Campbell
2014-06-10 11:23 ` Julien Grall
2014-06-10 15:16 ` Ian Campbell
2014-06-11 11:50 ` Julien Grall
2014-06-11 11:55 ` Ian Campbell
2014-06-11 12:16 ` Julien Grall
2014-06-10 9:57 ` [PATCH 3/6] xen: arm: only put_page for p2m operations which require it Ian Campbell
2014-06-10 11:28 ` Julien Grall
2014-06-10 15:18 ` Ian Campbell
2014-06-10 9:57 ` [PATCH 4/6] xen: arm: handle superpage mappings in p2m_lookup Ian Campbell
2014-06-10 11:35 ` Julien Grall
2014-06-10 9:57 ` [PATCH 5/6] xen: arm: add some helpers for assessing p2m pte Ian Campbell
2014-06-10 11:37 ` Julien Grall
2014-06-10 11:46 ` Ian Campbell
2014-06-10 11:54 ` Julien Grall
2014-06-10 12:29 ` Ian Campbell
2014-06-10 12:52 ` Julien Grall
2014-06-10 15:19 ` Ian Campbell
2014-06-10 9:57 ` [PATCH 6/6] xen: arm: use superpages in p2m when pages are suitably aligned Ian Campbell
2014-06-10 12:10 ` Julien Grall [this message]
2014-06-10 15:23 ` Ian Campbell
2014-06-10 19:11 ` Julien Grall
2014-06-11 8:29 ` 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=5396F5A7.1030001@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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.