1. 20 Feb, 2009 10 commits
    • Ingo Molnar's avatar
      x86, mm: fault.c, refactor/simplify the is_prefetch() code · 107a0367
      Ingo Molnar authored
      Impact: no functionality changed
      
      Factor out the opcode checker into a helper inline.
      
      The code got a tiny bit smaller:
      
         text	   data	    bss	    dec	    hex	filename
         4632	     32	     24	   4688	   1250	fault.o.before
         4618	     32	     24	   4674	   1242	fault.o.after
      
      And it got cleaner / easier to review as well.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      107a0367
    • Ingo Molnar's avatar
      x86, mm: fault.c cleanup · 2d4a7167
      Ingo Molnar authored
      Impact: cleanup, no code changed
      
      Clean up various small details, which can be correctness checked
      automatically:
      
       - tidy up the include file section
       - eliminate unnecessary includes
       - introduce show_signal_msg() to clean up code flow
       - standardize the code flow
       - standardize comments and other style details
       - more cleanups, pointed out by checkpatch
      
      No code changed on either 32-bit nor 64-bit:
      
      arch/x86/mm/fault.o:
      
         text	   data	    bss	    dec	    hex	filename
         4632	     32	     24	   4688	   1250	fault.o.before
         4632	     32	     24	   4688	   1250	fault.o.after
      
      the md5 changed due to a change in a single instruction:
      
         2e8a8241e7f0d69706776a5a26c90bc0  fault.o.before.asm
         c5c3d36e725586eb74f0e10692f0193e  fault.o.after.asm
      
      Because a __LINE__ reference in a WARN_ONCE() has changed.
      
      On 32-bit a few stack offsets changed - no code size difference
      nor any functionality difference.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      2d4a7167
    • Ingo Molnar's avatar
      Merge branch 'tip/x86/urgent' of... · c9e1585b
      Ingo Molnar authored
      Merge branch 'tip/x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into x86/mm
      c9e1585b
    • Ingo Molnar's avatar
      x86, pat: add large-PAT check to split_large_page() · 7a5714e0
      Ingo Molnar authored
      Impact: future-proof the split_large_page() function
      
      Linus noticed that split_large_page() is not safe wrt. the
      PAT bit: it is bit 12 on the 1GB and 2MB page table level
      (_PAGE_BIT_PAT_LARGE), and it is bit 7 on the 4K page
      table level (_PAGE_BIT_PAT).
      
      Currently it is not a problem because we never set
      _PAGE_BIT_PAT_LARGE on any of the large-page mappings - but
      should this happen in the future the split_large_page() would
      silently lift bit 12 into the lowlevel 4K pte and would start
      corrupting the physical page frame offset. Not fun.
      
      So add a debug warning, to make sure if something ever sets
      the PAT bit then this function gets updated too.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7a5714e0
    • Steven Rostedt's avatar
      x86: check PMD in spurious_fault handler · 3c3e5694
      Steven Rostedt authored
      Impact: fix to prevent hard lockup on bad PMD permissions
      
      If the PMD does not have the correct permissions for a page access,
      but the PTE does, the spurious fault handler will mistake the fault
      as a lazy TLB transaction. This will result in an infinite loop of:
      
       fault -> spurious_fault check (pass) -> return to code -> fault
      
      This patch adds a check and a warn on if the PTE passes the permissions
      but the PMD does not.
      
      [ Updated: Ingo Molnar suggested using WARN_ONCE with some text ]
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      3c3e5694
    • Ingo Molnar's avatar
    • Ingo Molnar's avatar
      Merge branch 'x86/urgent' into x86/core · 3b6f7b9b
      Ingo Molnar authored
      3b6f7b9b
    • Vegard Nossum's avatar
      x86: use symbolic constants for MSR_IA32_MISC_ENABLE bits · ecab22aa
      Vegard Nossum authored
      Impact: Cleanup. No functional changes.
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ecab22aa
    • Ingo Molnar's avatar
      x86: use the right protections for split-up pagetables · 07a66d7c
      Ingo Molnar authored
      Steven Rostedt found a bug in where in his modified kernel
      ftrace was unable to modify the kernel text, due to the PMD
      itself having been marked read-only as well in
      split_large_page().
      
      The fix, suggested by Linus, is to not try to 'clone' the
      reference protection of a huge-page, but to use the standard
      (and permissive) page protection bits of KERNPG_TABLE.
      
      The 'cloning' makes sense for the ptes but it's a confused and
      incorrect concept at the page table level - because the
      pagetable entry is a set of all ptes and hence cannot
      'clone' any single protection attribute - the ptes can be any
      mixture of protections.
      
      With the permissive KERNPG_TABLE, even if the pte protections
      get changed after this point (due to ftrace doing code-patching
      or other similar activities like kprobes), the resulting combined
      protections will still be correct and the pte's restrictive
      (or permissive) protections will control it.
      
      Also update the comment.
      
      This bug was there for a long time but has not caused visible
      problems before as it needs a rather large read-only area to
      trigger. Steve possibly hacked his kernel with some really
      large arrays or so. Anyway, the bug is definitely worth fixing.
      
      [ Huang Ying also experienced problems in this area when writing
        the EFI code, but the real bug in split_large_page() was not
        realized back then. ]
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Reported-by: default avatarHuang Ying <ying.huang@intel.com>
      Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      07a66d7c
    • Alok N Kataria's avatar
      x86, vmi: TSC going backwards check in vmi clocksource · 48ffc70b
      Alok N Kataria authored
      Impact: fix time warps under vmware
      
      Similar to the check for TSC going backwards in the TSC clocksource,
      we also need this check for VMI clocksource.
      Signed-off-by: default avatarAlok N Kataria <akataria@vmware.com>
      Cc: Zachary Amsden <zach@vmware.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: stable@kernel.org
      48ffc70b
  2. 19 Feb, 2009 30 commits