Skip to content

Commit 3216dce

Browse files
Stefano Stabellinikonradwilk
authored andcommitted
xen: introduce xen_remap, use it instead of ioremap
ioremap can't be used to map ring pages on ARM because it uses device memory caching attributes (MT_DEVICE*). Introduce a Xen specific abstraction to map ring pages, called xen_remap, that is defined as ioremap on x86 (no behavioral changes). On ARM it explicitly calls __arm_ioremap with the right caching attributes: MT_MEMORY. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
1 parent e7e44e4 commit 3216dce

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

arch/arm/include/asm/xen/page.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _ASM_ARM_XEN_PAGE_H
22
#define _ASM_ARM_XEN_PAGE_H
33

4+
#include <asm/mach/map.h>
45
#include <asm/page.h>
56
#include <asm/pgtable.h>
67

@@ -86,4 +87,7 @@ static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
8687
{
8788
return __set_phys_to_machine(pfn, mfn);
8889
}
90+
91+
#define xen_remap(cookie, size) __arm_ioremap((cookie), (size), MT_MEMORY);
92+
8993
#endif /* _ASM_ARM_XEN_PAGE_H */

arch/x86/include/asm/xen/page.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,6 @@ unsigned long arbitrary_virt_to_mfn(void *vaddr);
212212
void make_lowmem_page_readonly(void *vaddr);
213213
void make_lowmem_page_readwrite(void *vaddr);
214214

215+
#define xen_remap(cookie, size) ioremap((cookie), (size));
216+
215217
#endif /* _ASM_X86_XEN_PAGE_H */

drivers/tty/hvc/hvc_xen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int xen_hvm_console_init(void)
230230
if (r < 0 || v == 0)
231231
goto err;
232232
mfn = v;
233-
info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE);
233+
info->intf = xen_remap(mfn << PAGE_SHIFT, PAGE_SIZE);
234234
if (info->intf == NULL)
235235
goto err;
236236
info->vtermno = HVC_COOKIE;

drivers/xen/grant-table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ static int gnttab_setup(void)
11471147
return gnttab_map(0, nr_grant_frames - 1);
11481148

11491149
if (gnttab_shared.addr == NULL) {
1150-
gnttab_shared.addr = ioremap(xen_hvm_resume_frames,
1150+
gnttab_shared.addr = xen_remap(xen_hvm_resume_frames,
11511151
PAGE_SIZE * max_nr_gframes);
11521152
if (gnttab_shared.addr == NULL) {
11531153
printk(KERN_WARNING

drivers/xen/xenbus/xenbus_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ static int __init xenbus_init(void)
769769
goto out_error;
770770
xen_store_mfn = (unsigned long)v;
771771
xen_store_interface =
772-
ioremap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE);
772+
xen_remap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE);
773773
break;
774774
default:
775775
pr_warn("Xenstore state unknown\n");

0 commit comments

Comments
 (0)