aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/pageattr.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 968398b023c0..2a1308a8c072 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -686,7 +686,27 @@ static int alloc_pmd_page(pud_t *pud)
686 return 0; 686 return 0;
687} 687}
688 688
689#define populate_pte(cpa, start, end, pages, pmd, pgprot) do {} while (0) 689static void populate_pte(struct cpa_data *cpa,
690 unsigned long start, unsigned long end,
691 unsigned num_pages, pmd_t *pmd, pgprot_t pgprot)
692{
693 pte_t *pte;
694
695 pte = pte_offset_kernel(pmd, start);
696
697 while (num_pages-- && start < end) {
698
699 /* deal with the NX bit */
700 if (!(pgprot_val(pgprot) & _PAGE_NX))
701 cpa->pfn &= ~_PAGE_NX;
702
703 set_pte(pte, pfn_pte(cpa->pfn >> PAGE_SHIFT, pgprot));
704
705 start += PAGE_SIZE;
706 cpa->pfn += PAGE_SIZE;
707 pte++;
708 }
709}
690 710
691static int populate_pmd(struct cpa_data *cpa, 711static int populate_pmd(struct cpa_data *cpa,
692 unsigned long start, unsigned long end, 712 unsigned long start, unsigned long end,