xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Cc: olaf@aepfle.de, xen-devel@lists.xensource.com, keir@xen.org,
	Tim Deegan <Tim.Deegan@citrix.com>,
	andres@gridcentric.ca, wei.wang2@amd.com, hongkaixing@huawei.com,
	adin@gridcentric.ca
Subject: Re: [PATCH 2 of 3] x86/mm: Teach paging to page table-based p2m
Date: Thu, 15 Mar 2012 17:21:45 +0000	[thread overview]
Message-ID: <20120315172145.GE12366@ocelot.phlegethon.org> (raw)
In-Reply-To: <b1d25298994ad7b3b8a750237a73c677.squirrel@webmail.lagarcavilla.org>

At 08:46 -0700 on 15 Mar (1331801170), Andres Lagar-Cavilla wrote:
> > Righto.  In that case, I'd be happy with just clipping MFNs and not
> > trying to unpack them.  But I think it should happen in the main
> > pte-building macros, not scattered around the p2m code.  It should just
> > be a matter of using PADDR_MASK in the right place.
> 
> Something along these lines? (RFC, not tested yet)
> Andres
> 
>  /* Construct a pte from a pfn and access flags. */
>  #define l1e_from_pfn(pfn, flags)   \
> -    ((l1_pgentry_t) { ((intpte_t)(pfn) << PAGE_SHIFT) | put_pte_flags(flags) })
> +    ((l1_pgentry_t) { ((intpte_t)((pfn) & (PADDR_MASK >> PAGE_SHIFT)) <<   \
> +                        PAGE_SHIFT) | put_pte_flags(flags) })

Yes, that's the idea.  I think 

> +    ((l1_pgentry_t) { (((intpte_t)(pfn) << PAGE_SHIFT) & PADDR_MASK) \
> +                       | put_pte_flags(flags) })

is a little neater, maybe?

In any case, I'd like Keir's ack on this, since it will affect all the
PV pagetable code too (hopefully in a trivial and correct way).

Tim.

  reply	other threads:[~2012-03-15 17:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01  3:15 [PATCH 0 of 3] RFC Paging support for AMD NPT V2 Andres Lagar-Cavilla
2012-03-01  3:15 ` [PATCH 1 of 3] IOMMU: Add command line param to disable sharing of IOMMU and hap tables Andres Lagar-Cavilla
2012-03-01  3:15 ` [PATCH 2 of 3] x86/mm: Teach paging to page table-based p2m Andres Lagar-Cavilla
2012-03-08 14:15   ` Tim Deegan
2012-03-14 19:12     ` Andres Lagar-Cavilla
2012-03-15 10:52       ` Tim Deegan
2012-03-15 15:46         ` Andres Lagar-Cavilla
2012-03-15 17:21           ` Tim Deegan [this message]
2012-03-15 17:34             ` Keir Fraser
2012-03-01  3:15 ` [PATCH 3 of 3] x86/mm: Enable paging and sharing in AMD NPT mode Andres Lagar-Cavilla
2012-03-08 13:30   ` Tim Deegan
2012-03-01  7:55 ` [PATCH 0 of 3] RFC Paging support for AMD NPT V2 Hongkaixing
2012-03-01 16:34   ` Andres Lagar-Cavilla
2012-03-02  9:35     ` Hongkaixing
2012-03-02 15:55       ` Andres Lagar-Cavilla

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=20120315172145.GE12366@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=Tim.Deegan@citrix.com \
    --cc=adin@gridcentric.ca \
    --cc=andres@gridcentric.ca \
    --cc=andres@lagarcavilla.org \
    --cc=hongkaixing@huawei.com \
    --cc=keir@xen.org \
    --cc=olaf@aepfle.de \
    --cc=wei.wang2@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /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).