Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99500
b: refs/heads/master
c: 69e26be
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Herrmann authored and Ingo Molnar committed Jun 24, 2008
1 parent ebf4a29 commit b40d909
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 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: ac97991ec9e0a05c8860f4a04f8477227b1c03f2
refs/heads/master: 69e26be9b1d0c83d3581475095ce2a1ccc578215
21 changes: 8 additions & 13 deletions trunk/arch/x86/mm/pat.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
unsigned long actual_type;
int err = 0;

/* Only track when pat_enabled */
BUG_ON(start >= end); /* end is exclusive */

if (!pat_enabled) {
/* This is identical to page table setting without PAT */
if (new_type) {
Expand Down Expand Up @@ -228,17 +229,13 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
*/
u8 mtrr_type = mtrr_type_lookup(start, end);

if (mtrr_type == MTRR_TYPE_WRBACK) {
req_type = _PAGE_CACHE_WB;
if (mtrr_type == MTRR_TYPE_WRBACK)
actual_type = _PAGE_CACHE_WB;
} else {
req_type = _PAGE_CACHE_UC_MINUS;
else
actual_type = _PAGE_CACHE_UC_MINUS;
}
} else {
req_type &= _PAGE_CACHE_MASK;
actual_type = pat_x_mtrr_type(start, end, req_type);
}
} else
actual_type = pat_x_mtrr_type(start, end,
req_type & _PAGE_CACHE_MASK);

new = kmalloc(sizeof(struct memtype), GFP_KERNEL);
if (!new)
Expand Down Expand Up @@ -406,10 +403,8 @@ int free_memtype(u64 start, u64 end)
struct memtype *entry;
int err = -EINVAL;

/* Only track when pat_enabled */
if (!pat_enabled) {
if (!pat_enabled)
return 0;
}

/* Low ISA region is always mapped WB. No need to track */
if (is_ISA_range(start, end - 1))
Expand Down

0 comments on commit b40d909

Please sign in to comment.