lkml.org 
[lkml]   [2015]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 6/7] x86, mm: Support huge I/O mappings on x86
Date
Implement huge I/O mapping capability interfaces on x86.

Also define IOREMAP_MAX_ORDER to the size of PUD or PMD on x86.
When IOREMAP_MAX_ORDER is not defined on x86, it will be defined
to the default value in <linux/vmalloc.h>.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
arch/x86/include/asm/page_types.h | 8 ++++++++
arch/x86/mm/ioremap.c | 16 ++++++++++++++++
2 files changed, 24 insertions(+)

diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
index f97fbe3..debbfff 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -38,6 +38,14 @@

#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)

+#ifdef CONFIG_HUGE_IOMAP
+#ifdef CONFIG_X86_64
+#define IOREMAP_MAX_ORDER (PUD_SHIFT)
+#elif defined(PMD_SHIFT)
+#define IOREMAP_MAX_ORDER (PMD_SHIFT)
+#endif
+#endif /* CONFIG_HUGE_IOMAP */
+
#ifdef CONFIG_X86_64
#include <asm/page_64_types.h>
#else
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index fdf617c..ef32bec 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -326,6 +326,22 @@ void iounmap(volatile void __iomem *addr)
}
EXPORT_SYMBOL(iounmap);

+#ifdef CONFIG_HUGE_IOMAP
+int arch_ioremap_pud_supported(void)
+{
+#ifdef CONFIG_X86_64
+ return cpu_has_gbpages;
+#else
+ return 0;
+#endif
+}
+
+int arch_ioremap_pmd_supported(void)
+{
+ return cpu_has_pse;
+}
+#endif /* CONFIG_HUGE_IOMAP */
+
/*
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
* access

\
 
 \ /
  Last update: 2015-01-27 00:41    [W:0.154 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site