diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/mm/pat.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index ac3a2b11eb38..227df3ca9bfd 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -161,29 +161,21 @@ static DEFINE_SPINLOCK(memtype_lock); /* protects memtype list */ | |||
161 | */ | 161 | */ |
162 | static unsigned long pat_x_mtrr_type(u64 start, u64 end, unsigned long req_type) | 162 | static unsigned long pat_x_mtrr_type(u64 start, u64 end, unsigned long req_type) |
163 | { | 163 | { |
164 | u8 mtrr_type; | ||
165 | |||
166 | /* | ||
167 | * We return the PAT request directly for types where PAT takes | ||
168 | * precedence with respect to MTRR and for UC_MINUS. | ||
169 | * Consistency checks with other PAT requests is done later | ||
170 | * while going through memtype list. | ||
171 | */ | ||
172 | if (req_type == _PAGE_CACHE_WC || | ||
173 | req_type == _PAGE_CACHE_UC_MINUS || | ||
174 | req_type == _PAGE_CACHE_UC) | ||
175 | return req_type; | ||
176 | |||
177 | /* | 164 | /* |
178 | * Look for MTRR hint to get the effective type in case where PAT | 165 | * Look for MTRR hint to get the effective type in case where PAT |
179 | * request is for WB. | 166 | * request is for WB. |
180 | */ | 167 | */ |
181 | mtrr_type = mtrr_type_lookup(start, end); | 168 | if (req_type == _PAGE_CACHE_WB) { |
182 | if (mtrr_type == MTRR_TYPE_UNCACHABLE) | 169 | u8 mtrr_type; |
183 | return _PAGE_CACHE_UC; | 170 | |
184 | if (mtrr_type == MTRR_TYPE_WRCOMB) | 171 | mtrr_type = mtrr_type_lookup(start, end); |
185 | return _PAGE_CACHE_WC; | 172 | if (mtrr_type == MTRR_TYPE_UNCACHABLE) |
186 | return _PAGE_CACHE_WB; | 173 | return _PAGE_CACHE_UC; |
174 | if (mtrr_type == MTRR_TYPE_WRCOMB) | ||
175 | return _PAGE_CACHE_WC; | ||
176 | } | ||
177 | |||
178 | return req_type; | ||
187 | } | 179 | } |
188 | 180 | ||
189 | /* | 181 | /* |