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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 24E9BC5519F for ; Fri, 20 Nov 2020 15:45:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6F3372240B for ; Fri, 20 Nov 2020 15:45:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="dfRfRtqD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F3372240B 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 BDD6A6B005C; Fri, 20 Nov 2020 10:45:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BB3DC6B006E; Fri, 20 Nov 2020 10:45:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA25C6B0070; Fri, 20 Nov 2020 10:45:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 7F2626B005C for ; Fri, 20 Nov 2020 10:45:13 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2BDAA8249980 for ; Fri, 20 Nov 2020 15:45:13 +0000 (UTC) X-FDA: 77505220506.29.oven15_4e044092734c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id E0DD3180865BA for ; Fri, 20 Nov 2020 15:45:12 +0000 (UTC) X-HE-Tag: oven15_4e044092734c X-Filterd-Recvd-Size: 4444 Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Nov 2020 15:45:12 +0000 (UTC) Received: by mail-oi1-f193.google.com with SMTP id o25so10891812oie.5 for ; Fri, 20 Nov 2020 07:45:11 -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=Id0PLSSDAy7IJx/4b1nt//hEs7fdMVA6YPiIkR5zClg=; b=dfRfRtqDF1RrZwS/1drnyGXFKRYG5zPQqdVzf4oNa4Km4m+WAgPk+uu7TX/an2oDZ2 vBVLU/Buv8L5yJxUzKzQqx57WMgV3BOEQu6XrPSxvCgoD7tiafoeKNJTaeHl6caT1Y4y wW2aFKG1iJ1Hj3bcVkn0J1Hf8qog45qEjZLYM= 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=Id0PLSSDAy7IJx/4b1nt//hEs7fdMVA6YPiIkR5zClg=; b=ZSgsb6aOJW01TJ5I4dVfmzpf5BoVAZDWy/3d60haXmwr5Yn1Cu+qWEvUuawvnzCoA3 6EkB1FoBfHp/lQA2In0WaFa5Fh2KURylHAAoXuG9fHGdeBAfDGtStFX7lXgRjQtmHh8z ms4Yuis78eidMlMFqjjag5C+vPzQZ7EuGAQ/1lOLtBOBkbjO0zky+7WNynW3ugAGufGJ BYmtRELr0oPOM0aRqr16DDbJ8gwQmu77xy4G+UtCCMmpF4pLw6kL2SCWBGmnasFryMnX 9JIAAQWX7Jd/DRILlJCr9iJLcFQzadC5P/67rnd2v57tdbg9HenDE0NLypWrCm0VSPFH SgLQ== X-Gm-Message-State: AOAM530KwxkVHLedFocQFJTbUQ3O8rWhRlyjday/1KzqpThOA//lmfkn iL5iyNc+KuAuJjM51WS4a82+oorK8T7SeS38HjkTYA== X-Google-Smtp-Source: ABdhPJxZSOR3YzYlAKw2cDHpm+laMCMM24uLZLKA5lft7iigCepfxe2uQ21R2KlDjhY86FMJ7oZu/z5k8KghnWux0Yo= X-Received: by 2002:aca:4f14:: with SMTP id d20mr6827257oib.14.1605887111047; Fri, 20 Nov 2020 07:45:11 -0800 (PST) MIME-Version: 1.0 References: <20201119144146.1045202-1-daniel.vetter@ffwll.ch> <20201119144146.1045202-17-daniel.vetter@ffwll.ch> In-Reply-To: From: Daniel Vetter Date: Fri, 20 Nov 2020 16:44:59 +0100 Message-ID: Subject: Re: [PATCH v6 16/17] RFC: kvm: pass kvm argument to follow_pfn callsites To: Paolo Bonzini Cc: DRI Development , LKML , KVM list , Linux MM , Linux ARM , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , Daniel Vetter , Christoph Hellwig , Jason Gunthorpe , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jan Kara 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: On Fri, Nov 20, 2020 at 4:33 PM Paolo Bonzini wrote: > > On 19/11/20 15:41, Daniel Vetter wrote: > > Both Christoph Hellwig and Jason Gunthorpe suggested that usage of > > follow_pfn by modules should be locked down more. To do so callers > > need to be able to pass the mmu_notifier subscription corresponding > > to the mm_struct to follow_pfn(). > > > > This patch does the rote work of doing that in the kvm subsystem. In > > most places this is solved by passing struct kvm * down the call > > stacks as an additional parameter, since that contains the > > mmu_notifier. > > > > Compile tested on all affected arch. > > It's a bit of a pity, it's making an API more complex (the point of > gfn_to_pfn_memslot vs gfn_to_pfn is exactly that you don't need a > "struct kvm*" and it's clear that you've already done the lookup into > that struct kvm. Yeah I noticed that, I think pushing the lookups down should work, but that's a fairly large-scale change. I didn't want to do that for the RFC since it would distract from the actual change/goal. -Daniel > But it's not a big deal, and the rationale at least makes sense. So, > > Acked-by: Paolo Bonzini > > Paolo -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch