Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2877060ybl; Mon, 20 Jan 2020 11:06:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzviO3VxiWpqJCmKqgjfGz9+lSSjvrW6BOZMQpQKCvDTWdjVQtduw2QFewP+gf/zY573HaG X-Received: by 2002:a05:6830:1289:: with SMTP id z9mr716229otp.317.1579547165409; Mon, 20 Jan 2020 11:06:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579547165; cv=none; d=google.com; s=arc-20160816; b=PcmTgZTAH8WJGI56uMA41Pjdkuc70Y8sWLXmxiKN7vty8Yr60xa22D3C64JNQRmu9A hNaDEAZy1XM1KeQlmNqcJDs4Sx3/WuTTtDa+yBrF4PCzJtSj3jEOGsnxb2gbEir/9xBy ryeLZPnuRYjPh+kPKKMDfU9JiqLMxQfV8GqVXlfJ1nSCiCLL7qc+iFfuJIM8I88EBP5k Zkvddxv5Aewc35GiMqKXshA2spWUdYTe2pVc/UDrWS72dKRrtQ2y72SCePIMLWGEgCnD 3aUAzxE4iegfxNd7ffFHndWiMHALuWKH6fD4s5IbqS9xjUAQTIgRzTsyBY6GrowuQLMc 32qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=zVDX76oU4uN/Wz/AWau+L6wJ8ExpJ/NsK/bCJiqNHG0=; b=ZLn+iq0WE4i6QxazY1mjMO23cAYJ8Wjs6hjqZ3cuibmpS6p/O0GzelDEUWSRXBws5b GIMydAcgI7i9ObQOgplmgm8Wog3nQmFKwKs+mdbZB6Lwe4MhF91Itkpa3Js+sBU8GrJQ rv0OS7Xog9lL8V0rCuOlhhtFG3/8BxvShn5a4tgTEGDXKiNgRCBjl9ahIPmI08e+wz44 4FT+JeuYnH3fhkH1LAYiYPA48MDjVY8aBwVpJRG+17v07XTcblIyN7+EwcLib2YTtlB0 2ncFoL3zHRUC7AtHKxK7uADyfu1HHB+ecGnFKqvh9iJoHoRpfWalERO65TIYAwHfc5KM KKNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62si18130575oiz.271.2020.01.20.11.05.52; Mon, 20 Jan 2020 11:06:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgATTDF (ORCPT + 99 others); Mon, 20 Jan 2020 14:03:05 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:58153 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgATTDE (ORCPT ); Mon, 20 Jan 2020 14:03:04 -0500 Received: from mail-qt1-f177.google.com ([209.85.160.177]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MHGPA-1ipALF2U3E-00DGre; Mon, 20 Jan 2020 20:03:01 +0100 Received: by mail-qt1-f177.google.com with SMTP id v25so614991qto.7; Mon, 20 Jan 2020 11:03:01 -0800 (PST) X-Gm-Message-State: APjAAAU2b19EsYgjPqf3lWEury14h744bF3DovOfFzCgBvQyc5ygBq/O pAbY0ppqjuFg5QdSF2GDwlPUaRpz4ILiGD0V6Lc= X-Received: by 2002:ac8:768d:: with SMTP id g13mr805093qtr.7.1579546980409; Mon, 20 Jan 2020 11:03:00 -0800 (PST) MIME-Version: 1.0 References: <20200115165749.145649-1-elver@google.com> In-Reply-To: From: Arnd Bergmann Date: Mon, 20 Jan 2020 20:02:44 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -rcu] asm-generic, kcsan: Add KCSAN instrumentation for bitops To: Marco Elver Cc: "Paul E. McKenney" , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , kasan-dev , "linux-kernel@vger.kernel.org" , Michael Ellerman , christophe leroy , Daniel Axtens , linux-arch Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:jR7dToZSz+pkZ+H0k5vLn3WxHAvBzUvp3ljrXIGkzvRot+PDpsg jvUS6yMJBrzIa5w8PoqfcIyUxp6R0ukVQsudQ5jcvbSZBzbkYiGpDO368uKbT3GS1zMTax6 fYr6mXoL9VkOH4vxVc/626eppN3uzhWad2gTfMiDZowwRgFPV25v52+xoRoMQwhXws8s4O6 XJlqCZts9DbDomGlf0i7A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:l3QBPowaTZQ=:sRbWnLFf27OK+UK7+9qpof kwPt46XaHvZva95NukcvqRN8B+WTktgovYpCxLpjyzoybNq9aSo4NoTE8QmBoUZS1RmHPBN3O JxuSWZwOcUWZcqjCmgwlDy5DyqJDaxkaPz/Nkgult+b7uI34ASguRqWm8dqFl7mm5sGqmi611 HfMxJJUOIFDrrF6j66MWYHe7WJVFbRjATPfrdN+eP9IU85Gt78j+vrpL4onL9FsJqmuu7mEQE r6CbmFtYBc61T3+4ZfcoIdi0jxqcjbW6+cTwSwmhNbt5efjoxt1uXj8opXK8L4SDksSoi8HVl fAlVXG7rKO05DiAS06MkyjbZe+jGNDYPevAFAOkxSIUrcIthNQaSBtFHhLzQa3Nod0Vgl2lUW SMLHW53liptmhdTg0q4H8m5ChB9jWsVBRhvAbs6gvduiR/vq/goOgRKsr4AoDfXMmTwX7Ad6J 1A8MuGFWykbHCnXp1OpPsG1A7DHwGt0A00wmobx5RbsZs81otdVXhWH1yo+3meC6aMDN9YLNp KJswW9VlS/GYIjjv1KsGzn+pPNWxO+tHx8u9hRgZkDaB/F6u65dSDnnWrN7z00XA++XiOaoqW XGQKTCYTokGcjDohE/nGDmTVXpP3MSR6tKLgly1p7mly017IANjzQtZPiAJMVpojVW8Kg/YMb IA/A6xN+pNXterGSQo/Vm95Qxgq+PH7d68YGnXbRzLOiHhKVsT88gJrQFyI2W26ChyzBIZ4aP Tj9K5CbGego3mfwnPMdfSTmATTp0bm3ESuGDdokiE6CCIDgmXHVyh85xewT3AoxxJFP4W8OBd H898tlU9G2jc4aHY2LssA65PElWWQ1MfRAObEL+klzX2MphZ4oXhXqeAeJsNCryjxeA8V9z54 ucpDaNXlOUyuEr5Kn9fg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2020 at 4:11 PM Marco Elver wrote: > On Mon, 20 Jan 2020 at 15:40, Arnd Bergmann wrote: > > On Mon, Jan 20, 2020 at 3:23 PM Marco Elver wrote: > > > On Fri, 17 Jan 2020 at 14:14, Marco Elver wrote: > > > > On Fri, 17 Jan 2020 at 13:25, Arnd Bergmann wrote: > > > > > On Wed, Jan 15, 2020 at 9:50 PM Marco Elver wrote: > > > > > > > If you can't find any, I would prefer having the simpler interface > > > > > with just one set of annotations. > > > > > > > > That's fair enough. I'll prepare a v2 series that first introduces the > > > > new header, and then applies it to the locations that seem obvious > > > > candidates for having both checks. > > > > > > I've sent a new patch series which introduces instrumented.h: > > > http://lkml.kernel.org/r/20200120141927.114373-1-elver@google.com > > > > Looks good to me, feel free to add > > > > Acked-by: Arnd Bergmann > > > > if you are merging this through your own tree or someone else's, > > or let me know if I should put it into the asm-generic git tree. > > Thank you! It seems there is still some debate around the user-copy > instrumentation. > > The main question we have right now is if we should add pre/post hooks > for them. Although in the version above I added KCSAN checks after the > user-copies, it seems maybe we want it before. I personally don't have > a strong preference, and wanted to err on the side of being more > conservative. > > If I send a v2, and it now turns out we do all the instrumentation > before the user-copies for KASAN and KCSAN, then we have a bunch of > empty hooks. However, for KMSAN we need the post-hook, at least for > copy_from_user. Do you mind a bunch of empty functions to provide > pre/post hooks for user-copies? Could the post-hooks be generally > useful for something else? I'd prefer not to add any empty hooks, let's do that once they are actually used. Arnd