From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932184AbbJMMse (ORCPT ); Tue, 13 Oct 2015 08:48:34 -0400 Received: from relay.parallels.com ([195.214.232.42]:51673 "EHLO relay.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932095AbbJMMsd (ORCPT ); Tue, 13 Oct 2015 08:48:33 -0400 From: Andrey Ryabinin To: CC: Andrey Ryabinin , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , , Andrew Morton , Andy Lutomirski , Andrey Konovalov , Kostya Serebryany , Alexander Potapenko , kasan-dev , Borislav Petkov , Denys Vlasenko , Andi Kleen , Dmitry Vyukov , Sasha Levin , Wolfram Gloger Subject: [PATCH v2 0/2] Silence KASAN warnings in get_wchan() Date: Tue, 13 Oct 2015 15:35:48 +0300 Message-ID: <1444739750-29241-1-git-send-email-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.4.9 MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: US-EXCH2.sw.swsoft.com (10.255.249.46) To MSK-EXCH1.sw.swsoft.com (10.67.48.55) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Originally I suggested to implement READ_ONCE_NOCHECK(), like this: #define READ_ONCE_NOCHECK(x) \ {( typeof(x) __val; \ kasan_disable_local(); \ __val = READ_ONCE(x); \ kasan_enable_local(); \ __val;\ )} But then I realised that we can't put this into linux/compiler.h since it requires to add some includes (we need linux/kasan.h which also requires linux/sched.h). It's not even that simple to put this into kernel.h So I've come to another approach, see the first patch for details. Pros: - It generates more efficient code rather than variant above Cons: - REAS_ONCE() becomes rather messy. Andrey Ryabinin (2): Provide READ_ONCE_NOCHECK() x86/process: Silence KASAN warnings in get_wchan() arch/x86/kernel/process.c | 6 +++--- include/linux/compiler-gcc.h | 13 ++++++++++++ include/linux/compiler.h | 49 ++++++++++++++++++++++++++++++++------------ 3 files changed, 52 insertions(+), 16 deletions(-) -- 2.4.9