aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/pageattr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 6c55fbdbd7e8..a629cea5e465 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -221,8 +221,7 @@ static int split_large_page(pte_t *kpte, unsigned long address)
221{ 221{
222 pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte)); 222 pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte));
223 gfp_t gfp_flags = GFP_KERNEL; 223 gfp_t gfp_flags = GFP_KERNEL;
224 unsigned long flags; 224 unsigned long flags, addr, pfn;
225 unsigned long addr;
226 pte_t *pbase, *tmp; 225 pte_t *pbase, *tmp;
227 struct page *base; 226 struct page *base;
228 unsigned int i, level; 227 unsigned int i, level;
@@ -253,8 +252,12 @@ static int split_large_page(pte_t *kpte, unsigned long address)
253 paravirt_alloc_pt(&init_mm, page_to_pfn(base)); 252 paravirt_alloc_pt(&init_mm, page_to_pfn(base));
254#endif 253#endif
255 254
256 for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) 255 /*
257 set_pte(&pbase[i], pfn_pte(addr >> PAGE_SHIFT, ref_prot)); 256 * Get the target pfn from the original entry:
257 */
258 pfn = pte_pfn(*kpte);
259 for (i = 0; i < PTRS_PER_PTE; i++, pfn++)
260 set_pte(&pbase[i], pfn_pte(pfn, ref_prot));
258 261
259 /* 262 /*
260 * Install the new, split up pagetable. Important detail here: 263 * Install the new, split up pagetable. Important detail here: