Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99497
b: refs/heads/master
c: dd0c7c4
h: refs/heads/master
i:
  99495: e1b23c9
v: v3
  • Loading branch information
Andreas Herrmann authored and Ingo Molnar committed Jun 19, 2008
1 parent 5565222 commit 1c40c8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6cf514fce18589ea1e0521c5f2d7c2bb280fefc7
refs/heads/master: dd0c7c4903c29da9aa3bf33deecf064d190a0d81
30 changes: 11 additions & 19 deletions trunk/arch/x86/mm/pat.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,29 +161,21 @@ static DEFINE_SPINLOCK(memtype_lock); /* protects memtype list */
*/
static unsigned long pat_x_mtrr_type(u64 start, u64 end, unsigned long req_type)
{
u8 mtrr_type;

/*
* We return the PAT request directly for types where PAT takes
* precedence with respect to MTRR and for UC_MINUS.
* Consistency checks with other PAT requests is done later
* while going through memtype list.
*/
if (req_type == _PAGE_CACHE_WC ||
req_type == _PAGE_CACHE_UC_MINUS ||
req_type == _PAGE_CACHE_UC)
return req_type;

/*
* Look for MTRR hint to get the effective type in case where PAT
* request is for WB.
*/
mtrr_type = mtrr_type_lookup(start, end);
if (mtrr_type == MTRR_TYPE_UNCACHABLE)
return _PAGE_CACHE_UC;
if (mtrr_type == MTRR_TYPE_WRCOMB)
return _PAGE_CACHE_WC;
return _PAGE_CACHE_WB;
if (req_type == _PAGE_CACHE_WB) {
u8 mtrr_type;

mtrr_type = mtrr_type_lookup(start, end);
if (mtrr_type == MTRR_TYPE_UNCACHABLE)
return _PAGE_CACHE_UC;
if (mtrr_type == MTRR_TYPE_WRCOMB)
return _PAGE_CACHE_WC;
}

return req_type;
}

/*
Expand Down

0 comments on commit 1c40c8a

Please sign in to comment.