[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E9162CDC-BBC5-4D69-87FB-C93AB8B3D581@lca.pw>
Date: Tue, 21 Jan 2020 15:21:35 -0500
From: Qian Cai <cai@....pw>
To: Borislav Petkov <bp@...en8.de>
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 Jan 21, 2020, at 10:45 AM, Borislav Petkov <bp@...en8.de> wrote:
>
> On Tue, Jan 21, 2020 at 04:36:49PM +0100, Marco Elver wrote:
>> Isn't the intent "x86/mm/pat: Mark intentional data race" ? The fact
>> that KCSAN no longer shows the warning is a side-effect. At least
>> that's how I see it.
>
> Perhaps because you've been dealing with KCSAN for so long. :-)
>
> The main angle here, IMO, is that this "fix" is being done solely for
> KCSAN. Or is there another reason to "fix" intentional data races? At
> least I don't see one. And the text says
>
> "This will generate a lot of noise on a debug kernel with
> debug_pagealloc with KCSAN enabled which could render the system
> unusable."
>
> So yes, I think it should say something about making KCSAN happy.
>
> Oh, and while at it I'd prefer it if it did the __no_kcsan function
> annotation instead of the data_race() thing.
Actually "__no_kcsan" does not work because I have
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?
Powered by blists - more mailing lists