All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
@ 2021-05-25 17:58 Marco Elver
  2021-05-25 18:25 ` Miguel Ojeda
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Marco Elver @ 2021-05-25 17:58 UTC (permalink / raw)
  To: elver
  Cc: linux-kernel, nathan, ndesaulniers, ojeda, keescook, akpm, will,
	ardb, luc.vanoostenryck, nivedita, masahiroy, peterz,
	samitolvanen, arnd, clang-built-linux, Dmitry Vyukov,
	Mark Rutland

Until now no compiler supported an attribute to disable coverage
instrumentation as used by KCOV.

To work around this limitation on x86, noinstr functions have their
coverage instrumentation turned into nops by objtool. However, this
solution doesn't scale automatically to other architectures, such as
arm64, which are migrating to use the generic entry code.

Clang [1] and GCC [2] have added support for the attribute recently.
[1] https://github.com/llvm/llvm-project/commit/280333021e9550d80f5c1152a34e33e81df1e178
[2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=cec4d4a6782c9bd8d071839c50a239c49caca689

Add __no_sanitize_coverage for both compilers, and add it to noinstr.

Signed-off-by: Marco Elver <elver@google.com>
---
 include/linux/compiler-clang.h | 6 ++++++
 include/linux/compiler-gcc.h   | 6 ++++++
 include/linux/compiler_types.h | 2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index adbe76b203e2..370565f4cfde 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -45,6 +45,12 @@
 #define __no_sanitize_undefined
 #endif
 
+#if defined(CONFIG_KCOV) && CONFIG_CLANG_VERSION >= 130000
+#define __no_sanitize_coverage __attribute__((no_sanitize("coverage")))
+#else
+#define __no_sanitize_coverage
+#endif
+
 /*
  * Not all versions of clang implement the type-generic versions
  * of the builtin overflow checkers. Fortunately, clang implements
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 5d97ef738a57..cb9217fc60af 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -122,6 +122,12 @@
 #define __no_sanitize_undefined
 #endif
 
+#if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__)
+#define __no_sanitize_coverage __attribute__((no_sanitize_coverage))
+#else
+#define __no_sanitize_coverage
+#endif
+
 #if GCC_VERSION >= 50100
 #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
 #endif
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index d29bda7f6ebd..cc2bee7f0977 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -210,7 +210,7 @@ struct ftrace_likely_data {
 /* Section for code which can't be instrumented at all */
 #define noinstr								\
 	noinline notrace __attribute((__section__(".noinstr.text")))	\
-	__no_kcsan __no_sanitize_address
+	__no_kcsan __no_sanitize_address __no_sanitize_coverage
 
 #endif /* __KERNEL__ */
 
-- 
2.31.1.818.g46aad6cb9e-goog


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 17:58 [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures Marco Elver
@ 2021-05-25 18:25 ` Miguel Ojeda
  2021-05-25 19:12   ` Marco Elver
  2021-05-25 22:22   ` kernel test robot
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: Miguel Ojeda @ 2021-05-25 18:25 UTC (permalink / raw)
  To: Marco Elver
  Cc: linux-kernel, Nathan Chancellor, Nick Desaulniers, Miguel Ojeda,
	Kees Cook, Andrew Morton, Will Deacon, Ard Biesheuvel,
	Luc Van Oostenryck, Arvind Sankar, Masahiro Yamada,
	Peter Zijlstra, Sami Tolvanen, Arnd Bergmann, clang-built-linux,
	Dmitry Vyukov, Mark Rutland

On Tue, May 25, 2021 at 7:59 PM Marco Elver <elver@google.com> wrote:
>
> +#if defined(CONFIG_KCOV) && CONFIG_CLANG_VERSION >= 130000

