LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Marco Elver <elver@google.com>, Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arm64: Enable KCSAN
Date: Fri, 26 Nov 2021 20:02:32 +0800 [thread overview]
Message-ID: <2ec0f613-1fad-f64a-4dd5-ba2a7a93dad3@huawei.com> (raw)
In-Reply-To: <YaC5dbsw/uDYOVEv@elver.google.com>
On 2021/11/26 18:39, Marco Elver wrote:
> On Fri, Nov 26, 2021 at 04:00PM +0800, Kefeng Wang wrote:
>> This patch enables KCSAN for arm64, with updates to build rules
>> to not use KCSAN for several incompatible compilation units.
>>
>> Tested selftest and kcsan_test, and all passed.
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Nice! Although I think Mark (Cc'd) also had been working on this and
> probably knows what, if anything, is still missing.
>
> For one, have you tested gcc 11? To make it work with gcc 11, my
> preferred solution is that you simply squash this:
I only have gcc10, will try gcc 11.
>
> ---
>
> diff --git a/kernel/kcsan/Makefile b/kernel/kcsan/Makefile
> index c2bb07f5bcc7..d7d0b51b79f5 100644
> --- a/kernel/kcsan/Makefile
> +++ b/kernel/kcsan/Makefile
> @@ -8,6 +8,7 @@ CFLAGS_REMOVE_debugfs.o = $(CC_FLAGS_FTRACE)
> CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
>
> CFLAGS_core.o := $(call cc-option,-fno-conserve-stack) \
> + $(call cc-option,-mno-outline-atomics) \
> -fno-stack-protector -DDISABLE_BRANCH_PROFILING
>
> obj-y := core.o debugfs.o report.o
>
> ---
>
> [ I have changes to kernel/kcsan/Makefile that I expect to land in -next
> soon'ish, the above is small enough that git can auto-merge. ]
>
> gcc somehow made outline-atomics the default (unlike clang), which will
> cause linker errors for kernel/kcsan/core.o. While the support for
> builtin atomics shouldn't be required on arm64, I want it to be
> (compile-)testable on all architectures. Although there's an exception
> that certain compiler instrumentation actually require working builtin
> atomics support, specifically GCOV_KERNEL.
Thanks for your infos, I will try to test it.
> Thanks,
> -- Marco
>
>
prev parent reply other threads:[~2021-11-26 12:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 8:00 Kefeng Wang
2021-11-26 10:39 ` Marco Elver
2021-11-26 12:02 ` Kefeng Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ec0f613-1fad-f64a-4dd5-ba2a7a93dad3@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=catalin.marinas@arm.com \
--cc=elver@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
--subject='Re: [PATCH] arm64: Enable KCSAN' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).