From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61695C2D0CE for ; Tue, 21 Jan 2020 16:12:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 335F52253D for ; Tue, 21 Jan 2020 16:12:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Fk/VjSwG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729108AbgAUQMs (ORCPT ); Tue, 21 Jan 2020 11:12:48 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:44689 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726968AbgAUQMs (ORCPT ); Tue, 21 Jan 2020 11:12:48 -0500 Received: by mail-oi1-f195.google.com with SMTP id d62so3022142oia.11 for ; Tue, 21 Jan 2020 08:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t0oGkq5Pa6BFHnIeKryyeGImhC+iJMmb3104WkR55ys=; b=Fk/VjSwGo6GnY3If9r3BBaqW1BeNkMxKbSCn5mjEMyVclU3rQ3/ne2lWpRcEMJgza4 jIYmyAjNm8MrTni/EjaAfJt95jEF/+6hOhSxUbyKVnI7PffuAMOrDaeKXIMEbq40Fnno Bws0lgNoPJJFPANsvWWyZRRtS9BdKjOJg88OIvvyeVTMJwFu2WYMVV7jOKkt7XlyKmYX DhS+DaOzT2wNmQF4Z2uKwzBVpfNnpn4NkF4z21jx2FplBKqiiTTKeSP9f0dTv7mdEp2b d6VrVr68fT7x0jmDN1KlV4NWZUNUXqDEVhV00y7RJ7pNcGmSVoJ9oX/xMQSf5qGoEARN rg/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t0oGkq5Pa6BFHnIeKryyeGImhC+iJMmb3104WkR55ys=; b=rlIwdo34tkUuu2qbRua2YzxkRkIzPGvLDuyjm6+4rsjkpDyoQFKPM16qqytSO+Qz/z 4EhMwtK+LyAktDhvEkNgOCvHdGUFfNa0PoCY8ouMnZxler0uC3EydkRmDgNcSyBQYXsh DUlvBK/dF/h+6milSP6fA/go0UD8q0rjEQRLpvBcQOjBJn+AgezLVtkMkoKZOkfntDGZ cEKAHd0tSLvCSFZ6kvJiK8bOSC12cKtChbH4RRuD7VXo5SMCj6KU7A01JOiAsuvdtFwv 8QnzN0JOz4Y5p2oW/g3cI58FnRsZwq5tfcRLB00A6JH+H7PwZs6e5F7b2KKNvt5qjCMe 94dA== X-Gm-Message-State: APjAAAW0aqgPneruNc/nXGlEZYzNIekeLnmoHKgApKSeihkuD6RbLD6a uope2WnwwueW/TIZ+gjKDtLfe8J9+jIlfjItwe9cYw== X-Google-Smtp-Source: APXvYqwqMngfefQgGxQ3H4Pw5AafxYDK/vfOwxFn9yLaQb9nfiuyLLjnlS286+QldnFKWDZc87i2Y3UTkGFU5aPJZcI= X-Received: by 2002:aca:b183:: with SMTP id a125mr3673714oif.83.1579623167224; Tue, 21 Jan 2020 08:12:47 -0800 (PST) MIME-Version: 1.0 References: <20200115165749.145649-1-elver@google.com> In-Reply-To: From: Marco Elver Date: Tue, 21 Jan 2020 17:12:35 +0100 Message-ID: Subject: Re: [PATCH -rcu] asm-generic, kcsan: Add KCSAN instrumentation for bitops To: Arnd Bergmann 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Jan 2020 at 20:03, Arnd Bergmann wrote: > > 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. I hope I found a solution to the various constraints: http://lkml.kernel.org/r/20200121160512.70887-1-elver@google.com I removed your Acks from the patches that were changed in v2. Please have another look. Re tree: Once people are happy with the patches, since this depends on KCSAN it'll probably have to go through Paul's -rcu tree, since KCSAN is not yet in mainline (currently only in -rcu, -tip, and -next). Thanks, -- Marco