lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 26 May 2021 06:22:59 +0800
From:   kernel test robot <lkp@...el.com>
To:     Marco Elver <elver@...gle.com>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org, nathan@...nel.org,
        ndesaulniers@...gle.com, ojeda@...nel.org, keescook@...omium.org,
        akpm@...ux-foundation.org, will@...nel.org, ardb@...nel.org,
        luc.vanoostenryck@...il.com
Subject: Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all
 architectures

Hi Marco,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linux/master]
[also build test WARNING on kees/for-next/pstore linus/master v5.13-rc3 next-20210525]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Marco-Elver/kcov-add-__no_sanitize_coverage-to-fix-noinstr-for-all-architectures/20210526-020046
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd860052c99b1e088352bdd4fb7aef46f8d2ef47
config: s390-randconfig-r002-20210525 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 99155e913e9bad5f7f8a247f8bb3a3ff3da74af1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://github.com/0day-ci/linux/commit/d898fa12bc72a46da1b9466bb7f8369949b714a9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Marco-Elver/kcov-add-__no_sanitize_coverage-to-fix-noinstr-for-all-architectures/20210526-020046
        git checkout d898fa12bc72a46da1b9466bb7f8369949b714a9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                                                             ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
   #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
                                                        ^
   In file included from arch/s390/kernel/traps.c:29:
   In file included from include/linux/entry-common.h:6:
   In file included from include/linux/tracehook.h:50:
   In file included from include/linux/memcontrol.h:22:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:23:
   In file included from include/linux/blkdev.h:25:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
   #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                        ^
   In file included from arch/s390/kernel/traps.c:29:
   In file included from include/linux/entry-common.h:6:
   In file included from include/linux/tracehook.h:50:
   In file included from include/linux/memcontrol.h:22:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:23:
   In file included from include/linux/blkdev.h:25:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   In file included from arch/s390/kernel/traps.c:29:
   include/linux/entry-common.h:450:18: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs);
                    ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   In file included from arch/s390/kernel/traps.c:29:
   include/linux/entry-common.h:476:6: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   void noinstr irqentry_exit(struct pt_regs *regs, irqentry_state_t state);
        ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   In file included from arch/s390/kernel/traps.c:29:
   include/linux/entry-common.h:484:18: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   irqentry_state_t noinstr irqentry_nmi_enter(struct pt_regs *regs);
                    ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   In file included from arch/s390/kernel/traps.c:29:
   include/linux/entry-common.h:495:6: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   void noinstr irqentry_nmi_exit(struct pt_regs *regs, irqentry_state_t irq_state);
        ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
>> arch/s390/kernel/traps.c:299:6: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   void noinstr __do_pgm_check(struct pt_regs *regs)
        ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   17 warnings generated.
--
   include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                                                             ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
   #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
                                                        ^
   In file included from arch/s390/kernel/syscall.c:34:
   In file included from include/linux/entry-common.h:6:
   In file included from include/linux/tracehook.h:50:
   In file included from include/linux/memcontrol.h:22:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:23:
   In file included from include/linux/blkdev.h:25:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
   #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                        ^
   In file included from arch/s390/kernel/syscall.c:34:
   In file included from include/linux/entry-common.h:6:
   In file included from include/linux/tracehook.h:50:
   In file included from include/linux/memcontrol.h:22:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:23:
   In file included from include/linux/blkdev.h:25:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   In file included from arch/s390/kernel/syscall.c:34:
   include/linux/entry-common.h:450:18: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   irqentry_state_t noinstr irqentry_enter(struct pt_regs *regs);
                    ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   In file included from arch/s390/kernel/syscall.c:34:
   include/linux/entry-common.h:476:6: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   void noinstr irqentry_exit(struct pt_regs *regs, irqentry_state_t state);
        ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   In file included from arch/s390/kernel/syscall.c:34:
   include/linux/entry-common.h:484:18: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   irqentry_state_t noinstr irqentry_nmi_enter(struct pt_regs *regs);
                    ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   In file included from arch/s390/kernel/syscall.c:34:
   include/linux/entry-common.h:495:6: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   void noinstr irqentry_nmi_exit(struct pt_regs *regs, irqentry_state_t irq_state);
        ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
>> arch/s390/kernel/syscall.c:143:6: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   void noinstr __do_syscall(struct pt_regs *regs, int per_trap)
        ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   17 warnings generated.
--
   In file included from arch/s390/kernel/nmi.c:33:
   In file included from include/linux/kvm_host.h:33:
   In file included from include/linux/kvm_para.h:5:
   In file included from include/uapi/linux/kvm_para.h:36:
   In file included from arch/s390/include/asm/kvm_para.h:25:
   In file included from arch/s390/include/asm/diag.h:12:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                                                             ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
   #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
                                                        ^
   In file included from arch/s390/kernel/nmi.c:33:
   In file included from include/linux/kvm_host.h:33:
   In file included from include/linux/kvm_para.h:5:
   In file included from include/uapi/linux/kvm_para.h:36:
   In file included from arch/s390/include/asm/kvm_para.h:25:
   In file included from arch/s390/include/asm/diag.h:12:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
   #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                        ^
   In file included from arch/s390/kernel/nmi.c:33:
   In file included from include/linux/kvm_host.h:33:
   In file included from include/linux/kvm_para.h:5:
   In file included from include/uapi/linux/kvm_para.h:36:
   In file included from arch/s390/include/asm/kvm_para.h:25:
   In file included from arch/s390/include/asm/diag.h:12:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:31:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> arch/s390/kernel/nmi.c:182:6: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   void noinstr s390_handle_mcck(void)
        ^
   include/linux/compiler_types.h:213:35: note: expanded from macro 'noinstr'
           __no_kcsan __no_sanitize_address __no_sanitize_coverage
                                            ^
   include/linux/compiler-clang.h:49:59: note: expanded from macro '__no_sanitize_coverage'
   #define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
                                                             ^
   13 warnings generated.
..


vim +/coverage +299 arch/s390/kernel/traps.c

6f8daa2953ecd1 Heiko Carstens 2021-04-07  298  
56e62a73702836 Sven Schnelle  2020-11-21 @299  void noinstr __do_pgm_check(struct pt_regs *regs)
56e62a73702836 Sven Schnelle  2020-11-21  300  {
56e62a73702836 Sven Schnelle  2020-11-21  301  	unsigned long last_break = S390_lowcore.breaking_event_addr;
56e62a73702836 Sven Schnelle  2020-11-21  302  	unsigned int trapnr, syscall_redirect = 0;
56e62a73702836 Sven Schnelle  2020-11-21  303  	irqentry_state_t state;
56e62a73702836 Sven Schnelle  2020-11-21  304  
bae1cd368c45d1 Sven Schnelle  2021-04-29  305  	add_random_kstack_offset();
56e62a73702836 Sven Schnelle  2020-11-21  306  	regs->int_code = *(u32 *)&S390_lowcore.pgm_ilc;
56e62a73702836 Sven Schnelle  2020-11-21  307  	regs->int_parm_long = S390_lowcore.trans_exc_code;
56e62a73702836 Sven Schnelle  2020-11-21  308  
56e62a73702836 Sven Schnelle  2020-11-21  309  	state = irqentry_enter(regs);
56e62a73702836 Sven Schnelle  2020-11-21  310  
56e62a73702836 Sven Schnelle  2020-11-21  311  	if (user_mode(regs)) {
56e62a73702836 Sven Schnelle  2020-11-21  312  		update_timer_sys();
56e62a73702836 Sven Schnelle  2020-11-21  313  		if (last_break < 4096)
56e62a73702836 Sven Schnelle  2020-11-21  314  			last_break = 1;
56e62a73702836 Sven Schnelle  2020-11-21  315  		current->thread.last_break = last_break;
56e62a73702836 Sven Schnelle  2020-11-21  316  		regs->args[0] = last_break;
56e62a73702836 Sven Schnelle  2020-11-21  317  	}
56e62a73702836 Sven Schnelle  2020-11-21  318  
56e62a73702836 Sven Schnelle  2020-11-21  319  	if (S390_lowcore.pgm_code & 0x0200) {
56e62a73702836 Sven Schnelle  2020-11-21  320  		/* transaction abort */
56e62a73702836 Sven Schnelle  2020-11-21  321  		memcpy(&current->thread.trap_tdb, &S390_lowcore.pgm_tdb, 256);
56e62a73702836 Sven Schnelle  2020-11-21  322  	}
56e62a73702836 Sven Schnelle  2020-11-21  323  
56e62a73702836 Sven Schnelle  2020-11-21  324  	if (S390_lowcore.pgm_code & PGM_INT_CODE_PER) {
56e62a73702836 Sven Schnelle  2020-11-21  325  		if (user_mode(regs)) {
56e62a73702836 Sven Schnelle  2020-11-21  326  			struct per_event *ev = &current->thread.per_event;
56e62a73702836 Sven Schnelle  2020-11-21  327  
56e62a73702836 Sven Schnelle  2020-11-21  328  			set_thread_flag(TIF_PER_TRAP);
56e62a73702836 Sven Schnelle  2020-11-21  329  			ev->address = S390_lowcore.per_address;
56e62a73702836 Sven Schnelle  2020-11-21  330  			ev->cause = *(u16 *)&S390_lowcore.per_code;
56e62a73702836 Sven Schnelle  2020-11-21  331  			ev->paid = S390_lowcore.per_access_id;
56e62a73702836 Sven Schnelle  2020-11-21  332  		} else {
56e62a73702836 Sven Schnelle  2020-11-21  333  			/* PER event in kernel is kprobes */
56e62a73702836 Sven Schnelle  2020-11-21  334  			__arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);
56e62a73702836 Sven Schnelle  2020-11-21  335  			do_per_trap(regs);
56e62a73702836 Sven Schnelle  2020-11-21  336  			goto out;
56e62a73702836 Sven Schnelle  2020-11-21  337  		}
56e62a73702836 Sven Schnelle  2020-11-21  338  	}
56e62a73702836 Sven Schnelle  2020-11-21  339  
56e62a73702836 Sven Schnelle  2020-11-21  340  	if (!irqs_disabled_flags(regs->psw.mask))
56e62a73702836 Sven Schnelle  2020-11-21  341  		trace_hardirqs_on();
56e62a73702836 Sven Schnelle  2020-11-21  342  	__arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);
56e62a73702836 Sven Schnelle  2020-11-21  343  
56e62a73702836 Sven Schnelle  2020-11-21  344  	trapnr = regs->int_code & PGM_INT_CODE_MASK;
56e62a73702836 Sven Schnelle  2020-11-21  345  	if (trapnr)
56e62a73702836 Sven Schnelle  2020-11-21  346  		pgm_check_table[trapnr](regs);
56e62a73702836 Sven Schnelle  2020-11-21  347  	syscall_redirect = user_mode(regs) && test_pt_regs_flag(regs, PIF_SYSCALL);
56e62a73702836 Sven Schnelle  2020-11-21  348  out:
56e62a73702836 Sven Schnelle  2020-11-21  349  	local_irq_disable();
56e62a73702836 Sven Schnelle  2020-11-21  350  	irqentry_exit(regs, state);
56e62a73702836 Sven Schnelle  2020-11-21  351  
56e62a73702836 Sven Schnelle  2020-11-21  352  	if (syscall_redirect) {
56e62a73702836 Sven Schnelle  2020-11-21  353  		enter_from_user_mode(regs);
56e62a73702836 Sven Schnelle  2020-11-21  354  		local_irq_enable();
56e62a73702836 Sven Schnelle  2020-11-21  355  		regs->orig_gpr2 = regs->gprs[2];
56e62a73702836 Sven Schnelle  2020-11-21  356  		do_syscall(regs);
56e62a73702836 Sven Schnelle  2020-11-21  357  		exit_to_user_mode();
56e62a73702836 Sven Schnelle  2020-11-21  358  	}
56e62a73702836 Sven Schnelle  2020-11-21  359  }
6f8daa2953ecd1 Heiko Carstens 2021-04-07  360  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (24722 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