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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 C2EECC433E3 for ; Tue, 23 Mar 2021 15:51:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 63A9F619B7 for ; Tue, 23 Mar 2021 15:51:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63A9F619B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EF4518D0011; Tue, 23 Mar 2021 11:51:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA2808D0001; Tue, 23 Mar 2021 11:51:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1CCF8D0011; Tue, 23 Mar 2021 11:51:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id B39318D0001 for ; Tue, 23 Mar 2021 11:51:39 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A3EC88249980 for ; Tue, 23 Mar 2021 15:51:38 +0000 (UTC) X-FDA: 77951579076.18.A0E07FF Received: from pio-pvt-msa1.bahnhof.se (pio-pvt-msa1.bahnhof.se [79.136.2.40]) by imf24.hostedemail.com (Postfix) with ESMTP id 966A9A000860 for ; Tue, 23 Mar 2021 15:51:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTP id 6385740788; Tue, 23 Mar 2021 16:51:36 +0100 (CET) Authentication-Results: pio-pvt-msa1.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b="EleZm2I2"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Received: from pio-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AQDp60f0fYOG; Tue, 23 Mar 2021 16:51:35 +0100 (CET) Received: by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 3C6D83F377; Tue, 23 Mar 2021 16:51:33 +0100 (CET) Received: from [192.168.0.209] (unknown [192.198.151.43]) by mail1.shipmail.org (Postfix) with ESMTPSA id E831D36062E; Tue, 23 Mar 2021 16:51:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1616514693; bh=PpnHon7n76/I1Ml56ry5YIl7V1XFxUoZiFQo7XIsOo0=; h=Subject:To:References:From:Date:In-Reply-To:From; b=EleZm2I24aMAYaz/MhnjN5URzc/kqVuAlD11PHvbPJkB6NfaxhcapX1jFTojbTeCH YcXbLcUWfQuEAg4fueeGtqiloALYj+O3rApzyHT/tKPQULCenaCZAUqGdJ4SzWq6D2 6ZulON8q3PKV981iNkLaa2ieqssk+3jaon34zKUw= Subject: Re: [RFC PATCH 2/2] mm,drm/ttm: Use VM_PFNMAP for TTM vmas To: Jason Gunthorpe , dri-devel@lists.freedesktop.org, Christian Koenig , David Airlie , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210321184529.59006-1-thomas_os@shipmail.org> <20210321184529.59006-3-thomas_os@shipmail.org> <20210323140445.GF2356281@nvidia.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= Message-ID: <4a47b044-3660-48e6-647d-4a2217cfa287@shipmail.org> Date: Tue, 23 Mar 2021 16:51:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210323140445.GF2356281@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Stat-Signature: yfj8itfqm4r99yjj398mo5p1p1s7hyah X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 966A9A000860 Received-SPF: none (shipmail.org>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=pio-pvt-msa1.bahnhof.se; client-ip=79.136.2.40 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616514696-281200 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 3/23/21 3:04 PM, Jason Gunthorpe wrote: > On Tue, Mar 23, 2021 at 12:47:24PM +0100, Daniel Vetter wrote: > >>> +static inline bool is_cow_mapping(vm_flags_t flags) >> Bit a bikeshed, but I wonder whether the public interface shouldn't be >> vma_is_cow_mapping. Or whether this shouldn't be rejected somewhere else, >> since at least in drivers/gpu we have tons of cases that don't check for >> this and get it all kinds of wrong I think. >> >> remap_pfn_range handles this for many cases, but by far not for all. >> >> Anyway patch itself lgtm: >> >> Reviewed-by: Daniel Vetter > I would like it if io_remap_pfn_range() did not allow shared mappings > at all. You mean private mappings? > > IIRC it doesn't work anyway, the kernel can't reliably copy from IO > pages eg the "_copy_from_user_inatomic()" under cow_user_page() will > not work on s390 that requires all IO memory be accessed with special > instructions. > > Unfortunately I have no idea what the long ago special case of > allowing COW'd IO mappings is. :\ Me neither, but at some point it must have been important enough to introduce VM_MIXEDMAP... /Thomas > Jason