[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200121221814.GQ7808@zn.tnic>
Date: Tue, 21 Jan 2020 23:18:15 +0100
From: Borislav Petkov <bp@...en8.de>
To: Qian Cai <cai@....pw>
Cc: Marco Elver <elver@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
the arch/x86 maintainers <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] x86/mm/pat: silence a data race in cpa_4k_install
On Tue, Jan 21, 2020 at 03:21:35PM -0500, Qian Cai wrote:
> Actually "__no_kcsan" does not work because I have
Why, because KCSAN conflicts with inlining? I'm looking at the comment
over __no_kasan_or_inline.
> CONFIG_OPTIMIZE_INLINING=y (GCC 8.3.1) here, so it has to be,
>
> diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
> index 20823392f4f2..fabbf8a33b7f 100644
> --- a/arch/x86/mm/pat/set_memory.c
> +++ b/arch/x86/mm/pat/set_memory.c
> @@ -126,7 +126,7 @@ static inline void cpa_inc_2m_checked(void)
> cpa_2m_checked++;
> }
>
> -static inline void cpa_inc_4k_install(void)
> +static inline void __no_kcsan_or_inline cpa_inc_4k_install(void)
> {
> cpa_4k_install++;
> }
>
> Are you fine with it or data_race() looks better?
This one looks marginally better because the annotation is still outside
of the function, so to speak.
Btw, looking at the other "inc" CPA statistics functions there, does it
mean that for KCSAN they all need to be annotated now too?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists