Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80486
b: refs/heads/master
c: 4413671
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Jan 30, 2008
1 parent 938fb93 commit 4f79228
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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: d9db847f29bec9957c53fbdc05d65c4286235005
refs/heads/master: 44136717e06b888c2d3129a80abf9ac79233f1eb
12 changes: 8 additions & 4 deletions trunk/arch/x86/mm/pageattr_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
{
int err = 0, kernel_map = 0, i;

#ifdef CONFIG_X86_64
if (address >= __START_KERNEL_map &&
address < __START_KERNEL_map + KERNEL_TEXT_SIZE) {

address = (unsigned long)__va(__pa(address));
kernel_map = 1;
}
#endif

down_write(&init_mm.mmap_sem);
for (i = 0; i < numpages; i++, address += PAGE_SIZE) {
unsigned long pfn = __pa(address) >> PAGE_SHIFT;

Expand All @@ -139,8 +140,11 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
if (err)
break;
}
/* Handle kernel mapping too which aliases part of the
* lowmem */
#ifdef CONFIG_X86_64
/*
* Handle kernel mapping too which aliases part of
* lowmem:
*/
if (__pa(address) < KERNEL_TEXT_SIZE) {
unsigned long addr2;
pgprot_t prot2;
Expand All @@ -150,8 +154,8 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot)));
err = __change_page_attr(addr2, pfn_to_page(pfn), prot2);
}
#endif
}
up_write(&init_mm.mmap_sem);

return err;
}
Expand Down

0 comments on commit 4f79228

Please sign in to comment.