2024-06-04 13:53:24

by Dmitry Vyukov

[permalink] [raw]
Subject: [PATCH 4/4] x86: Ignore stack unwinding in KCOV

Stack unwinding produces large amounts of uninteresting coverage.
It's called from KASAN kmalloc/kfree hooks, fault injection, etc.
It's not particularly useful and is not a function of system call args.
Ignore that code.

Signed-off-by: Dmitry Vyukov <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
arch/x86/kernel/Makefile | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 20a0dd51700a..cd49ebfae984 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -39,6 +39,14 @@ KMSAN_SANITIZE_sev.o := n
# first second.
KCOV_INSTRUMENT_head$(BITS).o := n
KCOV_INSTRUMENT_sev.o := n
+# These are called from save_stack_trace() on debug paths,
+# and produce large amounts of uninteresting coverage.
+KCOV_INSTRUMENT_stacktrace.o := n
+KCOV_INSTRUMENT_dumpstack.o := n
+KCOV_INSTRUMENT_dumpstack_$(BITS).o := n
+KCOV_INSTRUMENT_unwind_orc.o := n
+KCOV_INSTRUMENT_unwind_frame.o := n
+KCOV_INSTRUMENT_unwind_guess.o := n

CFLAGS_irq.o := -I $(src)/../include/asm/trace

--
2.45.1.467.gbab1589fc0-goog



2024-06-04 15:07:28

by Alexander Potapenko

[permalink] [raw]
Subject: Re: [PATCH 4/4] x86: Ignore stack unwinding in KCOV

On Tue, Jun 4, 2024 at 3:45 PM 'Dmitry Vyukov' via syzkaller
<[email protected]> wrote:
>
> Stack unwinding produces large amounts of uninteresting coverage.
> It's called from KASAN kmalloc/kfree hooks, fault injection, etc.
> It's not particularly useful and is not a function of system call args.
> Ignore that code.
>
> Signed-off-by: Dmitry Vyukov <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
Reviewed-by: Alexander Potapenko <[email protected]>

2024-06-05 08:31:11

by Marco Elver

[permalink] [raw]
Subject: Re: [PATCH 4/4] x86: Ignore stack unwinding in KCOV

On Tue, 4 Jun 2024 at 15:45, Dmitry Vyukov <[email protected]> wrote:
>
> Stack unwinding produces large amounts of uninteresting coverage.
> It's called from KASAN kmalloc/kfree hooks, fault injection, etc.
> It's not particularly useful and is not a function of system call args.
> Ignore that code.
>
> Signed-off-by: Dmitry Vyukov <[email protected]>

Reviewed-by: Marco Elver <[email protected]>

> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> ---
> arch/x86/kernel/Makefile | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
> index 20a0dd51700a..cd49ebfae984 100644
> --- a/arch/x86/kernel/Makefile
> +++ b/arch/x86/kernel/Makefile
> @@ -39,6 +39,14 @@ KMSAN_SANITIZE_sev.o := n
> # first second.
> KCOV_INSTRUMENT_head$(BITS).o := n
> KCOV_INSTRUMENT_sev.o := n
> +# These are called from save_stack_trace() on debug paths,
> +# and produce large amounts of uninteresting coverage.
> +KCOV_INSTRUMENT_stacktrace.o := n
> +KCOV_INSTRUMENT_dumpstack.o := n
> +KCOV_INSTRUMENT_dumpstack_$(BITS).o := n
> +KCOV_INSTRUMENT_unwind_orc.o := n
> +KCOV_INSTRUMENT_unwind_frame.o := n
> +KCOV_INSTRUMENT_unwind_guess.o := n
>
> CFLAGS_irq.o := -I $(src)/../include/asm/trace
>
> --
> 2.45.1.467.gbab1589fc0-goog
>