1. 15 Oct, 2008 1 commit
    • Suresh Siddha's avatar
      x86: fix compat-vdso · f61f1b57
      Suresh Siddha authored
      Jeff Chua reported that this patch:
      
      > -#define PTE_IDENT_ATTR  0x007          /* PRESENT+RW+USER */
      > -#define PDE_IDENT_ATTR  0x067          /* PRESENT+RW+USER+DIRTY+ACCESSED */
      > +#define PTE_IDENT_ATTR  0x003          /* PRESENT+RW */
      > +#define PDE_IDENT_ATTR  0x063          /* PRESENT+RW+DIRTY+ACCESSED */
      
      broke kernels with CONFIG_COMPAT_VDSO set with this init segfault:
      
      init[1]: segfault at ffffe01c up b7f0dc28 sp bfc26628 error 5 in ld-2.7.90.so[b7f0b000+1c000]
      
      Include USER bit in the PDE_IDENT_ATTR only, as the protection bits
      are combined from the PDE and PTE entries. This will allow the high
      mapped VDSO page in the case of CONFIG_COMPAT_VDSO to be user
      readable.
      Reported-by: default avatarJeff Chua <jeff.chua.linux@gmail.com>
      Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Tested-by: default avatarJeff Chua <jeff.chua.linux@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f61f1b57
  2. 13 Oct, 2008 2 commits
    • Ingo Molnar's avatar
      x86/mm: unify init task OOM handling · 3a1dfe6e
      Ingo Molnar authored
      Linus noticed that the "again:" versus "survive:" OOM logic for
      the init task was arbitrarily different.
      
      The 64-bit codepath is the better one, because it correctly re-lookups
      the vma after having dropped the ->mmap_sem.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3a1dfe6e
    • Linus Torvalds's avatar
      x86/mm: do not trigger a kernel warning if user-space disables interrupts and... · 891cffbd
      Linus Torvalds authored
      x86/mm: do not trigger a kernel warning if user-space disables interrupts and generates a page fault
      
      Arjan reported a spike in the following bug pattern in v2.6.27:
      
         http://www.kerneloops.org/searchweek.php?search=lock_page
      
      which happens because hwclock started triggering warnings due to
      a (correct) might_sleep() check in the MM code.
      
      The warning occurs because hwclock uses this dubious sequence of
      code to run "atomic" code:
      
        static unsigned long
        atomic(const char *name, unsigned long (*op)(unsigned long),
               unsigned long arg)
        {
          unsigned long v;
          __asm__ volatile ("cli");
          v = (*op)(arg);
          __asm__ volatile ("sti");
          return v;
        }
      
      Then it pagefaults in that "atomic" section, triggering the warning.
      
      There is no way the kernel could provide "atomicity" in this path,
      a page fault is a cannot-continue machine event so the kernel has to
      wait for the page to be filled in.
      
      Even if it was just a minor fault we'd have to take locks and might have
      to spend quite a bit of time with interrupts disabled - not nice to irq
      latencies in general.
      
      So instead just enable interrupts in the pagefault path unconditionally
      if we come from user-space, and handle the fault.
      
      Also, while touching this code, unify some trivial parts of the x86
      VM paths at the same time.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Reported-by: default avatarArjan van de Ven <arjan@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      891cffbd
  3. 12 Oct, 2008 37 commits