Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82909
b: refs/heads/master
c: f07333f
h: refs/heads/master
i:
  82907: 5c679ae
v: v3
  • Loading branch information
Andi Kleen authored and Ingo Molnar committed Feb 4, 2008
1 parent 5e321e2 commit 2223263
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 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: b5360222273cb3e57a119c18eef42f59da4da87b
refs/heads/master: f07333fd149eb6826da26a89c3aff90324f270b0
17 changes: 15 additions & 2 deletions trunk/arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,12 @@ static int try_preserve_large_page(pte_t *kpte, unsigned long address,
psize = PMD_PAGE_SIZE;
pmask = PMD_PAGE_MASK;
break;
#ifdef CONFIG_X86_64
case PG_LEVEL_1G:
psize = PMD_PAGE_SIZE;
pmask = PMD_PAGE_MASK;
break;
#endif
default:
res = -EINVAL;
goto out_unlock;
Expand Down Expand Up @@ -343,7 +348,7 @@ static int split_large_page(pte_t *kpte, unsigned long address)
{
pgprot_t ref_prot;
gfp_t gfp_flags = GFP_KERNEL;
unsigned long flags, addr, pfn;
unsigned long flags, addr, pfn, pfninc = 1;
pte_t *pbase, *tmp;
struct page *base;
unsigned int i, level;
Expand Down Expand Up @@ -372,11 +377,19 @@ static int split_large_page(pte_t *kpte, unsigned long address)
#endif
ref_prot = pte_pgprot(pte_clrhuge(*kpte));

#ifdef CONFIG_X86_64
if (level == PG_LEVEL_1G) {
pfninc = PMD_PAGE_SIZE >> PAGE_SHIFT;
pgprot_val(ref_prot) |= _PAGE_PSE;
addr &= PUD_PAGE_MASK;
}
#endif

/*
* Get the target pfn from the original entry:
*/
pfn = pte_pfn(*kpte);
for (i = 0; i < PTRS_PER_PTE; i++, pfn++)
for (i = 0; i < PTRS_PER_PTE; i++, pfn += pfninc)
set_pte(&pbase[i], pfn_pte(pfn, ref_prot));

/*
Expand Down

0 comments on commit 2223263

Please sign in to comment.