xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: xen-devel@lists.xen.org
Cc: andre.przywara@arm.com, Julien Grall <julien.grall@arm.com>,
	sstabellini@kernel.org
Subject: [PATCH v4 06/10] xen/arm: mm: Use PAGE_HYPERVISOR_* instead of MT_* when calling set_fixmap
Date: Mon,  9 Oct 2017 14:23:37 +0100	[thread overview]
Message-ID: <20171009132341.1678-7-julien.grall@arm.com> (raw)
In-Reply-To: <20171009132341.1678-1-julien.grall@arm.com>

At the moment, PAGE_HYPERVISOR_* and MT_* have exactly the same value.
In a follow-up patch the former will be extended to carry more
information.

It looks like the caller of set_fixmap are mixing the both. Stay
consistent and only use PAGE_HYPERVISOR_*. This is also match the
behavior of create_xen_entries and would potentially allow to share some
part in the future.

Also rename the parameter 'attributes' to 'flags' so it is clearer what
is the interface.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---
    Changes in v4:
        - Patch added.
---
 xen/arch/arm/kernel.c             | 2 +-
 xen/arch/arm/mm.c                 | 4 ++--
 xen/arch/arm/platforms/vexpress.c | 3 ++-
 xen/drivers/video/arm_hdlcd.c     | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index a12baa86e7..c2755a9ab9 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -54,7 +54,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
         s = paddr & (PAGE_SIZE-1);
         l = min(PAGE_SIZE - s, len);
 
-        set_fixmap(FIXMAP_MISC, maddr_to_mfn(paddr), MT_NORMAL_NC);
+        set_fixmap(FIXMAP_MISC, maddr_to_mfn(paddr), PAGE_HYPERVISOR_WC);
         memcpy(dst, src + s, l);
         clean_dcache_va_range(dst, l);
 
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 39bade63f5..70a03015ec 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -329,9 +329,9 @@ static inline lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned attr)
 }
 
 /* Map a 4k page in a fixmap entry */
-void set_fixmap(unsigned map, mfn_t mfn, unsigned attributes)
+void set_fixmap(unsigned map, mfn_t mfn, unsigned int flags)
 {
-    lpae_t pte = mfn_to_xen_entry(mfn, attributes);
+    lpae_t pte = mfn_to_xen_entry(mfn, flags);
     pte.pt.table = 1; /* 4k mappings always have this bit set */
     pte.pt.xn = 1;
     write_pte(xen_fixmap + third_table_offset(FIXMAP_ADDR(map)), pte);
diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c
index df2c4b5bec..39b6bcc70e 100644
--- a/xen/arch/arm/platforms/vexpress.c
+++ b/xen/arch/arm/platforms/vexpress.c
@@ -65,7 +65,8 @@ int vexpress_syscfg(int write, int function, int device, uint32_t *data)
     uint32_t *syscfg = (uint32_t *) FIXMAP_ADDR(FIXMAP_MISC);
     int ret = -1;
 
-    set_fixmap(FIXMAP_MISC, maddr_to_mfn(V2M_SYS_MMIO_BASE), MT_DEVICE_nGnRE);
+    set_fixmap(FIXMAP_MISC, maddr_to_mfn(V2M_SYS_MMIO_BASE),
+               PAGE_HYPERVISOR_NOCACHE);
 
     if ( syscfg[V2M_SYS_CFGCTRL/4] & V2M_SYS_CFG_START )
         goto out;
diff --git a/xen/drivers/video/arm_hdlcd.c b/xen/drivers/video/arm_hdlcd.c
index 1175399dbc..e1174b223f 100644
--- a/xen/drivers/video/arm_hdlcd.c
+++ b/xen/drivers/video/arm_hdlcd.c
@@ -227,7 +227,7 @@ void __init video_init(void)
     /* uses FIXMAP_MISC */
     set_pixclock(videomode->pixclock);
 
-    set_fixmap(FIXMAP_MISC, maddr_to_mfn(hdlcd_start), MT_DEVICE_nGnRE);
+    set_fixmap(FIXMAP_MISC, maddr_to_mfn(hdlcd_start), PAGE_HYPERVISOR_NOCACHE);
     HDLCD[HDLCD_COMMAND] = 0;
 
     HDLCD[HDLCD_LINELENGTH] = videomode->xres * bytes_per_pixel;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-10-09 13:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 13:23 [PATCH v4 00/10] xen/arm: Memory subsystem clean-up Julien Grall
2017-10-09 13:23 ` [PATCH v4 01/10] xen/arm: page: Use ARMv8 naming to improve readability Julien Grall
2017-10-10 21:13   ` Stefano Stabellini
2017-10-09 13:23 ` [PATCH v4 02/10] xen/arm: page: Clean-up the definition of MAIRVAL Julien Grall
2017-10-09 13:23 ` [PATCH v4 03/10] xen/arm: mm: Rename and clarify AP[1] in the stage-1 page table Julien Grall
2017-10-09 13:23 ` [PATCH v4 04/10] xen/arm: Switch to SYS_STATE_boot just after end_boot_allocator() Julien Grall
2017-10-09 13:23 ` [PATCH v4 05/10] xen/arm: mm: Rename 'ai' into 'flags' in create_xen_entries Julien Grall
2017-10-09 13:23 ` Julien Grall [this message]
2017-10-10 21:20   ` [PATCH v4 06/10] xen/arm: mm: Use PAGE_HYPERVISOR_* instead of MT_* when calling set_fixmap Stefano Stabellini
2017-10-09 13:23 ` [PATCH v4 07/10] xen/arm: page: Describe the layout of flags used to update page tables Julien Grall
2017-10-09 13:23 ` [PATCH v4 08/10] xen/arm: mm: Embed permission in the flags Julien Grall
2017-10-10 21:16   ` Stefano Stabellini
2017-10-09 13:23 ` [PATCH v4 09/10] xen/arm: mm: Handle permission flags when adding a new mapping Julien Grall
2017-10-10 21:17   ` Stefano Stabellini
2017-10-09 13:23 ` [PATCH v4 10/10] xen/arm: mm: Use memory flags for modify_xen_mappings rather than custom one Julien Grall
2017-10-10 21:28 ` [PATCH v4 00/10] xen/arm: Memory subsystem clean-up Stefano Stabellini

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=20171009132341.1678-7-julien.grall@arm.com \
    --to=julien.grall@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=sstabellini@kernel.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 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).