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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 A1200C43331 for ; Sat, 28 Mar 2020 08:52:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 68EE1206F2 for ; Sat, 28 Mar 2020 08:52:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68EE1206F2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F33316B0010; Sat, 28 Mar 2020 04:52:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE4036B0032; Sat, 28 Mar 2020 04:52:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD1AF6B0036; Sat, 28 Mar 2020 04:52:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id C362E6B0010 for ; Sat, 28 Mar 2020 04:52:38 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 820D4181AD0A2 for ; Sat, 28 Mar 2020 08:52:38 +0000 (UTC) X-FDA: 76644155196.23.drain83_5137826140b5b X-HE-Tag: drain83_5137826140b5b X-Filterd-Recvd-Size: 3722 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Sat, 28 Mar 2020 08:52:37 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 6B04B68C4E; Sat, 28 Mar 2020 09:52:33 +0100 (CET) Date: Sat, 28 Mar 2020 09:52:33 +0100 From: Christoph Hellwig To: Alexander Potapenko Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Vegard Nossum , Dmitry Vyukov , Marco Elver , Andrey Konovalov , Linux Memory Management List , Al Viro , Andreas Dilger , Andrew Morton , Andrey Ryabinin , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Christoph Hellwig , "Darrick J. Wong" , David 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 , Mark Rutland , "Martin K . Petersen" , Martin Schwidefsky , Matthew Wilcox , "Michael S. Tsirkin" , Michal Hocko , Michal Simek , Petr Mladek , Qian Cai , Randy Dunlap , Sergey Senozhatsky , Steven Rostedt , Takashi Iwai , Theodore Ts'o , Thomas Gleixner , Vasily Gorbik , Wolfram Sang Subject: Re: [PATCH v5 34/38] kmsan: dma: unpoison memory mapped by dma_direct_map_page() Message-ID: <20200328085233.GA26550@lst.de> References: <20200325161249.55095-1-glider@google.com> <20200325161249.55095-35-glider@google.com> <20200325161905.GA19868@lst.de> <20200327170647.GA22758@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Content-Transfer-Encoding: quoted-printable 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, Mar 27, 2020 at 07:46:08PM +0100, Alexander Potapenko wrote: > > > Do you mean comparing the address to TASK_SIZE, or is there a more > > > portable way to check that? > > > > !PageHighMem(page) implies the page has a kernel direct mapping. >=20 > I tried adding this check and started seeing false positives because > the virtio_ring driver actually uses highmem pages for DMA, and data > from those pages is later copied to the kernel. > Guess it's easier to just allow handling highmem pages? What problems > do you anticipate? For PageHighMem(page), page_address(page) is not actually valid, so =D0=86= 'm not sure how your code in this patch even worked at all. Note that all drivers (well, except for a few buggy legacy ones with workarounds) can DMA from/to highmem.