1. 07 4月, 2017 3 次提交
    • G
      sparc32: Export vac_cache_size to fix build error · 9d262d95
      Guenter Roeck 提交于
      sparc32:allmodconfig fails to build with the following error.
      
      ERROR: "vac_cache_size" [drivers/infiniband/sw/rxe/rdma_rxe.ko] undefined!
      
      Fixes: cb886455 ("infiniband: Fix alignment of mmap cookies ...")
      Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d262d95
    • N
      sparc64: Fix memory corruption when THP is enabled · 76811263
      Nitin Gupta 提交于
      The memory corruption was happening due to incorrect
      TLB/TSB flushing of hugepages.
      Reported-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NNitin Gupta <nitin.m.gupta@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76811263
    • T
      sparc64: Fix kernel panic due to erroneous #ifdef surrounding pmd_write() · 9ae34dbd
      Tom Hromatka 提交于
      This commit moves sparc64's prototype of pmd_write() outside
      of the CONFIG_TRANSPARENT_HUGEPAGE ifdef.
      
      In 2013, commit a7b9403f ("sparc64: Encode huge PMDs using PTE
      encoding.") exposed a path where pmd_write() could be called without
      CONFIG_TRANSPARENT_HUGEPAGE defined.  This can result in the panic below.
      
      The diff is awkward to read, but the changes are straightforward.
      pmd_write() was moved outside of #ifdef CONFIG_TRANSPARENT_HUGEPAGE.
      Also, __HAVE_ARCH_PMD_WRITE was defined.
      
      kernel BUG at include/asm-generic/pgtable.h:576!
                    \|/ ____ \|/
                    "@'/ .. \`@"
                    /_| \__/ |_\
                       \__U_/
      oracle_8114_cdb(8114): Kernel bad sw trap 5 [#1]
      CPU: 120 PID: 8114 Comm: oracle_8114_cdb Not tainted
      4.1.12-61.7.1.el6uek.rc1.sparc64 #1
      task: fff8400700a24d60 ti: fff8400700bc4000 task.ti: fff8400700bc4000
      TSTATE: 0000004411e01607 TPC: 00000000004609f8 TNPC: 00000000004609fc Y:
      00000005    Not tainted
      TPC: <gup_huge_pmd+0x198/0x1e0>
      g0: 000000000001c000 g1: 0000000000ef3954 g2: 0000000000000000 g3: 0000000000000001
      g4: fff8400700a24d60 g5: fff8001fa5c10000 g6: fff8400700bc4000 g7: 0000000000000720
      o0: 0000000000bc5058 o1: 0000000000000240 o2: 0000000000006000 o3: 0000000000001c00
      o4: 0000000000000000 o5: 0000048000080000 sp: fff8400700bc6ab1 ret_pc: 00000000004609f0
      RPC: <gup_huge_pmd+0x190/0x1e0>
      l0: fff8400700bc74fc l1: 0000000000020000 l2: 0000000000002000 l3: 0000000000000000
      l4: fff8001f93250950 l5: 000000000113f800 l6: 0000000000000004 l7: 0000000000000000
      i0: fff8400700ca46a0 i1: bd0000085e800453 i2: 000000026a0c4000 i3: 000000026a0c6000
      i4: 0000000000000001 i5: fff800070c958de8 i6: fff8400700bc6b61 i7: 0000000000460dd0
      I7: <gup_pud_range+0x170/0x1a0>
      Call Trace:
       [0000000000460dd0] gup_pud_range+0x170/0x1a0
       [0000000000460e84] get_user_pages_fast+0x84/0x120
       [00000000006f5a18] iov_iter_get_pages+0x98/0x240
       [00000000005fa744] do_direct_IO+0xf64/0x1e00
       [00000000005fbbc0] __blockdev_direct_IO+0x360/0x15a0
       [00000000101f74fc] ext4_ind_direct_IO+0xdc/0x400 [ext4]
       [00000000101af690] ext4_ext_direct_IO+0x1d0/0x2c0 [ext4]
       [00000000101af86c] ext4_direct_IO+0xec/0x220 [ext4]
       [0000000000553bd4] generic_file_read_iter+0x114/0x140
       [00000000005bdc2c] __vfs_read+0xac/0x100
       [00000000005bf254] vfs_read+0x54/0x100
       [00000000005bf368] SyS_pread64+0x68/0x80
      Signed-off-by: NTom Hromatka <tom.hromatka@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ae34dbd
  2. 28 3月, 2017 4 次提交
    • B
      arch/sparc: Avoid DCTI Couples · 0ae2d26f
      Babu Moger 提交于
      Avoid un-intended DCTI Couples. Use of DCTI couples is deprecated.
      Also address the "Programming Note" for optimal performance.
      
      Here is the complete text from Oracle SPARC Architecture Specs.
      
      6.3.4.7 DCTI Couples
      "A delayed control transfer instruction (DCTI) in the delay slot of
      another DCTI is referred to as a “DCTI couple”. The use of DCTI couples
      is deprecated in the Oracle SPARC Architecture; no new software should
      place a DCTI in the delay slot of another DCTI, because on future Oracle
      SPARC Architecture implementations DCTI couples may execute either
      slowly or differently than the programmer assumes it will.
      
      SPARC V8 and SPARC V9 Compatibility Note
      The SPARC V8 architecture left behavior undefined for a DCTI couple. The
      SPARC V9 architecture defined behavior in that case, but as of
      UltraSPARC Architecture 2005, use of DCTI couples was deprecated.
      Software should not expect high performance from DCTI couples, and
      performance of DCTI couples should be expected to decline further in
      future processors.
      
      Programming Note
      As noted in TABLE 6-5 on page 115, an annulled branch-always
      (branch-always with a = 1) instruction is not architecturally a DCTI.
      However, since not all implementations make that distinction, for
      optimal performance, a DCTI should not be placed in the instruction word
      immediately following an annulled branch-always instruction (BA,A or
      BPA,A)."
      Signed-off-by: NBabu Moger <babu.moger@oracle.com>
      Reviewed-by: NRob Gardner <rob.gardner@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0ae2d26f
    • B
      sparc64: kern_addr_valid regression · adfae8a5
      bob picco 提交于
      I encountered this bug when using /proc/kcore to examine the kernel. Plus a
      coworker inquired about debugging tools. We computed pa but did
      not use it during the maximum physical address bits test. Instead we used
      the identity mapped virtual address which will always fail this test.
      
      I believe the defect came in here:
      [bpicco@zareason linus.git]$ git describe --contains bb4e6e85
      v3.18-rc1~87^2~4
      .
      Signed-off-by: NBob Picco <bob.picco@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      adfae8a5
    • N
      sparc64: Add support for 2G hugepages · 85b1da7c
      Nitin Gupta 提交于
      Signed-off-by: NNitin Gupta <nitin.m.gupta@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85b1da7c
    • N
      59f1183d
  3. 23 3月, 2017 1 次提交
  4. 22 3月, 2017 2 次提交
    • N
      arm64: kaslr: Fix up the kernel image alignment · afd0e5a8
      Neeraj Upadhyay 提交于
      If kernel image extends across alignment boundary, existing
      code increases the KASLR offset by size of kernel image. The
      offset is masked after resizing. There are cases, where after
      masking, we may still have kernel image extending across
      boundary. This eventually results in only 2MB block getting
      mapped while creating the page tables. This results in data aborts
      while accessing unmapped regions during second relocation (with
      kaslr offset) in __primary_switch. To fix this problem, round up the
      kernel image size, by swapper block size, before adding it for
      correction.
      
      For example consider below case, where kernel image still crosses
      1GB alignment boundary, after masking the offset, which is fixed
      by rounding up kernel image size.
      
      SWAPPER_TABLE_SHIFT = 30
      Swapper using section maps with section size 2MB.
      CONFIG_PGTABLE_LEVELS = 3
      VA_BITS = 39
      
      _text  : 0xffffff8008080000
      _end   : 0xffffff800aa1b000
      offset : 0x1f35600000
      mask = ((1UL << (VA_BITS - 2)) - 1) & ~(SZ_2M - 1)
      
      (_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7c
      (_end + offset) >> SWAPPER_TABLE_SHIFT  = 0x3fffffe7d
      
      offset after existing correction (before mask) = 0x1f37f9b000
      (_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
      (_end + offset) >> SWAPPER_TABLE_SHIFT  = 0x3fffffe7d
      
      offset (after mask) = 0x1f37e00000
      (_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7c
      (_end + offset) >> SWAPPER_TABLE_SHIFT  = 0x3fffffe7d
      
      new offset w/ rounding up = 0x1f38000000
      (_text + offset) >> SWAPPER_TABLE_SHIFT = 0x3fffffe7d
      (_end + offset) >> SWAPPER_TABLE_SHIFT  = 0x3fffffe7d
      
      Fixes: f80fb3a3 ("arm64: add support for kernel ASLR")
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NNeeraj Upadhyay <neeraju@codeaurora.org>
      Signed-off-by: NSrinivas Ramana <sramana@codeaurora.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      afd0e5a8
    • W
      arm64: compat: Update compat syscalls · 713cc9df
      Will Deacon 提交于
      Hook up three pkey syscalls (which we don't implement) and the new statx
      syscall, as has been done for arch/arm/.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      713cc9df
  5. 21 3月, 2017 1 次提交
  6. 20 3月, 2017 6 次提交
  7. 19 3月, 2017 2 次提交
  8. 17 3月, 2017 5 次提交
  9. 16 3月, 2017 6 次提交
  10. 15 3月, 2017 6 次提交
    • S
      openrisc: Export symbols needed by modules · 363dad58
      Stafford Horne 提交于
      This was detected by allmodconfig, errors reported:
      
       ERROR: "empty_zero_page" [net/ceph/libceph.ko] undefined!
       ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined!
       ERROR: "empty_zero_page" [fs/nfs/objlayout/objlayoutdriver.ko] undefined!
       ERROR: "empty_zero_page" [fs/exofs/exofs.ko] undefined!
       ERROR: "empty_zero_page" [fs/crypto/fscrypto.ko] undefined!
       ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined!
       ERROR: "pm_power_off" [drivers/regulator/act8865-regulator.ko] undefined!
       ERROR: "__ucmpdi2" [drivers/media/i2c/adv7842.ko] undefined!
       ERROR: "__clear_user" [drivers/md/dm-mod.ko] undefined!
       ERROR: "__clear_user" [net/netfilter/x_tables.ko] undefined!
      Signed-off-by: NStafford Horne <shorne@gmail.com>
      363dad58
    • S
      openrisc: fix issue handling 8 byte get_user calls · 154e67cd
      Stafford Horne 提交于
      Was getting the following error with allmodconfig:
      
        ERROR: "__get_user_bad" [lib/test_user_copy.ko] undefined!
      
      This was simply a missing break statement, causing an unwanted fall
      through.
      Signed-off-by: NStafford Horne <shorne@gmail.com>
      154e67cd
    • S
      openrisc: xchg: fix `computed is not used` warning · 8af42949
      Stafford Horne 提交于
      When building allmodconfig this warning shows.
      
        fs/ocfs2/file.c: In function 'ocfs2_file_write_iter':
        ./arch/openrisc/include/asm/cmpxchg.h:81:3: warning: value computed is
        not used [-Wunused-value]
          ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr))))
           ^
      
      Applying the same patch logic that was done to the cmpxchg macro.
      Signed-off-by: NStafford Horne <shorne@gmail.com>
      8af42949
    • J
      x86/intel_rdt: Put group node in rdtgroup_kn_unlock · 49ec8f5b
      Jiri Olsa 提交于
      The rdtgroup_kn_unlock waits for the last user to release and put its
      node. But it's calling kernfs_put on the node which calls the
      rdtgroup_kn_unlock, which might not be the group's directory node, but
      another group's file node.
      
      This race could be easily reproduced by running 2 instances
      of following script:
      
        mount -t resctrl resctrl /sys/fs/resctrl/
        pushd /sys/fs/resctrl/
        mkdir krava
        echo "krava" > krava/schemata
        rmdir krava
        popd
        umount  /sys/fs/resctrl
      
      It triggers the slub debug error message with following command
      line config: slub_debug=,kernfs_node_cache.
      
      Call kernfs_put on the group's node to fix it.
      
      Fixes: 60cf5e10 ("x86/intel_rdt: Add mkdir to resctrl file system")
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Shaohua Li <shli@fb.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1489501253-20248-1-git-send-email-jolsa@kernel.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      49ec8f5b
    • J
      x86/unwind: Fix last frame check for aligned function stacks · 87a6b297
      Josh Poimboeuf 提交于
      Pavel Machek reported the following warning on x86-32:
      
        WARNING: kernel stack frame pointer at f50cdf98 in swapper/2:0 has bad value   (null)
      
      The warning is caused by the unwinder not realizing that it reached the
      end of the stack, due to an unusual prologue which gcc sometimes
      generates for aligned stacks.  The prologue is based on a gcc feature
      called the Dynamic Realign Argument Pointer (DRAP).  It's almost always
      enabled for aligned stacks when -maccumulate-outgoing-args isn't set.
      
      This issue is similar to the one fixed by the following commit:
      
        8023e0e2 ("x86/unwind: Adjust last frame check for aligned function stacks")
      
      ... but that fix was specific to x86-64.
      
      Make the fix more generic to cover x86-32 as well, and also ensure that
      the return address referred to by the frame pointer is a copy of the
      original return address.
      
      Fixes: acb4608a ("x86/unwind: Create stack frames for saved syscall registers")
      Reported-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/50d4924db716c264b14f1633037385ec80bf89d2.1489465609.git.jpoimboe@redhat.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      87a6b297
    • A
      mm, x86: Fix native_pud_clear build error · d434936e
      Arnd Bergmann 提交于
      We still get a build error in random configurations, after this has been
      modified a few times:
      
      In file included from include/linux/mm.h:68:0,
                       from include/linux/suspend.h:8,
                       from arch/x86/kernel/asm-offsets.c:12:
      arch/x86/include/asm/pgtable.h:66:26: error: redefinition of 'native_pud_clear'
       #define pud_clear(pud)   native_pud_clear(pud)
      
      My interpretation is that the build error comes from a typo in __PAGETABLE_PUD_FOLDED,
      so fix that typo now, and remove the incorrect #ifdef around the native_pud_clear
      definition.
      
      Fixes: 3e761a42 ("mm, x86: fix HIGHMEM64 && PARAVIRT build config for native_pud_clear()")
      Fixes: a00cc7d9 ("mm, x86: add support for PUD-sized transparent hugepages")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NDave Jiang <dave.jiang@intel.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Thomas Garnier <thgarnie@google.com>
      Link: http://lkml.kernel.org/r/20170314121330.182155-1-arnd@arndb.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      d434936e
  11. 14 3月, 2017 4 次提交