Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82897
b: refs/heads/master
c: 07cf89c
h: refs/heads/master
i:
  82895: 9a2d723
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Feb 4, 2008
1 parent ca3b243 commit 5b20742
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: 31422c51e0dc72532d82e80895932d430c3ed307
refs/heads/master: 07cf89c05f2bbafa002401ac4e09ac31678513e4
10 changes: 7 additions & 3 deletions trunk/arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,14 @@ static int try_preserve_large_page(pte_t *kpte, unsigned long address,

static int split_large_page(pte_t *kpte, unsigned long address)
{
pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte));
pgprot_t ref_prot;
gfp_t gfp_flags = GFP_KERNEL;
unsigned long flags, addr, pfn;
pte_t *pbase, *tmp;
struct page *base;
unsigned int i, level;

#ifdef CONFIG_DEBUG_PAGEALLOC
gfp_flags = __GFP_HIGH | __GFP_NOFAIL | __GFP_NOWARN;
gfp_flags = GFP_ATOMIC | __GFP_NOWARN;
#endif
base = alloc_pages(gfp_flags, 0);
Expand All @@ -368,6 +367,7 @@ static int split_large_page(pte_t *kpte, unsigned long address)
#ifdef CONFIG_X86_32
paravirt_alloc_pt(&init_mm, page_to_pfn(base));
#endif
ref_prot = pte_pgprot(pte_clrhuge(*kpte));

/*
* Get the target pfn from the original entry:
Expand All @@ -377,13 +377,17 @@ static int split_large_page(pte_t *kpte, unsigned long address)
set_pte(&pbase[i], pfn_pte(pfn, ref_prot));

/*
* Install the new, split up pagetable. Important detail here:
* Install the new, split up pagetable. Important details here:
*
* On Intel the NX bit of all levels must be cleared to make a
* page executable. See section 4.13.2 of Intel 64 and IA-32
* Architectures Software Developer's Manual).
*
* Mark the entry present. The current mapping might be
* set to not present, which we preserved above.
*/
ref_prot = pte_pgprot(pte_mkexec(pte_clrhuge(*kpte)));
pgprot_val(ref_prot) |= _PAGE_PRESENT;
__set_pmd_pte(kpte, address, mk_pte(base, ref_prot));
base = NULL;

Expand Down

0 comments on commit 5b20742

Please sign in to comment.