diff options
-rw-r--r-- | arch/x86/mm/init_64.c | 9 | ||||
-rw-r--r-- | arch/x86/mm/pgtable.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/pgtable_32.c | 6 | ||||
-rw-r--r-- | include/asm-x86/pgtable.h | 3 |
4 files changed, 11 insertions, 9 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e5f531949857..74fae8335128 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -135,15 +135,15 @@ static __init void *spp_getpage(void) | |||
135 | return ptr; | 135 | return ptr; |
136 | } | 136 | } |
137 | 137 | ||
138 | static void | 138 | void |
139 | set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) | 139 | set_pte_vaddr(unsigned long vaddr, pte_t new_pte) |
140 | { | 140 | { |
141 | pgd_t *pgd; | 141 | pgd_t *pgd; |
142 | pud_t *pud; | 142 | pud_t *pud; |
143 | pmd_t *pmd; | 143 | pmd_t *pmd; |
144 | pte_t *pte, new_pte; | 144 | pte_t *pte; |
145 | 145 | ||
146 | pr_debug("set_pte_phys %lx to %lx\n", vaddr, phys); | 146 | pr_debug("set_pte_vaddr %lx to %lx\n", vaddr, native_pte_val(new_pte)); |
147 | 147 | ||
148 | pgd = pgd_offset_k(vaddr); | 148 | pgd = pgd_offset_k(vaddr); |
149 | if (pgd_none(*pgd)) { | 149 | if (pgd_none(*pgd)) { |
@@ -170,7 +170,6 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) | |||
170 | return; | 170 | return; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | new_pte = pfn_pte(phys >> PAGE_SHIFT, prot); | ||
174 | 173 | ||
175 | pte = pte_offset_kernel(pmd, vaddr); | 174 | pte = pte_offset_kernel(pmd, vaddr); |
176 | if (!pte_none(*pte) && pte_val(new_pte) && | 175 | if (!pte_none(*pte) && pte_val(new_pte) && |
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 3ebebe480b53..7498124e30fc 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -285,6 +285,6 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags) | |||
285 | BUG(); | 285 | BUG(); |
286 | return; | 286 | return; |
287 | } | 287 | } |
288 | set_pte_pfn(address, phys >> PAGE_SHIFT, flags); | 288 | set_pte_vaddr(address, pfn_pte(phys >> PAGE_SHIFT, flags)); |
289 | fixmaps_set++; | 289 | fixmaps_set++; |
290 | } | 290 | } |
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c index 3f97c3c87288..0662f345212f 100644 --- a/arch/x86/mm/pgtable_32.c +++ b/arch/x86/mm/pgtable_32.c | |||
@@ -71,7 +71,7 @@ void show_mem(void) | |||
71 | * Associate a virtual page frame with a given physical page frame | 71 | * Associate a virtual page frame with a given physical page frame |
72 | * and protection flags for that frame. | 72 | * and protection flags for that frame. |
73 | */ | 73 | */ |
74 | static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) | 74 | void set_pte_vaddr(unsigned long vaddr, pte_t pteval) |
75 | { | 75 | { |
76 | pgd_t *pgd; | 76 | pgd_t *pgd; |
77 | pud_t *pud; | 77 | pud_t *pud; |
@@ -94,8 +94,8 @@ static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) | |||
94 | return; | 94 | return; |
95 | } | 95 | } |
96 | pte = pte_offset_kernel(pmd, vaddr); | 96 | pte = pte_offset_kernel(pmd, vaddr); |
97 | if (pgprot_val(flags)) | 97 | if (pte_val(pteval)) |
98 | set_pte_present(&init_mm, vaddr, pte, pfn_pte(pfn, flags)); | 98 | set_pte_present(&init_mm, vaddr, pte, pteval); |
99 | else | 99 | else |
100 | pte_clear(&init_mm, vaddr, pte); | 100 | pte_clear(&init_mm, vaddr, pte); |
101 | 101 | ||
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index 97c271b2910b..702f2699c6df 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
@@ -318,6 +318,9 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
318 | unsigned long size, pgprot_t *vma_prot); | 318 | unsigned long size, pgprot_t *vma_prot); |
319 | #endif | 319 | #endif |
320 | 320 | ||
321 | /* Install a pte for a particular vaddr in kernel space. */ | ||
322 | void set_pte_vaddr(unsigned long vaddr, pte_t pte); | ||
323 | |||
321 | #ifdef CONFIG_PARAVIRT | 324 | #ifdef CONFIG_PARAVIRT |
322 | #include <asm/paravirt.h> | 325 | #include <asm/paravirt.h> |
323 | #else /* !CONFIG_PARAVIRT */ | 326 | #else /* !CONFIG_PARAVIRT */ |