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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FFDBC43334 for ; Fri, 15 Jul 2022 08:53:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52BC99401DA; Fri, 15 Jul 2022 04:52:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DB869401A5; Fri, 15 Jul 2022 04:52:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A3259401DA; Fri, 15 Jul 2022 04:52:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2A1939401A5 for ; Fri, 15 Jul 2022 04:52:59 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id F2E1660741 for ; Fri, 15 Jul 2022 08:52:58 +0000 (UTC) X-FDA: 79688719236.16.14BFBCE Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by imf27.hostedemail.com (Postfix) with ESMTP id 9A41540090 for ; Fri, 15 Jul 2022 08:52:58 +0000 (UTC) Received: by mail-wm1-f42.google.com with SMTP id x23-20020a05600c179700b003a30e3e7989so436652wmo.0 for ; Fri, 15 Jul 2022 01:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lnbKwcn88f6NuJinTbm+K+QRokDztEAvNGDk/1bg6OE=; b=EPbgaSiEgC0y6d0plpABJbe4WhG92iJsdO7dU4p4mGED6SykJ/QDLH8/N2MxjUYHLX qVDpoVZVSrTIEGtj5KQFMHqpe9JYWRRZDrXn2v3rXeazNEUOWy1DUOcrai9kkXEGTF6r Zorc70RXImp1DoNbN7gOVkLYiKKr0zAgFDhslcXhBW1frZb9YL6LGtquavH5ImbiumLf HUjYzzAfkRf7I3yGNLmsMogn7wQTzJWPX+9gDPv59k8FDoh+Ws/bvhFWFmYkGhTrDud6 qS5XqssX+c/dSGecigcLJNoTijBqR9PRcLFbV7SqARVFen9kuXNNiMutKStWZWzooUJD jaHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lnbKwcn88f6NuJinTbm+K+QRokDztEAvNGDk/1bg6OE=; b=kPn3N/oEIAO7SEA81KPcCYNaxe5vK2xCMOMu5Sv7VFJbnt6sLHVzW1tT0hb6o0ULjc iZX6wTLAd5U0/MslRA2aLefu/b1HuXINA/yALjToVmOcKBzQfgDtLUeA/D4Oebcme4LX rAaIv2yNyn334YiCGxxrRzKHNK3bnUMJpjT1FDFc/R3CT5kJcXmCnvOWAnSf8GF8Kqsg tTmFCCHs2/7mwGPRPIbPbn+PRsh1SIA8bxC9/qbDC4GkCDJhlIhLSGdqKAXd53rcgah5 tacfzUlwFcWblQLSNk6Fp8HFJnJqYjQ14i/IrYLNS6dXIhVBG2g0YPwPKce1anODZuhU zPAA== X-Gm-Message-State: AJIora/1Ag8E4R5/WJ0dY1SdbY82iNkJFRnwy57bczDr9HcA4d60uiLJ iIXsEoP5nDcAKkJqX9Urqbzoog== X-Google-Smtp-Source: AGRyM1tkG0LUmTaEynDGXTm4Zb2UyVqfYMmac0HS4kuDLCGKKbrryKEGrHBi6pSIk5JB5Rsgrgifsw== X-Received: by 2002:a05:600c:354e:b0:3a1:9ddf:468d with SMTP id i14-20020a05600c354e00b003a19ddf468dmr18784274wmq.145.1657875177165; Fri, 15 Jul 2022 01:52:57 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:9c:201:b388:52a3:7014:22f5]) by smtp.gmail.com with ESMTPSA id i15-20020a5d438f000000b0021d4d6355efsm3285703wrq.109.2022.07.15.01.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 01:52:56 -0700 (PDT) Date: Fri, 15 Jul 2022 10:52:49 +0200 From: Marco Elver To: Alexander Potapenko Cc: Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev , Linux Memory Management List , Linux-Arch , LKML Subject: Re: [PATCH v4 06/45] kmsan: add ReST documentation Message-ID: References: <20220701142310.2188015-1-glider@google.com> <20220701142310.2188015-7-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.4 (2022-04-30) ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=EPbgaSiE; spf=pass (imf27.hostedemail.com: domain of elver@google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657875178; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lnbKwcn88f6NuJinTbm+K+QRokDztEAvNGDk/1bg6OE=; b=YSpbPwXz5LRtHv32WXPhaarBFziO4eoln7TCZfjnFeKucMQx9pWrp0hWQrgDvIsuVu2D8R XxJwr5iPuSfGKJJlNVkb9KVNyoOenohNYCukAbVy2o/ZlvUYkMpLpJrAtn6QjApMY3SJpU oC/71GFi/2msN2LwTc5dy8+e9YjfB2c= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657875178; a=rsa-sha256; cv=none; b=4foo3P1XLVstARHSLzXI6t7mXBcNIG0psWtgkVNOaYFwZw3vJfndNeYbYf7CdGFPK59fGC R9TU8dzUvs6YhUUFyNYsNjmnYMQhMcqQj8VyyN/kRQw0QORoksLvl7Krh4gdce21ss74vL NHPgtVWodIZFQzDas4+j7iJ5b2L39Ok= X-Stat-Signature: xdk1w8aek39tqb3dog6j9jmnt1thaw6i X-Rspamd-Queue-Id: 9A41540090 X-Rspamd-Server: rspam07 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=EPbgaSiE; spf=pass (imf27.hostedemail.com: domain of elver@google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-HE-Tag: 1657875178-424302 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 15, 2022 at 09:42AM +0200, Alexander Potapenko wrote: [...] > > This sentence might still be confusing. I think it should highlight > > that runtime and compiler go together, but depending on the scope of > > the value, the compiler invokes the runtime to persist the shadow. > > Changed to: > """ > Compiler instrumentation also tracks the shadow values as they are used along > the code. When needed, instrumentation code invokes the runtime library in > ``mm/kmsan/`` to persist shadow values. > """ Ack. [...] > > > +Passing uninitialized values to functions > > > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > + > > > +KMSAN instrumentation pass has an option, ``-fsanitize-memory-param-retval``, > > > > "KMSAN instrumentation pass" -> "Clang's instrumentation support" ? > > Because it seems wrong to say that KMSAN has the instrumentation pass. > How about "Clang's MSan instrumentation pass"? Maybe just "Clang's MemorySanitizer instrumentation" - no abbreviation, and "pass" is very compiler-implementation specific and not everyone might know what "pass" even means in this context, so I'd leave it out. [...] > > It would be useful to move this section somewhere to the beginning, > > closer to usage and the example, as this is information that a user of > > KMSAN might want to know (but they might not want to know much about > > how KMSAN works). > > I restructured the TOC as follows: > > == The Kernel Memory Sanitizer (KMSAN) > == Usage > --- Building the kernel > --- Example report > --- Disabling the instrumentation > == Support > == How KMSAN works > --- KMSAN shadow memory > --- Origin tracking > ~~~~ Origin chaining > --- Clang instrumentation API > ~~~~ Shadow manipulation > ~~~~ Handling locals > ~~~~ Access to per-task data > ~~~~ Passing uninitialized values to functions > ~~~~ String functions > ~~~~ Error reporting > ~~~~ Inline assembly instrumentation > --- Runtime library > ~~~~ Per-task KMSAN state > ~~~~ KMSAN contexts > ~~~~ Metadata allocation > == References LGTM. Thanks, -- Marco