1. 23 Apr, 2019 2 commits
    • Martin Schwidefsky's avatar
      s390/mm: convert to the generic get_user_pages_fast code · 1a42010c
      Martin Schwidefsky authored
      Define the gup_fast_permitted to check against the asce_limit of the
      mm attached to the current task, then replace the s390 specific gup
      code with the generic implementation in mm/gup.c.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      1a42010c
    • Martin Schwidefsky's avatar
      s390/mm: make the pxd_offset functions more robust · d1874a0c
      Martin Schwidefsky authored
      Change the way how pgd_offset, p4d_offset, pud_offset and pmd_offset
      walk the page tables. pgd_offset now always calculates the index for
      the top-level page table and adds it to the pgd, this is either a
      segment table offset for a 2-level setup, a region-3 offset for 3-levels,
      region-2 offset for 4-levels, or a region-1 offset for a 5-level setup.
      The other three functions p4d_offset, pud_offset and pmd_offset will
      only add the respective offset if they dereference the passed pointer.
      
      With the new way of walking the page tables a sequence like this from
      mm/gup.c now works:
      
           pgdp = pgd_offset(current->mm, addr);
           pgd = READ_ONCE(*pgdp);
           p4dp = p4d_offset(&pgd, addr);
           p4d = READ_ONCE(*p4dp);
           pudp = pud_offset(&p4d, addr);
           pud = READ_ONCE(*pudp);
           pmdp = pmd_offset(&pud, addr);
           pmd = READ_ONCE(*pmdp);
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      d1874a0c
  2. 18 Apr, 2019 2 commits
  3. 11 Apr, 2019 9 commits
    • Arnd Bergmann's avatar
      s390: zcrypt: initialize variables before_use · 913140e2
      Arnd Bergmann authored
      The 'func_code' variable gets printed in debug statements without
      a prior initialization in multiple functions, as reported when building
      with clang:
      
      drivers/s390/crypto/zcrypt_api.c:659:6: warning: variable 'func_code' is used uninitialized whenever 'if' condition is true
            [-Wsometimes-uninitialized]
              if (mex->outputdatalength < mex->inputdatalength) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/s390/crypto/zcrypt_api.c:725:29: note: uninitialized use occurs here
              trace_s390_zcrypt_rep(mex, func_code, rc,
                                         ^~~~~~~~~
      drivers/s390/crypto/zcrypt_api.c:659:2: note: remove the 'if' if its condition is always false
              if (mex->outputdatalength < mex->inputdatalength) {
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/s390/crypto/zcrypt_api.c:654:24: note: initialize the variable 'func_code' to silence this warning
              unsigned int func_code;
                                    ^
      
      Add initializations to all affected code paths to shut up the warning
      and make the warning output consistent.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      913140e2
    • Arnd Bergmann's avatar
      s390: avoid __builtin_return_address(n) on clang · 6e042492
      Arnd Bergmann authored
      llvm on s390 has problems with __builtin_return_address(n), with n>0,
      this results in a somewhat cryptic error message:
      
      fatal error: error in backend: Unsupported stack frame traversal count
      
      To work around it, use the direct return address directly. This
      is probably not ideal here, but gets things to compile and should
      only lead to inferior reporting, not to misbehavior of the generated
      code.
      
      Link: https://bugs.llvm.org/show_bug.cgi?id=41424Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      6e042492
    • Joe Perches's avatar
      s390: Convert IS_ENABLED uses to __is_defined · 475c8e9e
      Joe Perches authored
      IS_ENABLED should be reserved for CONFIG_<FOO> uses so convert
      the uses of IS_ENABLED with a #define to __is_defined.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      475c8e9e
    • Arnd Bergmann's avatar
      s390: make chkbss work with clang · 9a0ceb9c
      Arnd Bergmann authored
      llvm skips an empty .bss section entirely, which makes
      the check fail with an unexpected error:
      
      /tmp/binutils-multi-test/bin/s390x-linux-gnu-objdump: section '.bss' mentioned in a -j option, but not found in any input file
      error: arch/s390/boot/compressed/decompressor.o .bss section is not empty
      ../arch/s390/scripts/Makefile.chkbss:20: recipe for target 'arch/s390/boot/compressed/decompressor.o.chkbss' failed
      
      Change the check so we first see if a .bss section exists
      before trying to read its size.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      9a0ceb9c
    • Arnd Bergmann's avatar
      s390: make __load_psw_mask work with clang · 0a113efc
      Arnd Bergmann authored
      clang fails to use the %O and %R inline assembly modifiers
      the same way as gcc, leading to build failures with every use
      of __load_psw_mask():
      
      /tmp/nmi-4a9f80.s: Assembler messages:
      /tmp/nmi-4a9f80.s:571: Error: junk at end of line: `+8(160(%r11))'
      /tmp/nmi-4a9f80.s:626: Error: junk at end of line: `+8(160(%r11))'
      
      Replace these with a more conventional way of passing the addresses
      that should work with both clang and gcc.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      0a113efc
    • Arnd Bergmann's avatar
      s390: syscall_wrapper: avoid clang warning · efb150df
      Arnd Bergmann authored
      Building system calls with clang results in a warning
      about an alias from a global function to a static one:
      
      ../fs/namei.c:3847:1: warning: unused function '__se_sys_mkdirat' [-Wunused-function]
      SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
      ^
      ../include/linux/syscalls.h:219:36: note: expanded from macro 'SYSCALL_DEFINE3'
       #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
                                         ^
      ../include/linux/syscalls.h:228:2: note: expanded from macro 'SYSCALL_DEFINEx'
              __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
              ^
      ../arch/s390/include/asm/syscall_wrapper.h:126:18: note: expanded from macro '__SYSCALL_DEFINEx'
              asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__))          \
                              ^
      <scratch space>:31:1: note: expanded from here
      __se_sys_mkdirat
      ^
      
      The only reference to the static __se_sys_mkdirat() here is the alias, but
      this only gets evaluated later. Making this function global as well avoids
      the warning.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      efb150df
    • Arnd Bergmann's avatar
      s390: don't build vdso32 with clang · 96ca7674
      Arnd Bergmann authored
      clang does not support 31 bit object files on s390, so skip
      the 32-bit vdso here, and only build it when using gcc to compile
      the kernel.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      96ca7674
    • Arnd Bergmann's avatar
      s390: remove -fno-strength-reduce flag · c1afcaec
      Arnd Bergmann authored
      This was added as a workaround for really old compilers, and it prevents
      building with clang now. I can see no reason for keeping it, as it has
      already been removed for most architectures in the pre-git era, so
      let's remove it everywhere, rather than only for clang.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      c1afcaec
    • Martin Schwidefsky's avatar
      s390: fine-tune stack switch helper · 7aa0055e
      Martin Schwidefsky authored
      The CALL_ON_STACK helper currently does not work with clang and for
      calls without arguments. It does not initialize r2 although the constraint
      is "+&d". Rework the CALL_FMT_x and the CALL_ON_STACK macros to work
      with clang and produce optimal code in all cases.
      Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      7aa0055e
  4. 10 Apr, 2019 13 commits
  5. 29 Mar, 2019 5 commits
  6. 28 Mar, 2019 6 commits
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.1-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 9936328b
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
       "PCI fixes:
      
         - Clear level-triggered interrupts for the bandwidth notification
           supported added for v5.1 (Alexandru Gagniuc)
      
         - Clear bandwidth notification interrupts before enabling them (Lukas
           Wunner)
      
         - Report post-enumeration bandwidth changes only once for
           multi-function devices (Lukas Wunner)"
      
      * tag 'pci-v5.1-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI/LINK: Deduplicate bandwidth reports for multi-function devices
        PCI/LINK: Clear bandwidth notification interrupt before enabling it
        PCI/LINK: Supply IRQ handler so level-triggered IRQs are acked
      9936328b
    • David Howells's avatar
      afs: Fix StoreData op marshalling · 8c7ae38d
      David Howells authored
      The marshalling of AFS.StoreData, AFS.StoreData64 and YFS.StoreData64 calls
      generated by ->setattr() ops for the purpose of expanding a file is
      incorrect due to older documentation incorrectly describing the way the RPC
      'FileLength' parameter is meant to work.
      
      The older documentation says that this is the length the file is meant to
      end up at the end of the operation; however, it was never implemented this
      way in any of the servers, but rather the file is truncated down to this
      before the write operation is effected, and never expanded to it (and,
      indeed, it was renamed to 'TruncPos' in 2014).
      
      Fix this by setting the position parameter to the new file length and doing
      a zero-lengh write there.
      
      The bug causes Xwayland to SIGBUS due to unexpected non-expansion of a file
      it then mmaps.  This can be tested by giving the following test program a
      filename in an AFS directory:
      
      	#include <stdio.h>
      	#include <stdlib.h>
      	#include <unistd.h>
      	#include <fcntl.h>
      	#include <sys/mman.h>
      	int main(int argc, char *argv[])
      	{
      		char *p;
      		int fd;
      		if (argc != 2) {
      			fprintf(stderr,
      				"Format: test-trunc-mmap <file>\n");
      			exit(2);
      		}
      		fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC);
      		if (fd < 0) {
      			perror(argv[1]);
      			exit(1);
      		}
      		if (ftruncate(fd, 0x140008) == -1) {
      			perror("ftruncate");
      			exit(1);
      		}
      		p = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
      			 MAP_SHARED, fd, 0);
      		if (p == MAP_FAILED) {
      			perror("mmap");
      			exit(1);
      		}
      		p[0] = 'a';
      		if (munmap(p, 4096) < 0) {
      			perror("munmap");
      			exit(1);
      		}
      		if (close(fd) < 0) {
      			perror("close");
      			exit(1);
      		}
      		exit(0);
      	}
      
      Fixes: 31143d5d ("AFS: implement basic file write support")
      Reported-by: default avatarJonathan Billings <jsbillin@umich.edu>
      Tested-by: default avatarJonathan Billings <jsbillin@umich.edu>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8c7ae38d
    • David Howells's avatar
      vfs: Update mount API docs · 7d6ab823
      David Howells authored
      Update the mount API docs to reflect recent changes to the code.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7d6ab823
    • Linus Torvalds's avatar
      Merge tag 's390-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · bfed6d0f
      Linus Torvalds authored
      Pull s390 fixes from Martin Schwidefsky:
       "Improvements and bug fixes for 5.1-rc2:
      
         - Fix early free of the channel program in vfio
      
         - On AP device removal make sure that all messages are flushed with
           the driver still attached that queued the message
      
         - Limit brk randomization to 32MB to reduce the chance that the heap
           of ld.so is placed after the main stack
      
         - Add a rolling average for the steal time of a CPU, this will be
           needed for KVM to decide when to do busy waiting
      
         - Fix a warning in the CPU-MF code
      
         - Add a notification handler for AP configuration change to react
           faster to new AP devices"
      
      * tag 's390-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/cpumf: Fix warning from check_processor_id
        zcrypt: handle AP Info notification from CHSC SEI command
        vfio: ccw: only free cp on final interrupt
        s390/vtime: steal time exponential moving average
        s390/zcrypt: revisit ap device remove procedure
        s390: limit brk randomization to 32MB
      bfed6d0f
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 97c41a6b
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "A couple of minor fixes only for now
      
         - fix for incorrect DMA channels on Renesas R-Car
      
         - Broadcom bcm2835 error handling fixes
      
         - Kconfig dependency fixes for bcm2835 and davinci
      
         - CPU idle wakeup fix for i.MX6
      
         - MMC regression on Tegra186
      
         - fix incorrect phy settings on one imx board"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        arm64: tegra: Disable CQE Support for SDMMC4 on Tegra186
        ARM: dts: nomadik: Fix polarity of SPI CS
        ARM: davinci: fix build failure with allnoconfig
        ARM: imx_v4_v5_defconfig: enable PWM driver
        ARM: imx_v6_v7_defconfig: continue compiling the pwm driver
        ARM: dts: imx6dl-yapp4: Use correct pseudo PHY address for the switch
        ARM: dts: imx6qdl: Fix typo in imx6qdl-icore-rqs.dtsi
        ARM: dts: imx6ull: Use the correct style for SPDX License Identifier
        ARM: dts: pfla02: increase phy reset duration
        ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time
        ARM: imx51: fix a leaked reference by adding missing of_node_put
        ARM: dts: imx6dl-yapp4: Use rgmii-id phy mode on the cpu port
        arm64: bcm2835: Add missing dependency on MFD_CORE.
        ARM: dts: bcm283x: Fix hdmi hpd gpio pull
        soc: bcm: bcm2835-pm: Fix error paths of initialization.
        soc: bcm: bcm2835-pm: Fix PM_IMAGE_PERI power domain support.
        arm64: dts: renesas: r8a774c0: Fix SCIF5 DMA channels
        arm64: dts: renesas: r8a77990: Fix SCIF5 DMA channels
      97c41a6b
    • Thomas Richter's avatar
      s390/cpumf: Fix warning from check_processor_id · b6ffdf27
      Thomas Richter authored
      Function __hw_perf_event_init() used a CPU variable without
      ensuring CPU preemption has been disabled. This caused the
      following warning in the kernel log:
      
        [ 7.277085] BUG: using smp_processor_id() in preemptible
                       [00000000] code: cf-csdiag/1892
        [ 7.277111] caller is cf_diag_event_init+0x13a/0x338
        [ 7.277122] CPU: 10 PID: 1892 Comm: cf-csdiag Not tainted
                       5.0.0-20190318.rc0.git0.9e1a11e0f602.300.fc29.s390x+debug #1
        [ 7.277131] Hardware name: IBM 2964 NC9 712 (LPAR)
        [ 7.277139] Call Trace:
        [ 7.277150] ([<000000000011385a>] show_stack+0x82/0xd0)
        [ 7.277161]  [<0000000000b7a71a>] dump_stack+0x92/0xd0
        [ 7.277174]  [<00000000007b7e9c>] check_preemption_disabled+0xe4/0x100
        [ 7.277183]  [<00000000001228aa>] cf_diag_event_init+0x13a/0x338
        [ 7.277195]  [<00000000002cf3aa>] perf_try_init_event+0x72/0xf0
        [ 7.277204]  [<00000000002d0bba>] perf_event_alloc+0x6fa/0xce0
        [ 7.277214]  [<00000000002dc4a8>] __s390x_sys_perf_event_open+0x398/0xd50
        [ 7.277224]  [<0000000000b9e8f0>] system_call+0xdc/0x2d8
        [ 7.277233] 2 locks held by cf-csdiag/1892:
        [ 7.277241]  #0: 00000000976f5510 (&sig->cred_guard_mutex){+.+.},
                        at: __s390x_sys_perf_event_open+0xd2e/0xd50
        [ 7.277257]  #1: 00000000363b11bd (&pmus_srcu){....},
                        at: perf_event_alloc+0x52e/0xce0
      
      The variable is now accessed in proper context. Use
      get_cpu_var()/put_cpu_var() pair to disable
      preemption during access.
      As the hardware authorization settings apply to all CPUs, it
      does not matter which CPU is used to check the authorization setting.
      
      Remove the event->count assignment. It is not needed as function
      perf_event_alloc() allocates memory for the event with kzalloc() and
      thus count is already set to zero.
      
      Fixes: fe5908bc ("s390/cpum_cf_diag: Add support for s390 counter facility diagnostic trace")
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      b6ffdf27
  7. 27 Mar, 2019 1 commit
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 1a9df9e2
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Fixes here and there, a couple new device IDs, as usual:
      
         1) Fix BQL race in dpaa2-eth driver, from Ioana Ciornei.
      
         2) Fix 64-bit division in iwlwifi, from Arnd Bergmann.
      
         3) Fix documentation for some eBPF helpers, from Quentin Monnet.
      
         4) Some UAPI bpf header sync with tools, also from Quentin Monnet.
      
         5) Set descriptor ownership bit at the right time for jumbo frames in
            stmmac driver, from Aaro Koskinen.
      
         6) Set IFF_UP properly in tun driver, from Eric Dumazet.
      
         7) Fix load/store doubleword instruction generation in powerpc eBPF
            JIT, from Naveen N. Rao.
      
         8) nla_nest_start() return value checks all over, from Kangjie Lu.
      
         9) Fix asoc_id handling in SCTP after the SCTP_*_ASSOC changes this
            merge window. From Marcelo Ricardo Leitner and Xin Long.
      
        10) Fix memory corruption with large MTUs in stmmac, from Aaro
            Koskinen.
      
        11) Do not use ipv4 header for ipv6 flows in TCP and DCCP, from Eric
            Dumazet.
      
        12) Fix topology subscription cancellation in tipc, from Erik Hugne.
      
        13) Memory leak in genetlink error path, from Yue Haibing.
      
        14) Valid control actions properly in packet scheduler, from Davide
            Caratti.
      
        15) Even if we get EEXIST, we still need to rehash if a shrink was
            delayed. From Herbert Xu.
      
        16) Fix interrupt mask handling in interrupt handler of r8169, from
            Heiner Kallweit.
      
        17) Fix leak in ehea driver, from Wen Yang"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (168 commits)
        dpaa2-eth: fix race condition with bql frame accounting
        chelsio: use BUG() instead of BUG_ON(1)
        net: devlink: skip info_get op call if it is not defined in dumpit
        net: phy: bcm54xx: Encode link speed and activity into LEDs
        tipc: change to check tipc_own_id to return in tipc_net_stop
        net: usb: aqc111: Extend HWID table by QNAP device
        net: sched: Kconfig: update reference link for PIE
        net: dsa: qca8k: extend slave-bus implementations
        net: dsa: qca8k: remove leftover phy accessors
        dt-bindings: net: dsa: qca8k: support internal mdio-bus
        dt-bindings: net: dsa: qca8k: fix example
        net: phy: don't clear BMCR in genphy_soft_reset
        bpf, libbpf: clarify bump in libbpf version info
        bpf, libbpf: fix version info and add it to shared object
        rxrpc: avoid clang -Wuninitialized warning
        tipc: tipc clang warning
        net: sched: fix cleanup NULL pointer exception in act_mirr
        r8169: fix cable re-plugging issue
        net: ethernet: ti: fix possible object reference leak
        net: ibm: fix possible object reference leak
        ...
      1a9df9e2
  8. 26 Mar, 2019 2 commits
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.1-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 14c741de
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "Highlights include:
      
        Stable fixes:
         - Fix nfs4_lock_state refcounting in nfs4_alloc_{lock,unlock}data()
         - fix mount/umount race in nlmclnt.
         - NFSv4.1 don't free interrupted slot on open
      
        Bugfixes:
         - Don't let RPC_SOFTCONN tasks time out if the transport is connected
         - Fix a typo in nfs_init_timeout_values()
         - Fix layoutstats handling during read failovers
         - fix uninitialized variable warning"
      
      * tag 'nfs-for-5.1-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        SUNRPC: fix uninitialized variable warning
        pNFS/flexfiles: Fix layoutstats handling during read failovers
        NFS: Fix a typo in nfs_init_timeout_values()
        SUNRPC: Don't let RPC_SOFTCONN tasks time out if the transport is connected
        NFSv4.1 don't free interrupted slot on open
        NFS: fix mount/umount race in nlmclnt.
        NFS: Fix nfs4_lock_state refcounting in nfs4_alloc_{lock,unlock}data()
      14c741de
    • Alakesh Haloi's avatar
      SUNRPC: fix uninitialized variable warning · 01f2f5b8
      Alakesh Haloi authored
      Avoid following compiler warning on uninitialized variable
      
      net/sunrpc/xprtsock.c: In function ‘xs_read_stream_request.constprop’:
      net/sunrpc/xprtsock.c:525:10: warning: ‘read’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         return read;
                ^~~~
      net/sunrpc/xprtsock.c:529:23: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        return ret < 0 ? ret : read;
               ~~~~~~~~~~~~~~^~~~~~
      Signed-off-by: default avatarAlakesh Haloi <alakesh.haloi@gmail.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      01f2f5b8