Is there any reason why Clang does not implement
`__has_attribute(__no_sanitize_coverage__)` like GCC? That way we can
merge both (perhaps even in `compiler_attributes.h`).

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 18:25 ` Miguel Ojeda
@ 2021-05-25 19:12   ` Marco Elver
  2021-05-26  1:53     ` Miguel Ojeda
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Elver @ 2021-05-25 19:12 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: linux-kernel, Nathan Chancellor, Nick Desaulniers, Miguel Ojeda,
	Kees Cook, Andrew Morton, Will Deacon, Ard Biesheuvel,
	Luc Van Oostenryck, Arvind Sankar, Masahiro Yamada,
	Peter Zijlstra, Sami Tolvanen, Arnd Bergmann, clang-built-linux,
	Dmitry Vyukov, Mark Rutland

On Tue, 25 May 2021 at 20:25, Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
> On Tue, May 25, 2021 at 7:59 PM Marco Elver <elver@google.com> wrote:
> >
> > +#if defined(CONFIG_KCOV) && CONFIG_CLANG_VERSION >= 130000
>
> Is there any reason why Clang does not implement
> `__has_attribute(__no_sanitize_coverage__)` like GCC? That way we can
> merge both (perhaps even in `compiler_attributes.h`).

It's complicated. Clang implements all no_sanitize options via
no_sanitize(<string_literal>), except for 3 which are there for
backwards-compatibility reasons (no_sanitize_{address,memory,thread}).
But otherwise, no_sanitize_sanitizer is deprecated in Clang in favor
of no_sanitize("sanitizer") per comment at
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/Attr.td#L2907.
(That being said, there's already inconsistency due to coverage
instrumentation requiring "-fsanitize-coverage=..." and not
"-fsanitize=coverage-...". The implementation vs other no_sanitize is
also a bit special, see LLVM commit.)

This means we only have __has_attribute(no_sanitize). Which is also
the reason why the other __no_sanitize_* defines in compiler-clang.h
first check the feature, as feature existence implies attribute
existence. But, sadly, this is not the case for coverage
instrumentation (where in fact, __has_feature(coverage_sanitizer)
doesn't work either...)

From a UX perspective, having Clang only give us no_sanitize("...")
without the corresponding __has_attribute() support is not great, but
passable due to __has_feature() working for other sanitizers. From
Clang's perspective, it kept things simpler because we've gotten quite
a number of sanitizers recently. The big ones are manageable [1], but
UBSan is just too much [2].
[1] https://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
[2] https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#ubsan-checks

This is probably a longer answer to your question, but is a summary of
the frustrations I encountered as I looked deeper into Clang's
no_sanitize attribute.

Long story short: this is not fixable without more Clang changes. The
only way to do it without a version check would be to introduce
no_sanitize_coverage attr to Clang, which we probably shouldn't do,
and I didn't want to fight it. ;-)

Thanks,
-- Marco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 17:58 [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures Marco Elver
@ 2021-05-25 22:22   ` kernel test robot
  2021-05-25 22:22   ` kernel test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: kernel test robot @ 2021-05-25 22:22 UTC (permalink / raw)
  To: Marco Elver
  Cc: kbuild-all, clang-built-linux, linux-kernel, nathan,
	ndesaulniers, ojeda, keescook, akpm, will, ardb,
	luc.vanoostenryck

[-- Attachment #1: Type: text/plain, Size: 28035 bytes --]

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@intel.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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24722 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
@ 2021-05-25 22:22   ` kernel test robot
  0 siblings, 0 replies; 16+ messages in thread
From: kernel test robot @ 2021-05-25 22:22 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 28453 bytes --]

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@intel.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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 24722 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 22:22   ` kernel test robot
@ 2021-05-25 22:29     ` Marco Elver
  -1 siblings, 0 replies; 16+ messages in thread
From: Marco Elver @ 2021-05-25 22:29 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, clang-built-linux, LKML, Nathan Chancellor,
	Nick Desaulniers, Miguel Ojeda, Kees Cook, Andrew Morton,
	Will Deacon, Ard Biesheuvel, Luc Van Oostenryck

On Wed, 26 May 2021 at 00:23, kernel test robot <lkp@intel.com> wrote:
[...]
> [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)

^^^ you're using a Clang pre-release, breakages are expected until
Clang 13 is final.

I think there was a thread about this at some point. I guess LKP has
decided that testing Clang pre-releases is fair game? I guess it's
useful, but this warning here needs to be ignored. It'll go away when
you rebuild your pre-release Clang 13 from the latest LLVM main
branch.

[...]
> >> 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")))
>                                                              ^

Clang 13 will support the attribute, but this is a pre-release Clang
13 -- so please ignore the report. FWIW, I tested my patch of course
with a version of Clang 13 that supports the attribute. :-)

Thanks,
-- Marco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
@ 2021-05-25 22:29     ` Marco Elver
  0 siblings, 0 replies; 16+ messages in thread
From: Marco Elver @ 2021-05-25 22:29 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2062 bytes --]

On Wed, 26 May 2021 at 00:23, kernel test robot <lkp@intel.com> wrote:
[...]
> [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)

^^^ you're using a Clang pre-release, breakages are expected until
Clang 13 is final.

I think there was a thread about this at some point. I guess LKP has
decided that testing Clang pre-releases is fair game? I guess it's
useful, but this warning here needs to be ignored. It'll go away when
you rebuild your pre-release Clang 13 from the latest LLVM main
branch.

[...]
> >> 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")))
>                                                              ^

Clang 13 will support the attribute, but this is a pre-release Clang
13 -- so please ignore the report. FWIW, I tested my patch of course
with a version of Clang 13 that supports the attribute. :-)

Thanks,
-- Marco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 17:58 [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures Marco Elver
@ 2021-05-25 23:21   ` kernel test robot
  2021-05-25 22:22   ` kernel test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: kernel test robot @ 2021-05-25 23:21 UTC (permalink / raw)
  To: Marco Elver
  Cc: kbuild-all, clang-built-linux, linux-kernel, nathan,
	ndesaulniers, ojeda, keescook, akpm, will, ardb,
	luc.vanoostenryck

[-- Attachment #1: Type: text/plain, Size: 28968 bytes --]

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: x86_64-randconfig-a001-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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-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=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from arch/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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")))
                                                             ^
   In file included from arch/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DECLARE_IDTENTRY_VC(X86_TRAP_VC,        exc_vmm_communication);
   ^
   arch/x86/include/asm/idtentry.h:315:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void ist_##func(struct pt_regs *regs, unsigned long error_code);      \
                     ^
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   arch/x86/include/asm/idtentry.h:316:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void safe_stack_##func(struct pt_regs *regs, unsigned long error_code)
                     ^
   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/x86/kernel/traps.c:49:
   arch/x86/include/asm/traps.h:18:22: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
                        ^
   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/x86/kernel/traps.c:201:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY(exc_divide_error)
   ^
   arch/x86/include/asm/idtentry.h:50:11: note: expanded from macro 'DEFINE_IDTENTRY'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:207:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY(exc_overflow)
   ^
   arch/x86/include/asm/idtentry.h:50:11: note: expanded from macro 'DEFINE_IDTENTRY'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:222:8: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   static noinstr bool handle_bug(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")))
                                                             ^
   arch/x86/kernel/traps.c:250:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_RAW(exc_invalid_op)
   ^
   arch/x86/include/asm/idtentry.h:136:11: note: expanded from macro 'DEFINE_IDTENTRY_RAW'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:269:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY(exc_coproc_segment_overrun)
   ^
   arch/x86/include/asm/idtentry.h:50:11: note: expanded from macro 'DEFINE_IDTENTRY'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:275:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_ERRORCODE(exc_invalid_tss)
   ^
   arch/x86/include/asm/idtentry.h:96:11: note: expanded from macro 'DEFINE_IDTENTRY_ERRORCODE'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:281:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_ERRORCODE(exc_segment_not_present)
   ^
   arch/x86/include/asm/idtentry.h:96:11: note: expanded from macro 'DEFINE_IDTENTRY_ERRORCODE'
   __visible noinstr void func(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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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")))
                                                             ^
   In file included from arch/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DECLARE_IDTENTRY_VC(X86_TRAP_VC,        exc_vmm_communication);
   ^
   arch/x86/include/asm/idtentry.h:315:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void ist_##func(struct pt_regs *regs, unsigned long error_code);      \
                     ^
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   arch/x86/include/asm/idtentry.h:316:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void safe_stack_##func(struct pt_regs *regs, unsigned long error_code)
                     ^
   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/x86/kernel/idt.c:9:
   arch/x86/include/asm/traps.h:18:22: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
                        ^
   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")))
                                                             ^
   7 warnings generated.
--
   In file included from arch/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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")))
                                                             ^
   In file included from arch/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DECLARE_IDTENTRY_VC(X86_TRAP_VC,        exc_vmm_communication);
   ^
   arch/x86/include/asm/idtentry.h:315:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void ist_##func(struct pt_regs *regs, unsigned long error_code);      \
                     ^
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   arch/x86/include/asm/idtentry.h:316:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void safe_stack_##func(struct pt_regs *regs, unsigned long error_code)
                     ^
   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/x86/kernel/irq.c:23:
   arch/x86/include/asm/traps.h:18:22: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
                        ^
   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/x86/kernel/irq.c:240:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_IRQ(common_interrupt)
   ^
   arch/x86/include/asm/idtentry.h:192:11: note: expanded from macro 'DEFINE_IDTENTRY_IRQ'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:272:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC(sysvec_x86_platform_ipi)
   ^
   arch/x86/include/asm/idtentry.h:234:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:302:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_ipi)
   ^
   arch/x86/include/asm/idtentry.h:261:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC_SIMPLE'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:311:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_posted_intr_wakeup_ipi)
   ^
   arch/x86/include/asm/idtentry.h:234:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:321:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_nested_ipi)
   ^
   arch/x86/include/asm/idtentry.h:261:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC_SIMPLE'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:389:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC(sysvec_thermal)
   ^
   arch/x86/include/asm/idtentry.h:234:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC'
   __visible noinstr void func(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")))
                                                             ^
   13 warnings generated.
..


vim +/coverage +614 arch/x86/include/asm/idtentry.h

c29c775a554f70 Thomas Gleixner 2020-02-25  611  
0786138c78e793 Tom Lendacky    2020-09-07  612  /* #VC */
0786138c78e793 Tom Lendacky    2020-09-07  613  #ifdef CONFIG_AMD_MEM_ENCRYPT
0786138c78e793 Tom Lendacky    2020-09-07 @614  DECLARE_IDTENTRY_VC(X86_TRAP_VC,	exc_vmm_communication);
0786138c78e793 Tom Lendacky    2020-09-07  615  #endif
0786138c78e793 Tom Lendacky    2020-09-07  616  

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37044 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
@ 2021-05-25 23:21   ` kernel test robot
  0 siblings, 0 replies; 16+ messages in thread
