aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 07:34:03 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:34:03 -0500
commit44136717e06b888c2d3129a80abf9ac79233f1eb (patch)
tree1607fbaef1a1909c0ccb41a245240744f9dd69a9
parentd9db847f29bec9957c53fbdc05d65c4286235005 (diff)
x86: 64-bit pageattr.c, prepare for unification
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/mm/pageattr_64.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c
index 34acbcd62eb8..190d4d37bc2f 100644
--- a/arch/x86/mm/pageattr_64.c
+++ b/arch/x86/mm/pageattr_64.c
@@ -123,14 +123,15 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
123{ 123{
124 int err = 0, kernel_map = 0, i; 124 int err = 0, kernel_map = 0, i;
125 125
126#ifdef CONFIG_X86_64
126 if (address >= __START_KERNEL_map && 127 if (address >= __START_KERNEL_map &&
127 address < __START_KERNEL_map + KERNEL_TEXT_SIZE) { 128 address < __START_KERNEL_map + KERNEL_TEXT_SIZE) {
128 129
129 address = (unsigned long)__va(__pa(address)); 130 address = (unsigned long)__va(__pa(address));
130 kernel_map = 1; 131 kernel_map = 1;
131 } 132 }
133#endif
132 134
133 down_write(&init_mm.mmap_sem);
134 for (i = 0; i < numpages; i++, address += PAGE_SIZE) { 135 for (i = 0; i < numpages; i++, address += PAGE_SIZE) {
135 unsigned long pfn = __pa(address) >> PAGE_SHIFT; 136 unsigned long pfn = __pa(address) >> PAGE_SHIFT;
136 137
@@ -139,8 +140,11 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
139 if (err) 140 if (err)
140 break; 141 break;
141 } 142 }
142 /* Handle kernel mapping too which aliases part of the 143#ifdef CONFIG_X86_64
143 * lowmem */ 144 /*
145 * Handle kernel mapping too which aliases part of
146 * lowmem:
147 */
144 if (__pa(address) < KERNEL_TEXT_SIZE) { 148 if (__pa(address) < KERNEL_TEXT_SIZE) {
145 unsigned long addr2; 149 unsigned long addr2;
146 pgprot_t prot2; 150 pgprot_t prot2;
@@ -150,8 +154,8 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
150 prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot))); 154 prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot)));
151 err = __change_page_attr(addr2, pfn_to_page(pfn), prot2); 155 err = __change_page_attr(addr2, pfn_to_page(pfn), prot2);
152 } 156 }
157#endif
153 } 158 }
154 up_write(&init_mm.mmap_sem);
155 159
156 return err; 160 return err;
157} 161}