diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-01-30 07:33:13 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:13 -0500 |
commit | fdfe8aa84dd78cfdff427d0520f5974fb5e9c220 (patch) | |
tree | 0d9ee510fa3bc5652e345bec5fb5ffd66010ca97 /arch/x86/mm/fault_64.c | |
parent | 6f4d368ef9e9f91aa0019c11e90773ea32d94625 (diff) |
x86: function ifdefs in fault_32|64.c
Add caller of is_errata93() to X86_32, ifdef'd to do
nothing.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/fault_64.c')
-rw-r--r-- | arch/x86/mm/fault_64.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/arch/x86/mm/fault_64.c b/arch/x86/mm/fault_64.c index c48d95c306df..75b7b165bdf3 100644 --- a/arch/x86/mm/fault_64.c +++ b/arch/x86/mm/fault_64.c | |||
@@ -223,6 +223,7 @@ KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n" | |||
223 | KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n" | 223 | KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n" |
224 | KERN_ERR "******* Please consider a BIOS update.\n" | 224 | KERN_ERR "******* Please consider a BIOS update.\n" |
225 | KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n"; | 225 | KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n"; |
226 | #endif | ||
226 | 227 | ||
227 | /* Workaround for K8 erratum #93 & buggy BIOS. | 228 | /* Workaround for K8 erratum #93 & buggy BIOS. |
228 | BIOS SMM functions are required to use a specific workaround | 229 | BIOS SMM functions are required to use a specific workaround |
@@ -230,10 +231,12 @@ KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n"; | |||
230 | A lot of BIOS that didn't get tested properly miss this. | 231 | A lot of BIOS that didn't get tested properly miss this. |
231 | The OS sees this as a page fault with the upper 32bits of RIP cleared. | 232 | The OS sees this as a page fault with the upper 32bits of RIP cleared. |
232 | Try to work around it here. | 233 | Try to work around it here. |
233 | Note we only handle faults in kernel here. */ | 234 | Note we only handle faults in kernel here. |
234 | 235 | Does nothing for X86_32 | |
236 | */ | ||
235 | static int is_errata93(struct pt_regs *regs, unsigned long address) | 237 | static int is_errata93(struct pt_regs *regs, unsigned long address) |
236 | { | 238 | { |
239 | #ifdef CONFIG_X86_64 | ||
237 | static int warned; | 240 | static int warned; |
238 | if (address != regs->ip) | 241 | if (address != regs->ip) |
239 | return 0; | 242 | return 0; |
@@ -249,9 +252,9 @@ static int is_errata93(struct pt_regs *regs, unsigned long address) | |||
249 | regs->ip = address; | 252 | regs->ip = address; |
250 | return 1; | 253 | return 1; |
251 | } | 254 | } |
255 | #endif | ||
252 | return 0; | 256 | return 0; |
253 | } | 257 | } |
254 | #endif | ||
255 | 258 | ||
256 | static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs, | 259 | static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs, |
257 | unsigned long error_code) | 260 | unsigned long error_code) |
@@ -278,6 +281,26 @@ static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs, | |||
278 | */ | 281 | */ |
279 | static int vmalloc_fault(unsigned long address) | 282 | static int vmalloc_fault(unsigned long address) |
280 | { | 283 | { |
284 | #ifdef CONFIG_X86_32 | ||
285 | unsigned long pgd_paddr; | ||
286 | pmd_t *pmd_k; | ||
287 | pte_t *pte_k; | ||
288 | /* | ||
289 | * Synchronize this task's top level page-table | ||
290 | * with the 'reference' page table. | ||
291 | * | ||
292 | * Do _not_ use "current" here. We might be inside | ||
293 | * an interrupt in the middle of a task switch.. | ||
294 | */ | ||
295 | pgd_paddr = read_cr3(); | ||
296 | pmd_k = vmalloc_sync_one(__va(pgd_paddr), address); | ||
297 | if (!pmd_k) | ||
298 | return -1; | ||
299 | pte_k = pte_offset_kernel(pmd_k, address); | ||
300 | if (!pte_present(*pte_k)) | ||
301 | return -1; | ||
302 | return 0; | ||
303 | #else | ||
281 | pgd_t *pgd, *pgd_ref; | 304 | pgd_t *pgd, *pgd_ref; |
282 | pud_t *pud, *pud_ref; | 305 | pud_t *pud, *pud_ref; |
283 | pmd_t *pmd, *pmd_ref; | 306 | pmd_t *pmd, *pmd_ref; |
@@ -321,6 +344,7 @@ static int vmalloc_fault(unsigned long address) | |||
321 | if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref)) | 344 | if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref)) |
322 | BUG(); | 345 | BUG(); |
323 | return 0; | 346 | return 0; |
347 | #endif | ||
324 | } | 348 | } |
325 | 349 | ||
326 | int show_unhandled_signals = 1; | 350 | int show_unhandled_signals = 1; |