diff options
author | venkatesh.pallipadi@intel.com <venkatesh.pallipadi@intel.com> | 2009-04-09 17:26:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-10 07:55:46 -0400 |
commit | a5593e0b329a14dea41ea173380dbf1533de2bd2 (patch) | |
tree | aa488fcab5e4327192a052f576b15db839124408 /arch/x86 | |
parent | 43a432b1559798d33970261f710030f787770231 (diff) |
x86, PAT: Change order of cpa and free in set_memory_wb
To be free of aliasing due to races, set_memory_* interfaces should
follow ordering of reserving, changing memtype to UC/WC, changing
memtype back to WB followed by free.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <20090409212708.512280000@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/mm/pageattr.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index d71e1b636ce6..d487eaa17bff 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -1021,15 +1021,19 @@ int _set_memory_wb(unsigned long addr, int numpages) | |||
1021 | 1021 | ||
1022 | int set_memory_wb(unsigned long addr, int numpages) | 1022 | int set_memory_wb(unsigned long addr, int numpages) |
1023 | { | 1023 | { |
1024 | int ret = _set_memory_wb(addr, numpages); | ||
1024 | free_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE); | 1025 | free_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE); |
1025 | 1026 | return ret; | |
1026 | return _set_memory_wb(addr, numpages); | ||
1027 | } | 1027 | } |
1028 | EXPORT_SYMBOL(set_memory_wb); | 1028 | EXPORT_SYMBOL(set_memory_wb); |
1029 | 1029 | ||
1030 | int set_memory_array_wb(unsigned long *addr, int addrinarray) | 1030 | int set_memory_array_wb(unsigned long *addr, int addrinarray) |
1031 | { | 1031 | { |
1032 | int i; | 1032 | int i; |
1033 | int ret; | ||
1034 | |||
1035 | ret = change_page_attr_clear(addr, addrinarray, | ||
1036 | __pgprot(_PAGE_CACHE_MASK), 1); | ||
1033 | 1037 | ||
1034 | for (i = 0; i < addrinarray; i++) { | 1038 | for (i = 0; i < addrinarray; i++) { |
1035 | unsigned long start = __pa(addr[i]); | 1039 | unsigned long start = __pa(addr[i]); |
@@ -1042,8 +1046,7 @@ int set_memory_array_wb(unsigned long *addr, int addrinarray) | |||
1042 | } | 1046 | } |
1043 | free_memtype(start, end); | 1047 | free_memtype(start, end); |
1044 | } | 1048 | } |
1045 | return change_page_attr_clear(addr, addrinarray, | 1049 | return ret; |
1046 | __pgprot(_PAGE_CACHE_MASK), 1); | ||
1047 | } | 1050 | } |
1048 | EXPORT_SYMBOL(set_memory_array_wb); | 1051 | EXPORT_SYMBOL(set_memory_array_wb); |
1049 | 1052 | ||