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=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 330C8C433E6 for ; Tue, 23 Feb 2021 07:22:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6E1A664E32 for ; Tue, 23 Feb 2021 07:22:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E1A664E32 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9763D8D0002; Tue, 23 Feb 2021 02:22:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 925A96B0072; Tue, 23 Feb 2021 02:22:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83B758D0002; Tue, 23 Feb 2021 02:22:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 6DBC06B0071 for ; Tue, 23 Feb 2021 02:22:37 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2763C8248047 for ; Tue, 23 Feb 2021 07:22:37 +0000 (UTC) X-FDA: 77848689954.16.A8F2945 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by imf08.hostedemail.com (Postfix) with ESMTP id D599B80192C6 for ; Tue, 23 Feb 2021 07:22:25 +0000 (UTC) Received: by mail-ot1-f50.google.com with SMTP id k13so4134319otn.13 for ; Mon, 22 Feb 2021 23:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DpaF+XrlRPqLNZ9QA+WPiUs8joOVV3LopnoOJY64BvY=; b=NNHrJmW2jS2V+5T5AnL3km3Re94L4xGJBmhxFBh2hds03thqQwHd7qJsFgwTZivSdQ NSO3FN0AG5yjRNFwS65SNpwo53eWoeYKuUazm8g91zmj8b91UhpkIFl/QsUA84rbArMP C7qosv5wai1B+yRpvR75pcLBJGTVy5QbiJJC4= 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=DpaF+XrlRPqLNZ9QA+WPiUs8joOVV3LopnoOJY64BvY=; b=ZRhWSFzJyFUqgCq0ZPmnxIu9va/9I/LRhjXQhIrsSgosTobmQ1I14G0KxdsKzVvreJ KS/BJ3cllE4lFHrejoPlBqLIrbMhskTFM/shUilrL5nfVSBBGWUoVVoDY2Mdf+Hryiy4 rH13S6jl1LT9juRiE93gJnE7f37Ry0vh3fvcYJtn9VFoYgKleYZtXXQokssetbNtUOS2 6kH4lRy9XyhMoKyZO44SYbZ0kktFGFUnapTpM77B2VWQL+AeuHc0P1nhdyQGH99JjVoc Qonp8BgG8N9PhPL6dbSEveBOb+XEFUH1RSSgEg73T8SztgVyPNZXQqvDUhPMZsryGXDP qaAg== X-Gm-Message-State: AOAM533bBzpvtZnUcSiUNctkOMRCbiiCPIWK1kjoljY9sCYoVXWbU4HT GS8g+CibYoPYfEakKM4eVihPTWOxRB38hh3jdTo1fw== X-Google-Smtp-Source: ABdhPJxtl+72oyQ1eandtDlxtpzvuP13KO1x4mZOnmum5QmMKuXAKYArHHVy/wyUyz+iO6PacAYQlwwOj30kkS2JMcw= X-Received: by 2002:a9d:2265:: with SMTP id o92mr19488004ota.188.1614064954922; Mon, 22 Feb 2021 23:22:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Daniel Vetter Date: Tue, 23 Feb 2021 08:22:23 +0100 Message-ID: Subject: Re: [PULL] fixes around VM_PFNMAP and follow_pfn for 5.12 merge window To: Linus Torvalds Cc: Linux Kernel Mailing List , dri-devel , Linux MM , "open list:DMA BUFFER SHARING FRAMEWORK" , Linux PCI Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D599B80192C6 X-Stat-Signature: gj7h1b63dxd9or5iqraq4esdqucimdn6 Received-SPF: none (ffwll.ch>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=mail-ot1-f50.google.com; client-ip=209.85.210.50 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614064945-607836 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 Tue, Feb 23, 2021 at 2:42 AM Linus Torvalds wrote: > > 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. Yeah it doesn't matter, it just confused me, so I wrote a patch to remove it and get experts to tell me it actually really doesn't matter. So that's really the entirety of that one. Like I said, I mostly stumbled into this rat hole because I had some questions, wanted to understand stuff better, and the code did not provide consistent answers :-) > 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? tbh I had no idea this exists, but yeah I've fired up gdb on some of the register dumper tools we have that use the pci mmap files, and after fixing some thinko in the first version it was still working after the conversion. >From a quick git grep almost nothing wires this up, so yeah no idea whether it's still used. Definitely not useful for X hackery anymore. It is wired up for uio framework, and I guess for debugging userspace drivers this comes handy. Although letting your debugger do reads/writes to device registers sounds scary. -Daniel > 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 -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch