Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156224
b: refs/heads/master
c: 8523acf
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Hellstrom authored and Ingo Molnar committed Aug 3, 2009
1 parent 72a363a commit f5643f4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 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: bdc6340f4eb68295b1e7c0ade2356b56dca93d93
refs/heads/master: 8523acfe40efc1a8d3da8f473ca67cb195b06f0c
30 changes: 21 additions & 9 deletions trunk/arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,12 @@ static int __change_page_attr(struct cpa_data *cpa, int primary)
unsigned int level;
pte_t *kpte, old_pte;

if (cpa->flags & CPA_PAGES_ARRAY)
address = (unsigned long)page_address(cpa->pages[cpa->curpage]);
else if (cpa->flags & CPA_ARRAY)
if (cpa->flags & CPA_PAGES_ARRAY) {
struct page *page = cpa->pages[cpa->curpage];
if (unlikely(PageHighMem(page)))
return 0;
address = (unsigned long)page_address(page);
} else if (cpa->flags & CPA_ARRAY)
address = cpa->vaddr[cpa->curpage];
else
address = *cpa->vaddr;
Expand Down Expand Up @@ -697,9 +700,12 @@ static int cpa_process_alias(struct cpa_data *cpa)
* No need to redo, when the primary call touched the direct
* mapping already:
*/
if (cpa->flags & CPA_PAGES_ARRAY)
vaddr = (unsigned long)page_address(cpa->pages[cpa->curpage]);
else if (cpa->flags & CPA_ARRAY)
if (cpa->flags & CPA_PAGES_ARRAY) {
struct page *page = cpa->pages[cpa->curpage];
if (unlikely(PageHighMem(page)))
return 0;
vaddr = (unsigned long)page_address(page);
} else if (cpa->flags & CPA_ARRAY)
vaddr = cpa->vaddr[cpa->curpage];
else
vaddr = *cpa->vaddr;
Expand Down Expand Up @@ -1122,7 +1128,9 @@ int set_pages_array_uc(struct page **pages, int addrinarray)
int free_idx;

for (i = 0; i < addrinarray; i++) {
start = (unsigned long)page_address(pages[i]);
if (PageHighMem(pages[i]))
continue;
start = page_to_pfn(pages[i]) << PAGE_SHIFT;
end = start + PAGE_SIZE;
if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL))
goto err_out;
Expand All @@ -1135,7 +1143,9 @@ int set_pages_array_uc(struct page **pages, int addrinarray)
err_out:
free_idx = i;
for (i = 0; i < free_idx; i++) {
start = (unsigned long)page_address(pages[i]);
if (PageHighMem(pages[i]))
continue;
start = page_to_pfn(pages[i]) << PAGE_SHIFT;
end = start + PAGE_SIZE;
free_memtype(start, end);
}
Expand Down Expand Up @@ -1164,7 +1174,9 @@ int set_pages_array_wb(struct page **pages, int addrinarray)
return retval;

for (i = 0; i < addrinarray; i++) {
start = (unsigned long)page_address(pages[i]);
if (PageHighMem(pages[i]))
continue;
start = page_to_pfn(pages[i]) << PAGE_SHIFT;
end = start + PAGE_SIZE;
free_memtype(start, end);
}
Expand Down

0 comments on commit f5643f4

Please sign in to comment.