From: kernel test robot @ 2021-05-25 23:21 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 29425 bytes --]

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: x86_64-randconfig-a001-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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-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=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from arch/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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")))
                                                             ^
   In file included from arch/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DECLARE_IDTENTRY_VC(X86_TRAP_VC,        exc_vmm_communication);
   ^
   arch/x86/include/asm/idtentry.h:315:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void ist_##func(struct pt_regs *regs, unsigned long error_code);      \
                     ^
   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/x86/kernel/traps.c:49:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   arch/x86/include/asm/idtentry.h:316:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void safe_stack_##func(struct pt_regs *regs, unsigned long error_code)
                     ^
   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/x86/kernel/traps.c:49:
   arch/x86/include/asm/traps.h:18:22: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
                        ^
   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/x86/kernel/traps.c:201:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY(exc_divide_error)
   ^
   arch/x86/include/asm/idtentry.h:50:11: note: expanded from macro 'DEFINE_IDTENTRY'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:207:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY(exc_overflow)
   ^
   arch/x86/include/asm/idtentry.h:50:11: note: expanded from macro 'DEFINE_IDTENTRY'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:222:8: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   static noinstr bool handle_bug(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")))
                                                             ^
   arch/x86/kernel/traps.c:250:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_RAW(exc_invalid_op)
   ^
   arch/x86/include/asm/idtentry.h:136:11: note: expanded from macro 'DEFINE_IDTENTRY_RAW'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:269:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY(exc_coproc_segment_overrun)
   ^
   arch/x86/include/asm/idtentry.h:50:11: note: expanded from macro 'DEFINE_IDTENTRY'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:275:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_ERRORCODE(exc_invalid_tss)
   ^
   arch/x86/include/asm/idtentry.h:96:11: note: expanded from macro 'DEFINE_IDTENTRY_ERRORCODE'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/traps.c:281:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_ERRORCODE(exc_segment_not_present)
   ^
   arch/x86/include/asm/idtentry.h:96:11: note: expanded from macro 'DEFINE_IDTENTRY_ERRORCODE'
   __visible noinstr void func(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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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")))
                                                             ^
   In file included from arch/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DECLARE_IDTENTRY_VC(X86_TRAP_VC,        exc_vmm_communication);
   ^
   arch/x86/include/asm/idtentry.h:315:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void ist_##func(struct pt_regs *regs, unsigned long error_code);      \
                     ^
   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/x86/kernel/idt.c:9:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   arch/x86/include/asm/idtentry.h:316:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void safe_stack_##func(struct pt_regs *regs, unsigned long error_code)
                     ^
   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/x86/kernel/idt.c:9:
   arch/x86/include/asm/traps.h:18:22: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
                        ^
   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")))
                                                             ^
   7 warnings generated.
--
   In file included from arch/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
   In file included from arch/x86/include/asm/idtentry.h:9:
   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")))
                                                             ^
   In file included from arch/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DECLARE_IDTENTRY_VC(X86_TRAP_VC,        exc_vmm_communication);
   ^
   arch/x86/include/asm/idtentry.h:315:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void ist_##func(struct pt_regs *regs, unsigned long error_code);      \
                     ^
   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/x86/kernel/irq.c:23:
   In file included from arch/x86/include/asm/traps.h:9:
>> arch/x86/include/asm/idtentry.h:614:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   arch/x86/include/asm/idtentry.h:316:12: note: expanded from macro 'DECLARE_IDTENTRY_VC'
           __visible noinstr void safe_stack_##func(struct pt_regs *regs, unsigned long error_code)
                     ^
   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/x86/kernel/irq.c:23:
   arch/x86/include/asm/traps.h:18:22: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *eregs);
                        ^
   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/x86/kernel/irq.c:240:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_IRQ(common_interrupt)
   ^
   arch/x86/include/asm/idtentry.h:192:11: note: expanded from macro 'DEFINE_IDTENTRY_IRQ'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:272:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC(sysvec_x86_platform_ipi)
   ^
   arch/x86/include/asm/idtentry.h:234:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:302:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_ipi)
   ^
   arch/x86/include/asm/idtentry.h:261:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC_SIMPLE'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:311:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_posted_intr_wakeup_ipi)
   ^
   arch/x86/include/asm/idtentry.h:234:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:321:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_kvm_posted_intr_nested_ipi)
   ^
   arch/x86/include/asm/idtentry.h:261:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC_SIMPLE'
   __visible noinstr void func(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")))
                                                             ^
   arch/x86/kernel/irq.c:389:1: warning: unknown sanitizer 'coverage' ignored [-Wunknown-sanitizers]
   DEFINE_IDTENTRY_SYSVEC(sysvec_thermal)
   ^
   arch/x86/include/asm/idtentry.h:234:11: note: expanded from macro 'DEFINE_IDTENTRY_SYSVEC'
   __visible noinstr void func(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")))
                                                             ^
   13 warnings generated.
..


vim +/coverage +614 arch/x86/include/asm/idtentry.h

c29c775a554f70 Thomas Gleixner 2020-02-25  611  
0786138c78e793 Tom Lendacky    2020-09-07  612  /* #VC */
0786138c78e793 Tom Lendacky    2020-09-07  613  #ifdef CONFIG_AMD_MEM_ENCRYPT
0786138c78e793 Tom Lendacky    2020-09-07 @614  DECLARE_IDTENTRY_VC(X86_TRAP_VC,	exc_vmm_communication);
0786138c78e793 Tom Lendacky    2020-09-07  615  #endif
0786138c78e793 Tom Lendacky    2020-09-07  616  

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37044 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 19:12   ` Marco Elver
@ 2021-05-26  1:53     ` Miguel Ojeda
  2021-05-26  6:25       ` Marco Elver
  0 siblings, 1 reply; 16+ messages in thread
From: Miguel Ojeda @ 2021-05-26  1:53 UTC (permalink / raw)
  To: Marco Elver
  Cc: linux-kernel, Nathan Chancellor, Nick Desaulniers, Miguel Ojeda,
	Kees Cook, Andrew Morton, Will Deacon, Ard Biesheuvel,
	Luc Van Oostenryck, Arvind Sankar, Masahiro Yamada,
	Peter Zijlstra, Sami Tolvanen, Arnd Bergmann, clang-built-linux,
	Dmitry Vyukov, Mark Rutland

On Tue, May 25, 2021 at 9:13 PM Marco Elver <elver@google.com> wrote:
>
> Long story short: this is not fixable without more Clang changes. The
> only way to do it without a version check would be to introduce
> no_sanitize_coverage attr to Clang, which we probably shouldn't do,
> and I didn't want to fight it. ;-)

I am not sure I followed why you would not want to support querying
for the attributes (if they are intended to be used separately).

But regardless of that, why not the feature flag at least then, to be
consistent with the others?

Going back to version checks seems bad -- they should be reserved for
e.g. known broken versions and things like that. New compiler features
should come with new feature flags...

In fact, for Clang, I do not see any version checks in code at the
moment, so this would be the first :(

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-26  1:53     ` Miguel Ojeda
@ 2021-05-26  6:25       ` Marco Elver
  2021-05-26 12:38         ` Marco Elver
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Elver @ 2021-05-26  6:25 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: linux-kernel, Nathan Chancellor, Nick Desaulniers, Miguel Ojeda,
	Kees Cook, Andrew Morton, Will Deacon, Ard Biesheuvel,
	Luc Van Oostenryck, Arvind Sankar, Masahiro Yamada,
	Peter Zijlstra, Sami Tolvanen, Arnd Bergmann, clang-built-linux,
	Dmitry Vyukov, Mark Rutland

On Wed, 26 May 2021 at 03:54, Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
> On Tue, May 25, 2021 at 9:13 PM Marco Elver <elver@google.com> wrote:
> >
> > Long story short: this is not fixable without more Clang changes. The
> > only way to do it without a version check would be to introduce
> > no_sanitize_coverage attr to Clang, which we probably shouldn't do,
> > and I didn't want to fight it. ;-)
>
> I am not sure I followed why you would not want to support querying
> for the attributes (if they are intended to be used separately).

Not my decision, but some historical decision in Clang. Somebody
thought "no_sanitize(<string_literal>)" simplifies things. Hence,
Clang only knows about the no_sanitize attribute but not its
"subattributes".

> But regardless of that, why not the feature flag at least then, to be
> consistent with the others?

__has_feature(coverage_sanitizer) does not work either (yet).

> Going back to version checks seems bad -- they should be reserved for
> e.g. known broken versions and things like that. New compiler features
> should come with new feature flags...
>
> In fact, for Clang, I do not see any version checks in code at the
> moment, so this would be the first :(

In this instance it's absolutely required (for now). But if you don't
like it I'll go back to trying to fix Clang more. I'll check with
Clang folks which one we can implement, the feature check or the
attribute check.

> Cheers,
> Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [kbuild-all] Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 22:29     ` Marco Elver
@ 2021-05-26  8:11       ` Rong Chen
  -1 siblings, 0 replies; 16+ messages in thread
From: Rong Chen @ 2021-05-26  8:11 UTC (permalink / raw)
  To: Marco Elver, kernel test robot
  Cc: kbuild-all, clang-built-linux, LKML, Nathan Chancellor,
	Nick Desaulniers, Miguel Ojeda, Kees Cook, Andrew Morton,
	Will Deacon, Ard Biesheuvel, Luc Van Oostenryck



On 5/26/21 6:29 AM, Marco Elver wrote:
> On Wed, 26 May 2021 at 00:23, kernel test robot <lkp@intel.com> wrote:
> [...]
>> [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)
> ^^^ you're using a Clang pre-release, breakages are expected until
> Clang 13 is final.

Hi Marco,

I really appreciate for your comment, we'll update clang to the latest 
version.

Best Regards,
Rong Chen

>
> I think there was a thread about this at some point. I guess LKP has
> decided that testing Clang pre-releases is fair game? I guess it's
> useful, but this warning here needs to be ignored. It'll go away when
> you rebuild your pre-release Clang 13 from the latest LLVM main
> branch.
>
> [...]
>>>> 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")))
>>                                                               ^
> Clang 13 will support the attribute, but this is a pre-release Clang
> 13 -- so please ignore the report. FWIW, I tested my patch of course
> with a version of Clang 13 that supports the attribute. :-)
>
> Thanks,
> -- Marco
> _______________________________________________
> kbuild-all mailing list -- kbuild-all@lists.01.org
> To unsubscribe send an email to kbuild-all-leave@lists.01.org


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
@ 2021-05-26  8:11       ` Rong Chen
  0 siblings, 0 replies; 16+ messages in thread
From: Rong Chen @ 2021-05-26  8:11 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2465 bytes --]



On 5/26/21 6:29 AM, Marco Elver wrote:
> On Wed, 26 May 2021 at 00:23, kernel test robot <lkp@intel.com> wrote:
> [...]
>> [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)
> ^^^ you're using a Clang pre-release, breakages are expected until
> Clang 13 is final.

Hi Marco,

I really appreciate for your comment, we'll update clang to the latest 
version.

Best Regards,
Rong Chen

>
> I think there was a thread about this at some point. I guess LKP has
> decided that testing Clang pre-releases is fair game? I guess it's
> useful, but this warning here needs to be ignored. It'll go away when
> you rebuild your pre-release Clang 13 from the latest LLVM main
> branch.
>
> [...]
>>>> 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")))
>>                                                               ^
> Clang 13 will support the attribute, but this is a pre-release Clang
> 13 -- so please ignore the report. FWIW, I tested my patch of course
> with a version of Clang 13 that supports the attribute. :-)
>
> Thanks,
> -- Marco
> _______________________________________________
> kbuild-all mailing list -- kbuild-all(a)lists.01.org
> To unsubscribe send an email to kbuild-all-leave(a)lists.01.org

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-25 17:58 [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures Marco Elver
                   ` (2 preceding siblings ...)
  2021-05-25 23:21   ` kernel test robot
@ 2021-05-26  8:19 ` Peter Zijlstra
  3 siblings, 0 replies; 16+ messages in thread
From: Peter Zijlstra @ 2021-05-26  8:19 UTC (permalink / raw)
  To: Marco Elver
  Cc: linux-kernel, nathan, ndesaulniers, ojeda, keescook, akpm, will,
	ardb, luc.vanoostenryck, nivedita, masahiroy, samitolvanen, arnd,
	clang-built-linux, Dmitry Vyukov, Mark Rutland

On Tue, May 25, 2021 at 07:58:19PM +0200, Marco Elver wrote:
> Until now no compiler supported an attribute to disable coverage
> instrumentation as used by KCOV.
> 
> To work around this limitation on x86, noinstr functions have their
> coverage instrumentation turned into nops by objtool. However, this
> solution doesn't scale automatically to other architectures, such as
> arm64, which are migrating to use the generic entry code.
> 
> Clang [1] and GCC [2] have added support for the attribute recently.
> [1] https://github.com/llvm/llvm-project/commit/280333021e9550d80f5c1152a34e33e81df1e178
> [2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=cec4d4a6782c9bd8d071839c50a239c49caca689
> 
> Add __no_sanitize_coverage for both compilers, and add it to noinstr.
> 
> Signed-off-by: Marco Elver <elver@google.com>

W00t! Thanks guys!

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-26  6:25       ` Marco Elver
@ 2021-05-26 12:38         ` Marco Elver
  2021-05-26 18:12           ` Miguel Ojeda
  0 siblings, 1 reply; 16+ messages in thread
From: Marco Elver @ 2021-05-26 12:38 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: linux-kernel, Nathan Chancellor, Nick Desaulniers, Miguel Ojeda,
	Kees Cook, Andrew Morton, Will Deacon, Ard Biesheuvel,
	Luc Van Oostenryck, Arvind Sankar, Masahiro Yamada,
	Peter Zijlstra, Sami Tolvanen, Arnd Bergmann, clang-built-linux,
	Dmitry Vyukov, Mark Rutland

On Wed, 26 May 2021 at 08:25, Marco Elver <elver@google.com> wrote:
> On Wed, 26 May 2021 at 03:54, Miguel Ojeda
> <miguel.ojeda.sandonis@gmail.com> wrote:
> > On Tue, May 25, 2021 at 9:13 PM Marco Elver <elver@google.com> wrote:
> > >
> > > Long story short: this is not fixable without more Clang changes. The
> > > only way to do it without a version check would be to introduce
> > > no_sanitize_coverage attr to Clang, which we probably shouldn't do,
> > > and I didn't want to fight it. ;-)
> >
> > I am not sure I followed why you would not want to support querying
> > for the attributes (if they are intended to be used separately).
>
> Not my decision, but some historical decision in Clang. Somebody
> thought "no_sanitize(<string_literal>)" simplifies things. Hence,
> Clang only knows about the no_sanitize attribute but not its
> "subattributes".
>
> > But regardless of that, why not the feature flag at least then, to be
> > consistent with the others?
>
> __has_feature(coverage_sanitizer) does not work either (yet).
>
> > Going back to version checks seems bad -- they should be reserved for
> > e.g. known broken versions and things like that. New compiler features
> > should come with new feature flags...
> >
> > In fact, for Clang, I do not see any version checks in code at the
> > moment, so this would be the first :(
>
> In this instance it's absolutely required (for now). But if you don't
> like it I'll go back to trying to fix Clang more. I'll check with
> Clang folks which one we can implement, the feature check or the
> attribute check.

Ok, let's wait for response to: https://reviews.llvm.org/D103159
If that lands in the LLVM repo I'll change to use
__has_feature(coverage_sanitizer), and send a v2. That __has_feature()
is a bit of a lie though, because fsanitize-coverage has long been
supported, but it just so happens that if we get it, then its
availability implies availability of the no_sanitize("coverage")
attribute.

Thanks,
-- Marco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  2021-05-26 12:38         ` Marco Elver
@ 2021-05-26 18:12           ` Miguel Ojeda
  0 siblings, 0 replies; 16+ messages in thread
From: Miguel Ojeda @ 2021-05-26 18:12 UTC (permalink / raw)
  To: Marco Elver
  Cc: linux-kernel, Nathan Chancellor, Nick Desaulniers, Miguel Ojeda,
	Kees Cook, Andrew Morton, Will Deacon, Ard Biesheuvel,
	Luc Van Oostenryck, Arvind Sankar, Masahiro Yamada,
	Peter Zijlstra, Sami Tolvanen, Arnd Bergmann, clang-built-linux,
	Dmitry Vyukov, Mark Rutland

On Wed, May 26, 2021 at 2:38 PM Marco Elver <elver@google.com> wrote:
>
> Ok, let's wait for response to: https://reviews.llvm.org/D103159
> If that lands in the LLVM repo I'll change to use
> __has_feature(coverage_sanitizer), and send a v2. That __has_feature()
> is a bit of a lie though, because fsanitize-coverage has long been
> supported, but it just so happens that if we get it, then its
> availability implies availability of the no_sanitize("coverage")
> attribute.

Thanks a lot for that! Appreciated :)

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-05-26 18:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 17:58 [PATCH] kcov: add __no_sanitize_coverage to fix noinstr for all architectures Marco Elver
2021-05-25 18:25 ` Miguel Ojeda
2021-05-25 19:12   ` Marco Elver
2021-05-26  1:53     ` Miguel Ojeda
2021-05-26  6:25       ` Marco Elver
2021-05-26 12:38         ` Marco Elver
2021-05-26 18:12           ` Miguel Ojeda
2021-05-25 22:22 ` kernel test robot
2021-05-25 22:22   ` kernel test robot
2021-05-25 22:29   ` Marco Elver
2021-05-25 22:29     ` Marco Elver
2021-05-26  8:11     ` [kbuild-all] " Rong Chen
2021-05-26  8:11       ` Rong Chen
2021-05-25 23:21 ` kernel test robot
2021-05-25 23:21   ` kernel test robot
2021-05-26  8:19 ` Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.