linux-sg2042/arch/powerpc/mm
Kumar Gala 82ae5eaffa powerpc/mm: Fix module instruction tlb fault handling on Book-E 64
We were seeing oops like the following when we did an rmmod on a module:

Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x8000000000008010
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=2 P5020 DS
last sysfs file: /sys/devices/qman-portals.2/qman-pool.9/uevent
Modules linked in: qman_tester(-)
NIP: 8000000000008010 LR: c000000000074858 CTR: 8000000000008010
REGS: c00000002e29bab0 TRAP: 0400   Not tainted
(2.6.34.6-00744-g2d21f14)
MSR: 0000000080029000 <EE,ME,CE>  CR: 24000448  XER: 00000000
TASK = c00000007a8be600[4987] 'rmmod' THREAD: c00000002e298000 CPU: 1
GPR00: 8000000000008010 c00000002e29bd30 8000000000012798 c00000000035fb28
GPR04: 0000000000000002 0000000000000002 0000000024022428 c000000000009108
GPR08: fffffffffffffffe 800000000000a618 c0000000003c13c8 0000000000000000
GPR12: 0000000022000444 c00000000fffed00 0000000000000000 0000000000000000
GPR16: 00000000100c0000 0000000000000000 00000000100dabc8 0000000010099688
GPR20: 0000000000000000 00000000100cfc28 0000000000000000 0000000010011a44
GPR24: 00000000100017b2 0000000000000000 0000000000000000 0000000000000880
GPR28: c00000000035fb28 800000000000a7b8 c000000000376d80 c0000000003cce50
NIP [8000000000008010] .test_exit+0x0/0x10 [qman_tester]
LR [c000000000074858] .SyS_delete_module+0x1f8/0x2f0
Call Trace:
[c00000002e29bd30] [c0000000000748b4] .SyS_delete_module+0x254/0x2f0 (unreliable)
[c00000002e29be30] [c000000000000580] syscall_exit+0x0/0x2c
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
38600000 4e800020 60000000 60000000 <4e800020> 60000000 60000000 60000000
---[ end trace 4f57124939a84dc8 ]---

This appears to be due to checking the wrong permission bits in the
instruction_tlb_miss handling if the address that faulted was in vmalloc
space.  We need to look at the supervisor execute (_PAGE_BAP_SX) bit and
not the user bit (_PAGE_BAP_UX/_PAGE_EXEC).

Also removed a branch level since it did not appear to be used.

Reported-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-11-18 14:54:23 +11:00
..
40x_mmu.c memblock: Remove rmo_size, burry it in arch/powerpc where it belongs 2010-08-05 12:56:08 +10:00
44x_mmu.c memblock: Remove rmo_size, burry it in arch/powerpc where it belongs 2010-08-05 12:56:08 +10:00
Makefile powerpc/fsl-booke64: Use TLB CAMs to cover linear mapping on FSL 64-bit chips 2010-10-14 00:55:14 -05:00
dma-noncoherent.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fault.c powerpc: Check end of stack canary at oops time 2010-09-02 14:07:30 +10:00
fsl_booke_mmu.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2010-10-21 21:19:54 -07:00
gup.c powerpc/mm: Allow more flexible layouts for hugepage pagetables 2009-10-30 17:20:58 +11:00
hash_low_32.S powerpc: Use names rather than numbers for SPRGs (v2) 2009-08-20 10:12:27 +10:00
hash_low_64.S powerpc/mm: Move around testing of _PAGE_PRESENT in hash code 2010-07-23 08:53:23 +10:00
hash_native_64.c powerpc: Convert native_tlbie_lock to raw_spinlock 2010-02-19 14:52:30 +11:00
hash_utils_64.c powerpc: Fix call to subpage_protection() 2010-11-18 14:54:23 +11:00
highmem.c mm: fix race in kunmap_atomic() 2010-10-27 18:03:05 -07:00
hugetlbpage-hash64.c powerpc/mm: Add some debug output when hash insertion fails 2010-07-23 12:56:56 +10:00
hugetlbpage.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
init_32.c memblock: Remove rmo_size, burry it in arch/powerpc where it belongs 2010-08-05 12:56:08 +10:00
init_64.c Merge commit 'v2.6.36-rc3' into x86/memblock 2010-08-31 09:45:46 +02:00
mem.c memblock, bootmem: Round pfn properly for memory and reserved regions 2010-10-12 15:37:51 -07:00
mmap_64.c powerpc: Use helpers for rlimits 2010-01-15 13:20:08 +11:00
mmu_context_hash32.c PPC: Split context init/destroy functions 2010-05-17 12:18:20 +03:00
mmu_context_hash64.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mmu_context_nohash.c powerpc/mm: Assume first cpu is boot_cpuid not 0 2010-09-02 14:07:34 +10:00
mmu_decl.h powerpc/fsl-booke64: Use TLB CAMs to cover linear mapping on FSL 64-bit chips 2010-10-14 00:55:14 -05:00
numa.c memblock, bootmem: Round pfn properly for memory and reserved regions 2010-10-12 15:37:51 -07:00
pgtable.c powerpc: Remove all rcu head initializations 2010-07-09 11:28:34 +10:00
pgtable_32.c lmb: rename to memblock 2010-07-14 17:14:00 +10:00
pgtable_64.c lmb: rename to memblock 2010-07-14 17:14:00 +10:00
ppc_mmu_32.c memblock: Remove rmo_size, burry it in arch/powerpc where it belongs 2010-08-05 12:56:08 +10:00
slb.c powerpc/pseries: Fix to handle slb resize across migration 2009-09-02 16:19:01 +10:00
slb_low.S powerpc/mm: Fix hang accessing top of vmalloc space 2009-10-14 16:58:36 +11:00
slice.c powerpc: is_hugepage_only_range() must account for both 4kB and 64kB slices 2009-01-16 16:15:16 +11:00
stab.c lmb: rename to memblock 2010-07-14 17:14:00 +10:00
subpage-prot.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tlb_hash32.c powerpc: Removing dead CONFIG_SMP_750 2010-07-09 11:28:38 +10:00
tlb_hash64.c powerpc: Fix address masking bug in hpte_need_flush() 2010-02-10 13:58:06 +11:00
tlb_low_64e.S powerpc/mm: Fix module instruction tlb fault handling on Book-E 64 2010-11-18 14:54:23 +11:00
tlb_nohash.c powerpc/mm: Fix build error in setup_initial_memory_limit 2010-11-18 14:54:22 +11:00
tlb_nohash_low.S powerpc/fsl-booke64: Use TLB CAMs to cover linear mapping on FSL 64-bit chips 2010-10-14 00:55:14 -05:00