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.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 4C27AC2D0E4 for ; Fri, 20 Nov 2020 15:35:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C306722D0A for ; Fri, 20 Nov 2020 15:35:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gkBZc7hu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BzmaIsz1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C306722D0A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=04unB9OQPJrYVDVOgwc55+0EOiSMd4wvyw/g6DFJDJc=; b=gkBZc7huxoao+VsNcNbATEDRN R7YemNp7KDSKQOwo46i9+nbqmwwf2WtvrS+uLwj+EeWIyh4CEgqkp18yBzP7gNbHtP6RouPz2TWjl p7yMmzeUJmjings8BpHCapYZPGDl5T1rSwTt8jEHDAwp55ob7CJpaRF6Eraz2cibgaw7K+vr9WwBI jGYvaPzvPvcvjpEzjOtzeKEgz+32+IQ4qLXajitMXzWcvjU6Z99m3DHsbvsmeKlA/007/ocwzEDQ4 sHW7g3JXEh/FlVpbPQnpxIzzNL1nNPZNZjdFdo8AwVVYJIPWdG22+c5Wn6w9yZqxSI4HhSOjiT4Js 1XBWrt80Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg8QE-0008Eg-Uo; Fri, 20 Nov 2020 15:34:03 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg8Q1-0008Aw-6n for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2020 15:33:50 +0000 Received: by mail-ed1-x544.google.com with SMTP id t11so9915185edj.13 for ; Fri, 20 Nov 2020 07:33:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hu7c85Nnad/NCLFvwvmPMVk5vXB6RmH3f8h9eUOgl90=; b=BzmaIsz1H6BVAIbAH9IvLryH4vb8O/6UhSCRnp06XFQRDmxv8tRES8boF0UNRfcvJa FOQYceZ7HDFXHFQt5NrioQms4xLE57+3p5wE8nI+1qbLkHTEjG4ILQgPTJWQSryLN+vP Y7p77Sp5LGtKgdkXehar1Xf7r6Oxn40NWIGwTXFu4MREQ/+EBEZlXO6IKlRBR8u2NFct hfqT1x/qHOUJOp7jOZ28M/5kQ5lHwKvKlPEqugKopuo3E9Ea29B+MHZa9k5/bzlFuZw4 cpV4WZ45p3JYrZOyq1l3kvJzajpgqZj+rHeJ+LT3hADUtWTfh021alrkCxAb6xX7zsAw XUeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hu7c85Nnad/NCLFvwvmPMVk5vXB6RmH3f8h9eUOgl90=; b=pY2K/yy0JgxspeZMtc8+EpbQI+iBttmhujN9ZTvYv8EM2lL4XQ45Ze6ufAjhCfBj8x nG/P4d/ZwQpHGJoeTKIZfZyPahS0+HBNKKEUAGfrTdSD7fL3YZGoI2D15E5suHTY++Iz GExuOy6jJ/KVswVq8MY2J5PD73WExsU0FL+1zruFM9rwUt/MQwYyYG+4i6wTbu7Cwllq eQ9AAS6QiRouCRW354UX7m1X8ebZRdY1wqzW6MnSljXeQ5kvUnWJPg1e2OqhTjCafdYK OIZy74NtK56AGcivOu/1GZ6tTXwVQfynOXpwfmyGsv3QVSDkZCDlbseU0auuZTVFaEOj 6w7w== X-Gm-Message-State: AOAM532kZ68SymcSngQ6mCHsvOxHCeyMfIjJtc8YoOuH3zk95gc/rIf9 Kyo+dy3v0NLVnzLyFU6dA8g= X-Google-Smtp-Source: ABdhPJw731OYdrhHa2qWzQq4JOlXbH+fA7iL3hkHPnFGLmtrlwCQKxKF56MlTknU1rfyVnD6hVXqLg== X-Received: by 2002:a50:e443:: with SMTP id e3mr37089342edm.160.1605886426571; Fri, 20 Nov 2020 07:33:46 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id a10sm1235482edn.77.2020.11.20.07.33.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Nov 2020 07:33:45 -0800 (PST) Subject: Re: [PATCH v6 16/17] RFC: kvm: pass kvm argument to follow_pfn callsites To: Daniel Vetter , DRI Development , LKML References: <20201119144146.1045202-1-daniel.vetter@ffwll.ch> <20201119144146.1045202-17-daniel.vetter@ffwll.ch> From: Paolo Bonzini Message-ID: Date: Fri, 20 Nov 2020 16:33:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201119144146.1045202-17-daniel.vetter@ffwll.ch> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_103349_399240_E2DBB86A X-CRM114-Status: GOOD ( 18.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Jan Kara , Kees Cook , kvm@vger.kernel.org, Jason Gunthorpe , John Hubbard , Christoph Hellwig , linux-mm@kvack.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Daniel Vetter , Dan Williams , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. But it's not a big deal, and the rationale at least makes sense. So, Acked-by: Paolo Bonzini Paolo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel