aboutsummaryrefslogtreecommitdiff
path: root/arch/nios2/mm
AgeCommit message (Collapse)AuthorFilesLines
2016-07-26mm: do not pass mm_struct into handle_mm_faultKirill A. Shutemov1-1/+1
We always have vma->vm_mm around. Link: http://lkml.kernel.org/r/1466021202-61880-8-git-send-email-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2016-01-20nios2: convert to dma_map_opsChristoph Hellwig1-69/+80
Signed-off-by: Christoph Hellwig <[email protected]> Cc: Ley Foon Tan <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Sebastian Ott <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2015-11-26nios2: fix cache coherencyLey Foon Tan1-20/+4
There is intermittent cache coherency issue caught in toolchian tests. Revert to use flushd. Signed-off-by: Ley Foon Tan <[email protected]>
2015-05-19mm/fault, arch: Use pagefault_disable() to check for disabled pagefaults in ↵David Hildenbrand1-1/+1
the handler 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: Thomas Gleixner <[email protected]> Signed-off-by: David Hildenbrand <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected] Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2015-04-24nios2: rework cacheLey Foon Tan1-16/+36
- flush dcache before flush instruction cache - remork update_mmu_cache and flush_dcache_page - add shmparam.h Signed-off-by: Ley Foon Tan <[email protected]>
2015-04-20nios2: remove end address checking for initdaLey Foon Tan1-3/+0
Remove the end address checking for initda function. We need to invalidate each address line for initda instruction, from start to end address. Signed-off-by: Ley Foon Tan <[email protected]>
2015-04-10nios2: fix cache coherency issue when debug with gdbLey Foon Tan1-3/+0
Remove the end address checking for flushda function. We need to flush each address line for flushda instruction, from start to end address. This is because flushda instruction only flush the cache if tag and line fields are matched. Change to use ldwio instruction (bypass cache) to load the instruction that causing trap. Our interest is the actual instruction that executed by the processor, this should be uncached. Note, EA address might be an userspace cached address. Signed-off-by: Ley Foon Tan <[email protected]>
2015-03-16nios2: mm: do not invoke OOM killer on kernel fault OOMLey Foon Tan1-6/+0
Follow commit 871341023c771ad. Kernel faults are expected to handle OOM conditions gracefully (gup, uaccess etc.), so they should never invoke the OOM killer. Reserve this for faults triggered in user context when it is the only option. Signed-off-by: Ley Foon Tan <[email protected]>
2015-02-09nios2: Port OOM changes to do_page_fault()Ley Foon Tan1-5/+32
Commit d065bd810b6d ("mm: retry page fault when blocking on disk transfer") and and commit 37b23e0525d3 ("x86,mm: make pagefault killable") The above commits introduced changes into the nios2 pagefault handler for making the page fault handler retryable as well as killable. These changes reduce the mmap_sem hold time, which is crucial during OOM killer invocation. Signed-off-by: Ley Foon Tan <[email protected]>
2015-02-09nios2: fix unhandled signalsChung-Ling Tang1-3/+5
Follow other architectures for user fault handling. Signed-off-by: Chung-Ling Tang <[email protected]> Acked-by: Ley Foon Tan <[email protected]>
2015-01-29vm: add VM_FAULT_SIGSEGV handling supportLinus Torvalds1-0/+2
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 fee7e49d4514 ("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: Takashi Iwai <[email protected]> Tested-by: Jan Engelhardt <[email protected]> Acked-by: Heiko Carstens <[email protected]> # "s390 still compiles and boots" Cc: [email protected] Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
2014-12-08nios2: Build infrastructureLey Foon Tan1-0/+14
This patch adds Makefile and Kconfig files required for building a nios2 kernel. Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: DMA mapping APILey Foon Tan1-0/+186
This patch adds support for the DMA mapping API. Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: TLB handlingLey Foon Tan1-0/+275
This patch adds the TLB maintenance functions. Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: Cache handlingLey Foon Tan1-0/+271
This patch adds functionality required for cache maintenance. Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: Process managementLey Foon Tan1-0/+116
This patch adds support for thread creation and context switching. Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: Page table managementLey Foon Tan1-0/+74
This patch adds support for page table management. Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: MMU Fault handlingLey Foon Tan2-0/+276
This patch adds support for the handling of the MMU faults (exception entry code introduced by a previous patch, kernel/entry.S). Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: I/O MappingLey Foon Tan1-0/+187
This patch adds several definitions for I/O accessors and ioremap(). Signed-off-by: Ley Foon Tan <[email protected]>
2014-12-08nios2: Memory managementLey Foon Tan2-0/+305
This patch contains the initialisation of the memory blocks, MMU attributes and the memory map. Signed-off-by: Ley Foon Tan <[email protected]>