Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3216dceb authored by Stefano Stabellini's avatar Stefano Stabellini Committed by Konrad Rzeszutek Wilk
Browse files

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: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent e7e44e44
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
#ifndef _ASM_ARM_XEN_PAGE_H
#define _ASM_ARM_XEN_PAGE_H

#include <asm/mach/map.h>
#include <asm/page.h>
#include <asm/pgtable.h>

@@ -86,4 +87,7 @@ static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
{
	return __set_phys_to_machine(pfn, mfn);
}

#define xen_remap(cookie, size) __arm_ioremap((cookie), (size), MT_MEMORY);

#endif /* _ASM_ARM_XEN_PAGE_H */
+2 −0
Original line number Diff line number Diff line
@@ -212,4 +212,6 @@ unsigned long arbitrary_virt_to_mfn(void *vaddr);
void make_lowmem_page_readonly(void *vaddr);
void make_lowmem_page_readwrite(void *vaddr);

#define xen_remap(cookie, size) ioremap((cookie), (size));

#endif /* _ASM_X86_XEN_PAGE_H */
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ static int xen_hvm_console_init(void)
	if (r < 0 || v == 0)
		goto err;
	mfn = v;
	info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE);
	info->intf = xen_remap(mfn << PAGE_SHIFT, PAGE_SIZE);
	if (info->intf == NULL)
		goto err;
	info->vtermno = HVC_COOKIE;
+1 −1
Original line number Diff line number Diff line
@@ -1147,7 +1147,7 @@ static int gnttab_setup(void)
		return gnttab_map(0, nr_grant_frames - 1);

	if (gnttab_shared.addr == NULL) {
		gnttab_shared.addr = ioremap(xen_hvm_resume_frames,
		gnttab_shared.addr = xen_remap(xen_hvm_resume_frames,
						PAGE_SIZE * max_nr_gframes);
		if (gnttab_shared.addr == NULL) {
			printk(KERN_WARNING
+1 −1
Original line number Diff line number Diff line
@@ -769,7 +769,7 @@ static int __init xenbus_init(void)
			goto out_error;
		xen_store_mfn = (unsigned long)v;
		xen_store_interface =
			ioremap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE);
			xen_remap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE);
		break;
	default:
		pr_warn("Xenstore state unknown\n");