diff options
author | Huang, Ying <ying.huang@intel.com> | 2008-01-30 07:34:04 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:04 -0500 |
commit | 1c17f4d615f34a4ecfcf9132d643126b226f5e79 (patch) | |
tree | f621a6370b60a48a62b52e49f38d8b8f6f6b3590 /arch | |
parent | d2e626f45cc450c00f5f98a89b8b4c4ac3c9bf5f (diff) |
x86: ioremap_nocache fix
This patch fixes a bug of ioremap_nocache. ioremap_nocache() will call
__ioremap() with flags != 0 to do the real work, which will call
change_page_attr_addr() if phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT).
But some pages between 0 ~ end_pfn_map << PAGE_SHIFT are not mapped by
identity map, this will make change_page_attr_addr failed.
This patch is based on latest x86 git and has been tested on x86_64 platform.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/mm/ioremap_64.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/mm/ioremap_64.c b/arch/x86/mm/ioremap_64.c index 2815ab60009b..0a05f024dc22 100644 --- a/arch/x86/mm/ioremap_64.c +++ b/arch/x86/mm/ioremap_64.c | |||
@@ -41,8 +41,15 @@ ioremap_change_attr(unsigned long phys_addr, unsigned long size, | |||
41 | if (phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) { | 41 | if (phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) { |
42 | unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | 42 | unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; |
43 | unsigned long vaddr = (unsigned long) __va(phys_addr); | 43 | unsigned long vaddr = (unsigned long) __va(phys_addr); |
44 | int level; | ||
44 | 45 | ||
45 | /* | 46 | /* |
47 | * If there is no identity map for this address, | ||
48 | * change_page_attr_addr is unnecessary | ||
49 | */ | ||
50 | if (!lookup_address(vaddr, &level)) | ||
51 | return err; | ||
52 | /* | ||
46 | * Must use a address here and not struct page because the phys addr | 53 | * Must use a address here and not struct page because the phys addr |
47 | * can be a in hole between nodes and not have an memmap entry. | 54 | * can be a in hole between nodes and not have an memmap entry. |
48 | */ | 55 | */ |