Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2047561pxb; Mon, 22 Feb 2021 19:02:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWuo9Zi37nA68K+qtLtCIpJlMYa1kqdPpVJeyF3GLhSeh3ZvIdQjMtfe7Vi9SCLKLeFSs0 X-Received: by 2002:a17:906:4707:: with SMTP id y7mr24830743ejq.79.1614049343080; Mon, 22 Feb 2021 19:02:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614049343; cv=none; d=google.com; s=arc-20160816; b=nbNddgtQPIlnLhGFXjVjrTjvQiOkTUFrDnFRZ5GDp/3WYx/pYUJsYeYqrTJncO749u zGBJQrEBlIBHV7iZn9OZWNTLiHxaAibAz2tklaOj30IiklinC/gPq0nBBz1eSD5Cwh3z hZundPD2aU4opKnQmWO5TJosCK4pJ/J4MtnB3qI4PN1HPNU+9QJ6wbmPl8pIzRJ5Q6Fy CQ9RuH5dsTQ8clVsWgCp0GIx85Vzp9L0Xwe1RErxx/0856CU6jt+b05EqtwMsqKt2Meb RiNg8T2n8ALKv0DeO0IVIIGThdqmHWHt8s3hm/LtnYUQZypLkSLWSlP0Rk82eltBWACi fIVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RDooO6fVmEytrmsO+OdxP0t5z+1dW14dWuhPYDbhrNw=; b=urA0jUe2WU78afNuABVMLYSG0w9mkogc1Ud/VQxgIqaNsTxBnSDYC7VXwMXfI8hQey 8cFAvdKdU3hsAb6KMwzxClT84W9uOirrCa80Z4z5ZXTJI3tyGfi7OklLMUmYy4S++qwg 0cnvyDVYtxpm0MIQlMEODFoFStg4Qv11HQM6oWqWxMc73ZbGBaHfTKUt/J1ns0jRgou1 P/9eu/1lZkI+wxM9NfSLXFAYwDgmTHImcXAj56CLoJmPo2h6RdGV7iy/PINDkdjlfUxx ppATrbxWAkUX/3xj9VyGpT3Yb6h6w/7jsA2kyXIicmPSKS1jSuVVN3z/seleHcJEkCxg YS3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TOQ2+I+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si12252934edj.155.2021.02.22.19.01.47; Mon, 22 Feb 2021 19:02:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TOQ2+I+m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230417AbhBWBnk (ORCPT + 99 others); Mon, 22 Feb 2021 20:43:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbhBWBni (ORCPT ); Mon, 22 Feb 2021 20:43:38 -0500 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9902C061786 for ; Mon, 22 Feb 2021 17:42:57 -0800 (PST) Received: by mail-lj1-x232.google.com with SMTP id v17so177064ljj.9 for ; Mon, 22 Feb 2021 17:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RDooO6fVmEytrmsO+OdxP0t5z+1dW14dWuhPYDbhrNw=; b=TOQ2+I+mHXr+E4ckMqzQngYTWUZIiJAMZ4kPqTle0k554YS65ZycN+V9HItvfQ50zr EZoT+MbgL+/zfMBRgcqu5UVoaIVwhD+SMKXUFtegjKSZY4TW2k7+/++d/M+F9xtNPSR4 QNS7Z4Yl0m5J+4tzYKAjfLF5jYN/rQ/3C6zUg= 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=RDooO6fVmEytrmsO+OdxP0t5z+1dW14dWuhPYDbhrNw=; b=NwpXCDx7wM12/GiXwdZANsWtONl9rmvpvNqSgiMG0wkk19yuxg8P5KZjfZy9zDUQah WmmS9b/q/aHQv11AuBj8JaaTY8VeOedzuyqQOZXHWeeWc90ThD42DHUlWtbK/+YzYIy9 8A1x+XS31P6tLfOpavX7d3CZMdfhGFnMkpj5GdMtoGq9qk/jOaLjFgpsYUAeeiCilGWd 7NkKeAoPLcar9ACCCTS6bnrBj44Ph4WKLQMQNT1RsD67GqpPkabj/rrkuaMeS7n/N//a ia7ACtj5vIe++E7m7c9pmv67OC517xv72SEXLKolTHgHakili8tmtkciMksIrGlKCxzL orbg== X-Gm-Message-State: AOAM530dTsAjyGEHWj11dNVXUhZ4JOtfHznO4uf5IZ1R5B2O5QFHdbYA CgENmEMXJ0jWrji+NyzEPXHZ6hKqPkT39w== X-Received: by 2002:a2e:5356:: with SMTP id t22mr15474679ljd.257.1614044575175; Mon, 22 Feb 2021 17:42:55 -0800 (PST) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id o24sm20779lfg.64.2021.02.22.17.42.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Feb 2021 17:42:54 -0800 (PST) Received: by mail-lf1-f42.google.com with SMTP id v30so8843276lfq.6 for ; Mon, 22 Feb 2021 17:42:54 -0800 (PST) X-Received: by 2002:a19:6916:: with SMTP id e22mr14384009lfc.421.1614044573962; Mon, 22 Feb 2021 17:42:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Mon, 22 Feb 2021 17:42:38 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PULL] fixes around VM_PFNMAP and follow_pfn for 5.12 merge window To: Daniel Vetter Cc: Linux Kernel Mailing List , dri-devel , Linux MM , "open list:DMA BUFFER SHARING FRAMEWORK" , Linux PCI Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22, 2021 at 2:25 AM Daniel Vetter wrote: > > Cc all the mailing lists ... my usual script crashed and I had to > hand-roll the email and screwed it up ofc :-/ Oh, and my reply thus also became just a reply to you personally. So repeating it here, in case somebody has comments about that access_process_vm() issue. On Mon, Feb 22, 2021 at 2:23 AM Daniel Vetter wrote: > > I've stumbled over this for my own learning and then realized there's a > bunch of races around VM_PFNMAP mappings vs follow pfn. > > If you're happy with this [..] Happy? No. But it seems an improvement. I did react to some of this: commit 0fb1b1ed7dd9 ("/dev/mem: Only set filp->f_mapping") talks about _what_ it does, but not so much _why_ it does it. It doesn't seem to actually matter, and seems almost incidental (because you've looked at f_mapping and i_mapping just didn't matter but was adjacent. And generic_access_phys() remains horrific. Does anything actually use this outside of the odd magical access_remote_vm() code? I'm wondering if that code shouldn't just be removed entirely. It's quite old, I'm not sure it's really relevant. See commit 28b2ee20c7cb ("access_process_vm device memory infrastructure"). I guess you do debug the X server, but still.. Do you actually ever look at device memory through the debugger? I'd hope that you'd use an access function and make gdb call it in the context of the debuggee? Whatever. I've pulled it, and I'm not _unhappy_ with it, but I'd also not call myself overly giddy and over the moon happy about this code. Linus