fault.c (8decf868790b48a727d7e7ca164f2bcd3c1389c0) fault.c (e05139f2569ecf699b229a6473a86cdffed62956)
1/*
2 * Copyright (C) 1995 Linus Torvalds
3 * Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs.
4 * Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar
5 */
6#include <linux/magic.h> /* STACK_END_MAGIC */
7#include <linux/sched.h> /* test_thread_flag(), ... */
8#include <linux/kdebug.h> /* oops_begin/end, ... */

--- 406 unchanged lines hidden (view full) ---

415 * that:
416 */
417 if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref))
418 BUG();
419
420 return 0;
421}
422
1/*
2 * Copyright (C) 1995 Linus Torvalds
3 * Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs.
4 * Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar
5 */
6#include <linux/magic.h> /* STACK_END_MAGIC */
7#include <linux/sched.h> /* test_thread_flag(), ... */
8#include <linux/kdebug.h> /* oops_begin/end, ... */

--- 406 unchanged lines hidden (view full) ---

415 * that:
416 */
417 if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref))
418 BUG();
419
420 return 0;
421}
422
423#ifdef CONFIG_CPU_SUP_AMD
423static const char errata93_warning[] =
424KERN_ERR
425"******* Your BIOS seems to not contain a fix for K8 errata #93\n"
426"******* Working around it, but it may cause SEGVs or burn power.\n"
427"******* Please consider a BIOS update.\n"
428"******* Disabling USB legacy in the BIOS may also help.\n";
424static const char errata93_warning[] =
425KERN_ERR
426"******* Your BIOS seems to not contain a fix for K8 errata #93\n"
427"******* Working around it, but it may cause SEGVs or burn power.\n"
428"******* Please consider a BIOS update.\n"
429"******* Disabling USB legacy in the BIOS may also help.\n";
430#endif
429
430/*
431 * No vm86 mode in 64-bit mode:
432 */
433static inline void
434check_v8086_mode(struct pt_regs *regs, unsigned long address,
435 struct task_struct *tsk)
436{

--- 63 unchanged lines hidden (view full) ---

500 * The OS sees this as a page fault with the upper 32bits of RIP cleared.
501 * Try to work around it here.
502 *
503 * Note we only handle faults in kernel here.
504 * Does nothing on 32-bit.
505 */
506static int is_errata93(struct pt_regs *regs, unsigned long address)
507{
431
432/*
433 * No vm86 mode in 64-bit mode:
434 */
435static inline void
436check_v8086_mode(struct pt_regs *regs, unsigned long address,
437 struct task_struct *tsk)
438{

--- 63 unchanged lines hidden (view full) ---

502 * The OS sees this as a page fault with the upper 32bits of RIP cleared.
503 * Try to work around it here.
504 *
505 * Note we only handle faults in kernel here.
506 * Does nothing on 32-bit.
507 */
508static int is_errata93(struct pt_regs *regs, unsigned long address)
509{
508#ifdef CONFIG_X86_64
510#if defined(CONFIG_X86_64) && defined(CONFIG_CPU_SUP_AMD)
511 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD
512 || boot_cpu_data.x86 != 0xf)
513 return 0;
514
509 if (address != regs->ip)
510 return 0;
511
512 if ((address >> 32) != 0)
513 return 0;
514
515 address |= 0xffffffffUL << 32;
516 if ((address >= (u64)_stext && address <= (u64)_etext) ||

--- 679 unchanged lines hidden ---
515 if (address != regs->ip)
516 return 0;
517
518 if ((address >> 32) != 0)
519 return 0;
520
521 address |= 0xffffffffUL << 32;
522 if ((address >= (u64)_stext && address <= (u64)_etext) ||

--- 679 unchanged lines hidden ---