xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Chris Brand <chris.brand@broadcom.com>
To: xen-devel@lists.xen.org
Cc: Julien Grall <julien.grall@citrix.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH v3 1/2] xen: arm re-order assignments in mfn_to_xen_entry()
Date: Thu, 10 Sep 2015 11:56:28 -0700	[thread overview]
Message-ID: <1441911389-3626-2-git-send-email-chris.brand@broadcom.com> (raw)
In-Reply-To: <1441911389-3626-1-git-send-email-chris.brand@broadcom.com>

Shuffle lines around so that the assignments in mfn_to_xen_entry()
occur in the same order as the bits are declared in lpae_pt_t.
This makes it easier to see which ones are never given a value.
No change in behaviour.

Also fix a minor comment typo.

Signed-off-by: Chris Brand <chris.brand@broadcom.com>
Reviewed-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/page.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 5ecfd0705e07..01628f3e96cb 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -197,18 +197,18 @@ static inline lpae_t mfn_to_xen_entry(unsigned long mfn, unsigned attr)
     paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT;
     lpae_t e = (lpae_t) {
         .pt = {
-            .xn = 1,              /* No need to execute outside .text */
-            .ng = 1,              /* Makes TLB flushes easier */
-            .af = 1,              /* No need for access tracking */
+            .valid = 1,           /* Mappings are present */
+            .table = 0,           /* Set to 1 for links and 4k maps */
+            .ai = attr,
             .ns = 1,              /* Hyp mode is in the non-secure world */
             .user = 1,            /* See below */
-            .ai = attr,
-            .table = 0,           /* Set to 1 for links and 4k maps */
-            .valid = 1,           /* Mappings are present */
+            .af = 1,              /* No need for access tracking */
+            .ng = 1,              /* Makes TLB flushes easier */
+            .xn = 1,              /* No need to execute outside .text */
         }};;
     /* Setting the User bit is strange, but the ATS1H[RW] instructions
      * don't seem to work otherwise, and since we never run on Xen
-     * pagetables un User mode it's OK.  If this changes, remember
+     * pagetables in User mode it's OK.  If this changes, remember
      * to update the hard-coded values in head.S too */
 
     switch ( attr )
-- 
1.9.1

  reply	other threads:[~2015-09-10 18:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 18:56 [PATCH v3 0/2] xen: arm: Give PTE bits explict values Chris Brand
2015-09-10 18:56 ` Chris Brand [this message]
2015-09-10 18:56 ` [PATCH v3 2/2] xen: arm: Be explicit about bit values in mfn_to_xen_entry() Chris Brand
2015-09-11 14:10   ` 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=1441911389-3626-2-git-send-email-chris.brand@broadcom.com \
    --to=chris.brand@broadcom.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --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 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).