Skip to content

Commit

Permalink
x86: PAT proper tracking of set_memory_uc and friends
Browse files Browse the repository at this point in the history
Big thinko in pat memtype tracking code. reserve_memtype should be called
with physical address and not virtual address.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
venkatesh.pallipadi@intel.com authored and Ingo Molnar committed Aug 21, 2008
1 parent b2a6a58 commit c15238d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ int set_memory_uc(unsigned long addr, int numpages)
/*
* for now UC MINUS. see comments in ioremap_nocache()
*/
if (reserve_memtype(addr, addr + numpages * PAGE_SIZE,
if (reserve_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE,
_PAGE_CACHE_UC_MINUS, NULL))
return -EINVAL;

Expand All @@ -868,7 +868,7 @@ int set_memory_wc(unsigned long addr, int numpages)
if (!pat_enabled)
return set_memory_uc(addr, numpages);

if (reserve_memtype(addr, addr + numpages * PAGE_SIZE,
if (reserve_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE,
_PAGE_CACHE_WC, NULL))
return -EINVAL;

Expand All @@ -884,7 +884,7 @@ int _set_memory_wb(unsigned long addr, int numpages)

int set_memory_wb(unsigned long addr, int numpages)
{
free_memtype(addr, addr + numpages * PAGE_SIZE);
free_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE);

return _set_memory_wb(addr, numpages);
}
Expand Down

0 comments on commit c15238d

Please sign in to comment.