1. 26 1月, 2017 1 次提交
  2. 27 7月, 2016 1 次提交
  3. 19 5月, 2015 1 次提交
    • D
      mm/fault, arch: Use pagefault_disable() to check for disabled pagefaults in the handler · 70ffdb93
      David Hildenbrand 提交于
      Introduce faulthandler_disabled() and use it to check for irq context and
      disabled pagefaults (via pagefault_disable()) in the pagefault handlers.
      
      Please note that we keep the in_atomic() checks in place - to detect
      whether in irq context (in which case preemption is always properly
      disabled).
      
      In contrast, preempt_disable() should never be used to disable pagefaults.
      With !CONFIG_PREEMPT_COUNT, preempt_disable() doesn't modify the preempt
      counter, and therefore the result of in_atomic() differs.
      We validate that condition by using might_fault() checks when calling
      might_sleep().
      
      Therefore, add a comment to faulthandler_disabled(), describing why this
      is needed.
      
      faulthandler_disabled() and pagefault_disable() are defined in
      linux/uaccess.h, so let's properly add that include to all relevant files.
      
      This patch is based on a patch from Thomas Gleixner.
      Reviewed-and-tested-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NDavid Hildenbrand <dahi@linux.vnet.ibm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: David.Laight@ACULAB.COM
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: airlied@linux.ie
      Cc: akpm@linux-foundation.org
      Cc: benh@kernel.crashing.org
      Cc: bigeasy@linutronix.de
      Cc: borntraeger@de.ibm.com
      Cc: daniel.vetter@intel.com
      Cc: heiko.carstens@de.ibm.com
      Cc: herbert@gondor.apana.org.au
      Cc: hocko@suse.cz
      Cc: hughd@google.com
      Cc: mst@redhat.com
      Cc: paulus@samba.org
      Cc: ralf@linux-mips.org
      Cc: schwidefsky@de.ibm.com
      Cc: yang.shi@windriver.com
      Link: http://lkml.kernel.org/r/1431359540-32227-7-git-send-email-dahi@linux.vnet.ibm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      70ffdb93
  4. 30 1月, 2015 1 次提交
    • L
      vm: add VM_FAULT_SIGSEGV handling support · 33692f27
      Linus Torvalds 提交于
      The core VM already knows about VM_FAULT_SIGBUS, but cannot return a
      "you should SIGSEGV" error, because the SIGSEGV case was generally
      handled by the caller - usually the architecture fault handler.
      
      That results in lots of duplication - all the architecture fault
      handlers end up doing very similar "look up vma, check permissions, do
      retries etc" - but it generally works.  However, there are cases where
      the VM actually wants to SIGSEGV, and applications _expect_ SIGSEGV.
      
      In particular, when accessing the stack guard page, libsigsegv expects a
      SIGSEGV.  And it usually got one, because the stack growth is handled by
      that duplicated architecture fault handler.
      
      However, when the generic VM layer started propagating the error return
      from the stack expansion in commit fee7e49d ("mm: propagate error
      from stack expansion even for guard page"), that now exposed the
      existing VM_FAULT_SIGBUS result to user space.  And user space really
      expected SIGSEGV, not SIGBUS.
      
      To fix that case, we need to add a VM_FAULT_SIGSEGV, and teach all those
      duplicate architecture fault handlers about it.  They all already have
      the code to handle SIGSEGV, so it's about just tying that new return
      value to the existing code, but it's all a bit annoying.
      
      This is the mindless minimal patch to do this.  A more extensive patch
      would be to try to gather up the mostly shared fault handling logic into
      one generic helper routine, and long-term we really should do that
      cleanup.
      
      Just from this patch, you can generally see that most architectures just
      copied (directly or indirectly) the old x86 way of doing things, but in
      the meantime that original x86 model has been improved to hold the VM
      semaphore for shorter times etc and to handle VM_FAULT_RETRY and other
      "newer" things, so it would be a good idea to bring all those
      improvements to the generic case and teach other architectures about
      them too.
      Reported-and-tested-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NJan Engelhardt <jengelh@inai.de>
      Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> # "s390 still compiles and boots"
      Cc: linux-arch@vger.kernel.org
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      33692f27
  5. 13 9月, 2013 1 次提交
  6. 12 2月, 2013 1 次提交
  7. 09 10月, 2012 1 次提交
  8. 25 5月, 2012 1 次提交
  9. 29 3月, 2012 1 次提交
  10. 09 3月, 2011 1 次提交
    • M
      microblaze: Fix sparse warning - fault.c · 5213a9c3
      Michal Simek 提交于
      Warning log:
      CHECK   arch/microblaze/mm/fault.c
      arch/microblaze/mm/fault.c:51:6: warning: incorrect type in initializer (different address spaces)
      arch/microblaze/mm/fault.c:51:6:    expected unknown type 2const [noderef] *__gu_addr<asn:1>
      arch/microblaze/mm/fault.c:51:6:    got unsigned int *<noident>
      arch/microblaze/mm/fault.c:68:6: warning: symbol 'bad_page_fault' was not declared. Should it be static?
      Signed-off-by: NMichal Simek <monstr@monstr.eu>
      5213a9c3
  11. 04 8月, 2010 2 次提交
    • M
      microblaze: Add KGDB support · 2d5973cb
      Michal Simek 提交于
      Kgdb uses brki r16, 0x18 instruction to call
      low level _debug_exception function which save
      current state to pt_regs and call microblaze_kgdb_break
      function. _debug_exception should be called only from
      the kernel space. User space calling is not supported
      because user application debugging uses different handling.
      
      pt_regs_to_gdb_regs loads additional special registers
      which can't be changed
      
       * Enable KGDB in Kconfig
       * Remove ancient not-tested KGDB support
       * Remove ancient _debug_exception code from entry.S
      
      Only MMU KGDB support is supported.
      Signed-off-by: NMichal Simek <monstr@monstr.eu>
      CC: Jason Wessel <jason.wessel@windriver.com>
      CC: John Williams <john.williams@petalogix.com>
      CC: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
      CC: linux-kernel@vger.kernel.org
      Acked-by: NJason Wessel <jason.wessel@windriver.com>
      2d5973cb
    • M
      microblaze: Remove unused label · ef787050
      Michal Simek 提交于
      The label should be remove by
      21e1c936
      
      Warning message:
      arch/microblaze/mm/fault.c: In function 'do_page_fault':
      arch/microblaze/mm/fault.c:229: warning: label 'survive' defined but not used
      Signed-off-by: NMichal Simek <monstr@monstr.eu>
      ef787050
  12. 06 5月, 2010 1 次提交
  13. 01 4月, 2010 1 次提交
  14. 27 7月, 2009 2 次提交
  15. 22 6月, 2009 1 次提交
  16. 26 5月, 2009 1 次提交