1. 24 Apr, 2019 6 commits
  2. 23 Apr, 2019 3 commits
  3. 18 Apr, 2019 2 commits
  4. 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
  5. 10 Apr, 2019 13 commits
  6. 29 Mar, 2019 5 commits
  7. 28 Mar, 2019 2 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