Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3853490ybl; Tue, 21 Jan 2020 08:14:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwyieeWwhZVR9+A8wI91+CxLNbKvl9xOL9gXzlvx/HnIUohVhak23+uLfOYygmNUTqI+1sC X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr3964447otq.1.1579623252877; Tue, 21 Jan 2020 08:14:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579623252; cv=none; d=google.com; s=arc-20160816; b=UQ97GeXtfhK97+X+PSeAQoBoJeGeDbbo9n7xtYz/L6nZ9dC18m7C4/Y4MPWmKotSIt RVzldQ6Aa1A5z6mkGhDxJEyrOi9yeA+rw36zUsrLsZF8oNjCenjQtZmaiAgF9rUQB9Lw BiOcDTK1o5IWgC98xcokpXbas02Wln1+had7/GpYByArBrpQCx7WZR9kYg6xyBJ3Futr s7QpJt/JsUhpn7LskbbcNzQtaEi/vIHEJCFamS30ZX1U8TyWvNPfSuxAw2vC2+Q/V053 DqQd5jd8TMJ/eQ6J9gA79cJNxAtvoRprW3roZbLYqL10DlUBNVQ+R6u4ITq8jfpUn4LJ Ikkg== 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:dkim-signature; bh=t0oGkq5Pa6BFHnIeKryyeGImhC+iJMmb3104WkR55ys=; b=LrzrY9s58Qo4J89eoFQhYVj05rJYeYdS3lJ6WB0WI02e+nO1YIPqROoHb3oeyY0gdC tNfye4X8aOL9lAiOgBbZyTcbpC7Y/QscSvQbnkAXxcGC6z8XrqtO1fdEmQcg8O5P0VgB BMIPjs7gLfvmuSupV1BDaH9NsQFPX2Puu4MEgZvJs+U92cdg8i7ngEYF4z5Io3ZUEQCY gM4AVjkeGlTyUQeKfFh6SMMNuRraa0lrKnrM1ji6fl8qD/RDFXsMiys/4vn0Q9J+u9qi yIG7QJte2iALuA8lfh5z+lVAxdM8KANKECu4sQNXcE2yDZxhxpTdsMp7pNTu8abO/V3p 1W+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Fk/VjSwG"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y140si20115836oia.49.2020.01.21.08.14.00; Tue, 21 Jan 2020 08:14:12 -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; dkim=pass header.i=@google.com header.s=20161025 header.b="Fk/VjSwG"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729043AbgAUQMs (ORCPT + 99 others); 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-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