xen: replace xen_remap() with memremap()
xen_remap() is used to establish mappings for frames not under direct control of the kernel: for Xenstore and console ring pages, and for grant pages of non-PV guests. Today xen_remap() is defined to use ioremap() on x86 (doing uncached mappings), and ioremap_cache() on Arm (doing cached mappings). Uncached mappings for those use cases are bad for performance, so they should be avoided if possible. As all use cases of xen_remap() don't require uncached mappings (the mapped area is always physical RAM), a mapping using the standard WB cache mode is fine. As sparse is flagging some of the xen_remap() use cases to be not appropriate for iomem(), as the result is not annotated with the __iomem modifier, eliminate xen_remap() completely and replace all use cases with memremap() specifying the MEMREMAP_WB caching mode. xen_unmap() can be replaced with memunmap(). Reported-by:kernel test robot <lkp@intel.com> Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by:
Stefano Stabellini <sstabellini@kernel.org> Link: https://lore.kernel.org/r/20220530082634.6339-1-jgross@suse.com Signed-off-by:
Juergen Gross <jgross@suse.com>
Showing
- arch/x86/include/asm/xen/page.h 0 additions, 3 deletionsarch/x86/include/asm/xen/page.h
- drivers/tty/hvc/hvc_xen.c 1 addition, 1 deletiondrivers/tty/hvc/hvc_xen.c
- drivers/xen/grant-table.c 3 additions, 3 deletionsdrivers/xen/grant-table.c
- drivers/xen/xenbus/xenbus_probe.c 4 additions, 4 deletionsdrivers/xen/xenbus/xenbus_probe.c
- include/xen/arm/page.h 0 additions, 3 deletionsinclude/xen/arm/page.h
Loading
Please register or sign in to comment