diff options
| author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-02-19 08:59:19 -0500 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-02-19 22:02:34 -0500 |
| commit | 3216dceb31c08be08ea98814a9ca5775fa680389 (patch) | |
| tree | 06f0ec957f047a01176b4514c03782fc923bd747 | |
| parent | e7e44e444876478d50630f57b0c31d29f6725020 (diff) | |
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>
| -rw-r--r-- | arch/arm/include/asm/xen/page.h | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/xen/page.h | 2 | ||||
| -rw-r--r-- | drivers/tty/hvc/hvc_xen.c | 2 | ||||
| -rw-r--r-- | drivers/xen/grant-table.c | 2 | ||||
| -rw-r--r-- | drivers/xen/xenbus/xenbus_probe.c | 2 |
5 files changed, 9 insertions, 3 deletions
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h index c6b9096cef95..30cdacb675af 100644 --- a/arch/arm/include/asm/xen/page.h +++ b/arch/arm/include/asm/xen/page.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _ASM_ARM_XEN_PAGE_H | 1 | #ifndef _ASM_ARM_XEN_PAGE_H |
| 2 | #define _ASM_ARM_XEN_PAGE_H | 2 | #define _ASM_ARM_XEN_PAGE_H |
| 3 | 3 | ||
| 4 | #include <asm/mach/map.h> | ||
| 4 | #include <asm/page.h> | 5 | #include <asm/page.h> |
| 5 | #include <asm/pgtable.h> | 6 | #include <asm/pgtable.h> |
| 6 | 7 | ||
| @@ -86,4 +87,7 @@ static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn) | |||
| 86 | { | 87 | { |
| 87 | return __set_phys_to_machine(pfn, mfn); | 88 | return __set_phys_to_machine(pfn, mfn); |
| 88 | } | 89 | } |
| 90 | |||
| 91 | #define xen_remap(cookie, size) __arm_ioremap((cookie), (size), MT_MEMORY); | ||
| 92 | |||
| 89 | #endif /* _ASM_ARM_XEN_PAGE_H */ | 93 | #endif /* _ASM_ARM_XEN_PAGE_H */ |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 472b9b783019..6aef9fbc09b7 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
| @@ -212,4 +212,6 @@ unsigned long arbitrary_virt_to_mfn(void *vaddr); | |||
| 212 | void make_lowmem_page_readonly(void *vaddr); | 212 | void make_lowmem_page_readonly(void *vaddr); |
| 213 | void make_lowmem_page_readwrite(void *vaddr); | 213 | void make_lowmem_page_readwrite(void *vaddr); |
| 214 | 214 | ||
| 215 | #define xen_remap(cookie, size) ioremap((cookie), (size)); | ||
| 216 | |||
| 215 | #endif /* _ASM_X86_XEN_PAGE_H */ | 217 | #endif /* _ASM_X86_XEN_PAGE_H */ |
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 19843ec3f80a..682210d778bd 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c | |||
| @@ -230,7 +230,7 @@ static int xen_hvm_console_init(void) | |||
| 230 | if (r < 0 || v == 0) | 230 | if (r < 0 || v == 0) |
| 231 | goto err; | 231 | goto err; |
| 232 | mfn = v; | 232 | mfn = v; |
| 233 | info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); | 233 | info->intf = xen_remap(mfn << PAGE_SHIFT, PAGE_SIZE); |
| 234 | if (info->intf == NULL) | 234 | if (info->intf == NULL) |
| 235 | goto err; | 235 | goto err; |
| 236 | info->vtermno = HVC_COOKIE; | 236 | info->vtermno = HVC_COOKIE; |
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 157c0ccda3ef..04c1b2d9b775 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
| @@ -1147,7 +1147,7 @@ static int gnttab_setup(void) | |||
| 1147 | return gnttab_map(0, nr_grant_frames - 1); | 1147 | return gnttab_map(0, nr_grant_frames - 1); |
| 1148 | 1148 | ||
| 1149 | if (gnttab_shared.addr == NULL) { | 1149 | if (gnttab_shared.addr == NULL) { |
| 1150 | gnttab_shared.addr = ioremap(xen_hvm_resume_frames, | 1150 | gnttab_shared.addr = xen_remap(xen_hvm_resume_frames, |
| 1151 | PAGE_SIZE * max_nr_gframes); | 1151 | PAGE_SIZE * max_nr_gframes); |
| 1152 | if (gnttab_shared.addr == NULL) { | 1152 | if (gnttab_shared.addr == NULL) { |
| 1153 | printk(KERN_WARNING | 1153 | printk(KERN_WARNING |
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 038b71dbf03c..3325884c693f 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
| @@ -769,7 +769,7 @@ static int __init xenbus_init(void) | |||
| 769 | goto out_error; | 769 | goto out_error; |
| 770 | xen_store_mfn = (unsigned long)v; | 770 | xen_store_mfn = (unsigned long)v; |
| 771 | xen_store_interface = | 771 | xen_store_interface = |
| 772 | ioremap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE); | 772 | xen_remap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE); |
| 773 | break; | 773 | break; |
| 774 | default: | 774 | default: |
| 775 | pr_warn("Xenstore state unknown\n"); | 775 | pr_warn("Xenstore state unknown\n"); |
