All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH 6/6] xen: arm: use superpages in p2m when pages are suitably aligned
Date: Tue, 10 Jun 2014 16:23:18 +0100	[thread overview]
Message-ID: <1402413798.7541.11.camel@kazak.uk.xensource.com> (raw)
In-Reply-To: <5396F5A7.1030001@linaro.org>

On Tue, 2014-06-10 at 13:10 +0100, Julien Grall wrote:
> 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...

That would be 16TB of memory, which isn't out of the question but we
don't currently support it. Still, not much harm in increase to a 64-bit
field.

> [..]
> 
> > +    else
> > +    {
> > +        clear_page(p);
> > +    }
> > +
> 
> Spurious {}.

I prefer them when on both halves of an else when one of them needs
them, but I guess I'm in a minority so I'll remove.

> > @@ -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 thihk I thought the that the callers of apply_p2m_changes were
inconsistent about this, but then I changed my mind and somehow failed
to remove this change.

> 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.

Arianna is sorting that all out in her mmio mapping series.

Ian.

  reply	other threads:[~2014-06-10 15:23 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
2014-06-10 15:23     ` Ian Campbell [this message]
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=1402413798.7541.11.camel@kazak.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --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.