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 3B540C2BA2B for ; Mon, 13 Apr 2020 14:45:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F3C4E20732 for ; Mon, 13 Apr 2020 14:45:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gpTOVZu+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3C4E20732 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 800768E011D; Mon, 13 Apr 2020 10:45:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 789AC8E0104; Mon, 13 Apr 2020 10:45:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 651248E011D; Mon, 13 Apr 2020 10:45:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 49BF78E0104 for ; Mon, 13 Apr 2020 10:45:17 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EF675180AD802 for ; Mon, 13 Apr 2020 14:45:16 +0000 (UTC) X-FDA: 76703104632.17.shoes90_10f7a94f6ff42 X-HE-Tag: shoes90_10f7a94f6ff42 X-Filterd-Recvd-Size: 5728 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Mon, 13 Apr 2020 14:45:16 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id s8so10383550wrt.7 for ; Mon, 13 Apr 2020 07:45:16 -0700 (PDT) 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=DpIiX6CcWf1KOKVV+cYRyWRSH9JCCL1cZC1Dys/7/8g=; b=gpTOVZu+zCb8S7vD1W4wy+cJdORdLtR+xUUMeU0srkdxC6NoAPAgH2SRx0754IoUY9 U8gZGhBykgl3pFB8AZ7jSpRI6YGZblqco9faHnIiBMUkKfe9u2StuZEo79jwJZHUcsCf LfXsweS0G2YC3QxBUDAwa+E5gGLtK4QoTvksvGm04YaPz5+93S0UXhXKVSBJHGQB6zty lq7kF+JHnprzvis7oXEFmPLcRmc53D35FzPXxMb0R/s6fGuhfHOFYzBYyj3f3fygufWi iJjr1HPJbVrvMzxZXGb1/F7PoF23JiheX8IUdbsKGj6fsbrl7NdY47thDKVr/0SyGUNq WcRA== 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=DpIiX6CcWf1KOKVV+cYRyWRSH9JCCL1cZC1Dys/7/8g=; b=biBXjPl1Wuyzsip8RWm1LTosRhps1OF2u7sIRYqBEYZq+diuARkSxo+Ph1lSedYUXe yDCyvuUJcq/CA1MP2sL/+A30O0bOEWZmPGF/OwybFe6atD/gSVR7UNDEL0hRllyXmPGc ATcX6N7BCZtXXb6Ugg17fEP6IkL7sVpsymucwBWIqzq/uFyqx6zC7V5fguHqxQf7ccQh D7qnsOrttNtV7fdchfe8ETR1jmPwUiP9+RkjnWOmYMaZmUtg8C73QQwHAxXwrCBNGiwJ DnHzTuTbP0kJ978rKtro44DU9UtawRCnhYpkeLICvk60noDxWEAOTAjYodSU9iDiFXTd Kthw== X-Gm-Message-State: AGi0Pua0BZu/l/0gCM+XfxrKTnOW8JoQnph9fUNE0fiLmBCrwirA3M24 G7pFy0bbTrjGhwtQPBQkkXWmpLiCw37xYc8Detij0w== X-Google-Smtp-Source: APiQypIiEE8lqwEd0JPzItJFOJfo0ZJSogEEbkijS63FzT13UvQ8ahh0f+1PSt7UAis4SgeDGsCHNSDE/ZqOYWAZszM= X-Received: by 2002:adf:cc81:: with SMTP id p1mr10791563wrj.372.1586789115081; Mon, 13 Apr 2020 07:45:15 -0700 (PDT) MIME-Version: 1.0 References: <20200325161249.55095-1-glider@google.com> <20200325161249.55095-3-glider@google.com> In-Reply-To: From: Alexander Potapenko Date: Mon, 13 Apr 2020 16:45:04 +0200 Message-ID: Subject: Re: [PATCH v5 02/38] kmsan: add ReST documentation To: Andrey Konovalov Cc: Vegard Nossum , Dmitry Vyukov , Marco Elver , Linux Memory Management List , Alexander Viro , Andreas Dilger , Andrew Morton , Andrey Ryabinin , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Christoph Hellwig , Christoph Hellwig , "Darrick J. Wong" , "David S. Miller" , Dmitry Torokhov , Eric Biggers , Eric Dumazet , Eric Van Hensbergen , Greg Kroah-Hartman , Harry Wentland , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jason Wang , Jens Axboe , Marek Szyprowski , Mark Rutland , "Martin K. Petersen" , Martin Schwidefsky , Matthew Wilcox , "Michael S . Tsirkin" , Michal Hocko , Michal Simek , Petr Mladek , Qian Cai , Randy Dunlap , Robin Murphy , Sergey Senozhatsky , Steven Rostedt , Takashi Iwai , "Theodore Ts'o" , Thomas Gleixner , Vasily Gorbik , Wolfram Sang Content-Type: text/plain; charset="UTF-8" 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: > > +The function name depends on the memory access size. > > +Each such function also checks if the shadow of the memory in the range > > +[``addr``, ``addr + n``) is contiguous and reports an error otherwise. > > Makes sense to refer to the "Metadata allocation" section here, which > explains what happens in case of an error. Will do. > > + > > +LSB of the ``shadow`` pointer in a ``struct page`` may be set to 1. In this case > > +shadow and origin pages are allocated, but KMSAN ignores accesses to them by > > +falling back to dummy pages. Allocating the metadata pages is still needed to > > +support ``vmap()/vunmap()`` operations on this struct page. > > This part is not clear. We allocate shadow for vmap()'ed regions but > don't do any initialization checks for that memory? Changed as follows: LSB of the ``shadow`` pointer in a ``struct page`` may be set to 1. In this case shadow and origin pages are allocated, but KMSAN ignores accesses to them by falling back to dummy pages. Because this ``struct page`` could be used in a virtual mapping, we still allocate metadata for it. Accesses to such virtual mappings will be ignored by KMSAN as well. > > Nit: some sections have empty lines after the section header, while > others don't. Fixed that, thank you!