]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: mm: Use PAGE_HYPERVISOR_* instead of MT_* when calling set_fixmap
authorJulien Grall <julien.grall@arm.com>
Mon, 9 Oct 2017 13:23:37 +0000 (14:23 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 10 Oct 2017 21:22:11 +0000 (14:22 -0700)
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>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/kernel.c
xen/arch/arm/mm.c
xen/arch/arm/platforms/vexpress.c
xen/drivers/video/arm_hdlcd.c

index a12baa86e76c63ef5cefdbbdede5e75f5a3ef470..c2755a9ab98af587211430b8b1496f1eb39c5243 100644 (file)
@@ -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);
 
index 39bade63f5abed18c2489a95452d98a7a4a0a8a1..70a03015eca247aca1c1468728c231f01c7872e5 100644 (file)
@@ -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);
index df2c4b5bec3b2739dd4b7ed53afeb9863c8da677..39b6bcc70ed1103b99cc9959fee7cbbadeaa6fe7 100644 (file)
@@ -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;
index 1175399dbc14bf7a400367745bcaa162fba21938..e1174b223f0351def722b091556ff03bb4908e62 100644 (file)
@@ -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;