1. 13 Aug, 2013 4 commits
    • Chris Metcalf's avatar
      tile: fix some issues in hugepage support · a0bd12d7
      Chris Metcalf authored
      First, in huge_pte_offset(), we were erroneously checking
      pgd_present(), which is always true, rather than pud_present(),
      which is the thing that tells us if there is a top-level (L0) PTE.
      Fixing this means we properly look up huge page entries only when
      the Present bit is actually set in the PTE.
      
      Second, use the standard pte_alloc_map() instead of the hand-rolled
      pte_alloc_hugetlb() routine that basically was written to avoid
      worrying about CONFIG_HIGHPTE.  However, we no longer plan to support
      HIGHPTE, so a separate routine was just unnecessary code duplication.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      a0bd12d7
    • Chris Metcalf's avatar
      tile: add some tile drivers to MAINTAINERS · 6b940606
      Chris Metcalf authored
      Also, alphabetize the existing entries for tile.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      6b940606
    • Chris Metcalf's avatar
      tile: avoid recursive backtrace faults · 3ef23111
      Chris Metcalf authored
      This change adds support for avoiding recursive backtracer crashes;
      we haven't seen this in practice other than when things are seriously
      corrupt, but it may help avoid losing the root cause of a crash.
      
      Also, don't abort kernel backtracers for invalid userspace PC's.
      If we do, we lose the ability to backtrace through a userspace
      call to a bad address above PAGE_OFFSET, even though that it can
      be perfectly reasonable to continue the backtrace in such a case.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      3ef23111
    • Chris Metcalf's avatar
      tile: fast-path unaligned memory access for tilegx · 2f9ac29e
      Chris Metcalf authored
      This change enables unaligned userspace memory access via a kernel
      fast path on tilegx.  The kernel tracks user PC/instruction pairs
      per-thread using a direct-mapped cache in userspace.  The cache
      maps those PC/instruction pairs to JIT'ed instruction sequences that
      load or store using byte-wide load store intructions and then
      synthesize 2-, 4- or 8-byte load or store results.  Once an
      instruction has been seen to generate an unaligned access once,
      subsequent hits on that instruction typically require overhead
      of only around 50 cycles if cache and TLB is hot.
      
      We support the prctl() PR_GET_UNALIGN / PR_SET_UNALIGN sys call to
      enable or disable unaligned fixups on a per-process basis.
      
      To do this we pull some of the tilepro unaligned support out of the
      single_step.c file; tilepro uses instruction disassembly for both
      single-step and unaligned access support.  Since tilegx actually has
      hardware singlestep support, though, it's cleaner to keep the tilegx
      unaligned access code in a separate file.  While we're at it,
      properly rename the tilepro-specific types, etc., to have tilepro
      suffixes instead of generic tile suffixes.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      2f9ac29e
  2. 12 Aug, 2013 5 commits
    • Chris Metcalf's avatar
      tile: remove unnecessary backslashes in asm-offsets.c · f10da547
      Chris Metcalf authored
      Pointed out by checkpatch.  A few of the DEFINE() lines were
      properly written without backslash continuation; fix the rest.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      f10da547
    • Chris Metcalf's avatar
      tile: fix tilegx vmalloc_sync_all BUG_ON · e5f7bd43
      Chris Metcalf authored
      As specified, the test wasn't correct, and in any case it should
      be a BUILD_BUG_ON.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      e5f7bd43
    • Chris Metcalf's avatar
      b63ea712
    • Chris Metcalf's avatar
      tile: support "memmap" boot parameter · 77f8c740
      Chris Metcalf authored
      This change adds support for the "memmap" boot parameter similar
      to what x86 provides.  The tile version supports "memmap=1G$5G",
      for example, as a way to reserve a 1 GB range starting at PA 5GB.
      The memory is reserved via bootmem during startup, and we create a
      suitable "struct resource" marked as "Reserved" so you can see the
      range reported by /proc/iomem.  Up to 64 such regions can currently
      be reserved on the boot command line.
      
      We do not support the x86 options "memmap=nn@ss" (force some memory
      to be available at the given address) since it's pointless to try to
      have Linux use memory the Tilera hypervisor hasn't given it.  We do
      not support "memmap=nn#ss" to add an ACPI range for later processing,
      since we don't support ACPI.  We do not support "memmap=exactmap"
      since we don't support reading the e820 information from the BIOS
      like x86 does.  I did add support for "memmap=nn" (and the synonym
      "mem=nn") which cap the highest PA value at "nn"; these are both
      just a synonym for the existing tile boot option "maxmem".
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      77f8c740
    • Chris Metcalf's avatar
      tile: various console improvements · bda0f5ba
      Chris Metcalf authored
      This change improves and cleans up the tile console.
      
      - We enable HVC_IRQ support on tilegx, with the addition of a new
        Tilera hypervisor API for tilegx to allow a console IPI.  If IPI
        support is not available we fall back to the previous polling mode.
      
      - We simplify the earlyprintk code to use CON_BOOT and eliminate some
        of the other supporting earlyprintk code.
      
      - A new tile_console_write() primitive is used to send output to
        the console and is factored out of the hvc_tile driver.
        This lets us support a "sim_console" boot argument to allow using
        simulator hooks to send output to the "console" as a slightly
        faster alternative to emulating the hardware more directly.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bda0f5ba
  3. 06 Aug, 2013 15 commits
  4. 05 Aug, 2013 5 commits
  5. 02 Aug, 2013 1 commit
  6. 01 Aug, 2013 1 commit
    • Chris Metcalf's avatar
      tile: optimize and clean up string functions · c53c70a9
      Chris Metcalf authored
      This change cleans up the string code in a number of ways:
      
      - For memcpy(), fix bug in prefetch and increase distance to 3 lines;
        optimize for unaligned data; do all loads before wh64 to make memcpy
        safe for forward-overlapping calls; etc.  Performance is improved.
      
      - Use new copy_byte() function on tilegx to spread a single byte value
        out into a full word using the shufflebytes instruction.
      
      - Clean up header include ordering to be more canonical, and remove
        spurious #undefs of function names.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      c53c70a9
  7. 31 Jul, 2013 2 commits
  8. 17 Jul, 2013 2 commits
  9. 14 Jul, 2013 5 commits
    • Linus Torvalds's avatar
      Linux 3.11-rc1 · ad81f054
      Linus Torvalds authored
      ad81f054
    • Linus Torvalds's avatar
      Merge branch 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux · 54be8200
      Linus Torvalds authored
      Pull slab update from Pekka Enberg:
       "Highlights:
      
        - Fix for boot-time problems on some architectures due to
          init_lock_keys() not respecting kmalloc_caches boundaries
          (Christoph Lameter)
      
        - CONFIG_SLUB_CPU_PARTIAL requested by RT folks (Joonsoo Kim)
      
        - Fix for excessive slab freelist draining (Wanpeng Li)
      
        - SLUB and SLOB cleanups and fixes (various people)"
      
      I ended up editing the branch, and this avoids two commits at the end
      that were immediately reverted, and I instead just applied the oneliner
      fix in between myself.
      
      * 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux
        slub: Check for page NULL before doing the node_match check
        mm/slab: Give s_next and s_stop slab-specific names
        slob: Check for NULL pointer before calling ctor()
        slub: Make cpu partial slab support configurable
        slab: add kmalloc() to kernel API documentation
        slab: fix init_lock_keys
        slob: use DIV_ROUND_UP where possible
        slub: do not put a slab to cpu partial list when cpu_partial is 0
        mm/slub: Use node_nr_slabs and node_nr_objs in get_slabinfo
        mm/slub: Drop unnecessary nr_partials
        mm/slab: Fix /proc/slabinfo unwriteable for slab
        mm/slab: Sharing s_next and s_stop between slab and slub
        mm/slab: Fix drain freelist excessively
        slob: Rework #ifdeffery in slab.h
        mm, slab: moved kmem_cache_alloc_node comment to correct place
      54be8200
    • Steven Rostedt's avatar
      slub: Check for page NULL before doing the node_match check · c25f195e
      Steven Rostedt authored
      In the -rt kernel (mrg), we hit the following dump:
      
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffff811573f1>] kmem_cache_alloc_node+0x51/0x180
      PGD a2d39067 PUD b1641067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: sunrpc cpufreq_ondemand ipv6 tg3 joydev sg serio_raw pcspkr k8temp amd64_edac_mod edac_core i2c_piix4 e100 mii shpchp ext4 mbcache jbd2 sd_mod crc_t10dif sr_mod cdrom sata_svw ata_generic pata_acpi pata_serverworks radeon ttm drm_kms_helper drm hwmon i2c_algo_bit i2c_core dm_mirror dm_region_hash dm_log dm_mod
      CPU 3
      Pid: 20878, comm: hackbench Not tainted 3.6.11-rt25.14.el6rt.x86_64 #1 empty empty/Tyan Transport GT24-B3992
      RIP: 0010:[<ffffffff811573f1>]  [<ffffffff811573f1>] kmem_cache_alloc_node+0x51/0x180
      RSP: 0018:ffff8800a9b17d70  EFLAGS: 00010213
      RAX: 0000000000000000 RBX: 0000000001200011 RCX: ffff8800a06d8000
      RDX: 0000000004d92a03 RSI: 00000000000000d0 RDI: ffff88013b805500
      RBP: ffff8800a9b17dc0 R08: ffff88023fd14d10 R09: ffffffff81041cbd
      R10: 00007f4e3f06e9d0 R11: 0000000000000246 R12: ffff88013b805500
      R13: ffff8801ff46af40 R14: 0000000000000001 R15: 0000000000000000
      FS:  00007f4e3f06e700(0000) GS:ffff88023fd00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 0000000000000000 CR3: 00000000a2d3a000 CR4: 00000000000007e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process hackbench (pid: 20878, threadinfo ffff8800a9b16000, task ffff8800a06d8000)
      Stack:
       ffff8800a9b17da0 ffffffff81202e08 ffff8800a9b17de0 000000d001200011
       0000000001200011 0000000001200011 0000000000000000 0000000000000000
       00007f4e3f06e9d0 0000000000000000 ffff8800a9b17e60 ffffffff81041cbd
      Call Trace:
       [<ffffffff81202e08>] ? current_has_perm+0x68/0x80
       [<ffffffff81041cbd>] copy_process+0xdd/0x15b0
       [<ffffffff810a2125>] ? rt_up_read+0x25/0x30
       [<ffffffff8104369a>] do_fork+0x5a/0x360
       [<ffffffff8107c66b>] ? migrate_enable+0xeb/0x220
       [<ffffffff8100b068>] sys_clone+0x28/0x30
       [<ffffffff81527423>] stub_clone+0x13/0x20
       [<ffffffff81527152>] ? system_call_fastpath+0x16/0x1b
      Code: 89 fc 89 75 cc 41 89 d6 4d 8b 04 24 65 4c 03 04 25 48 ae 00 00 49 8b 50 08 4d 8b 28 49 8b 40 10 4d 85 ed 74 12 41 83 fe ff 74 27 <48> 8b 00 48 c1 e8 3a 41 39 c6 74 1b 8b 75 cc 4c 89 c9 44 89 f2
      RIP  [<ffffffff811573f1>] kmem_cache_alloc_node+0x51/0x180
       RSP <ffff8800a9b17d70>
      CR2: 0000000000000000
      ---[ end trace 0000000000000002 ]---
      
      Now, this uses SLUB pretty much unmodified, but as it is the -rt kernel
      with CONFIG_PREEMPT_RT set, spinlocks are mutexes, although they do
      disable migration. But the SLUB code is relatively lockless, and the
      spin_locks there are raw_spin_locks (not converted to mutexes), thus I
      believe this bug can happen in mainline without -rt features. The -rt
      patch is just good at triggering mainline bugs ;-)
      
      Anyway, looking at where this crashed, it seems that the page variable
      can be NULL when passed to the node_match() function (which does not
      check if it is NULL). When this happens we get the above panic.
      
      As page is only used in slab_alloc() to check if the node matches, if
      it's NULL I'm assuming that we can say it doesn't and call the
      __slab_alloc() code. Is this a correct assumption?
      Acked-by: default avatarChristoph Lameter <cl@linux.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c25f195e
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 41d9884c
      Linus Torvalds authored
      Pull more vfs stuff from Al Viro:
       "O_TMPFILE ABI changes, Oleg's fput() series, misc cleanups, including
        making simple_lookup() usable for filesystems with non-NULL s_d_op,
        which allows us to get rid of quite a bit of ugliness"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        sunrpc: now we can just set ->s_d_op
        cgroup: we can use simple_lookup() now
        efivarfs: we can use simple_lookup() now
        make simple_lookup() usable for filesystems that set ->s_d_op
        configfs: don't open-code d_alloc_name()
        __rpc_lookup_create_exclusive: pass string instead of qstr
        rpc_create_*_dir: don't bother with qstr
        llist: llist_add() can use llist_add_batch()
        llist: fix/simplify llist_add() and llist_add_batch()
        fput: turn "list_head delayed_fput_list" into llist_head
        fs/file_table.c:fput(): add comment
        Safer ABI for O_TMPFILE
      41d9884c
    • Al Viro's avatar
      sunrpc: now we can just set ->s_d_op · dae3794f
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      dae3794f