x86: {reverve,free}_memtype() take a physical address
authorRene Herman <rene.herman@keyaccess.nl>
Thu, 21 Aug 2008 22:10:13 +0000 (00:10 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 22 Aug 2008 04:07:32 +0000 (06:07 +0200)
The new set_memory_array_{uc,wb}() pass virtual addresses to
{reserve,free}_memtype() it seems.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/pageattr.c

index 1785591808bd590b446987b78518acfb91f087be..fed6ba2a8e7e77e0e63e4c956cb5400c28254e40 100644 (file)
@@ -947,7 +947,7 @@ int set_memory_array_uc(unsigned long *addr, int addrinarray)
         * for now UC MINUS. see comments in ioremap_nocache()
         */
        for (i = 0; i < addrinarray; i++) {
-               if (reserve_memtype(addr[i], addr[i] + PAGE_SIZE,
+               if (reserve_memtype(__pa(addr[i]), __pa(addr[i]) + PAGE_SIZE,
                            _PAGE_CACHE_UC_MINUS, NULL))
                        goto out;
        }
@@ -956,7 +956,7 @@ int set_memory_array_uc(unsigned long *addr, int addrinarray)
                                    __pgprot(_PAGE_CACHE_UC_MINUS), 1);
 out:
        while (--i >= 0)
-               free_memtype(addr[i], addr[i] + PAGE_SIZE);
+               free_memtype(__pa(addr[i]), __pa(addr[i]) + PAGE_SIZE);
        return -EINVAL;
 }
 EXPORT_SYMBOL(set_memory_array_uc);
@@ -998,7 +998,7 @@ int set_memory_array_wb(unsigned long *addr, int addrinarray)
 {
        int i;
        for (i = 0; i < addrinarray; i++)
-               free_memtype(addr[i], addr[i] + PAGE_SIZE);
+               free_memtype(__pa(addr[i]), __pa(addr[i]) + PAGE_SIZE);
 
        return change_page_attr_clear(addr, addrinarray,
                                      __pgprot(_PAGE_CACHE_MASK), 1);