Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp66254pxv; Thu, 24 Jun 2021 02:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGMJK9Oe8BWEvIJs+NSaq5QLTL93PzLOFLjnVpMOWRKHwD4oQVXkXhUQ3WVC9Lv31r/77X X-Received: by 2002:a92:2004:: with SMTP id j4mr3034464ile.53.1624528787515; Thu, 24 Jun 2021 02:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624528787; cv=none; d=google.com; s=arc-20160816; b=OJwLIlDP4KMFdUmy6XiWsdaC47rKm0vlT49kIpGRIZzEOGhc9sf2lLKmMCSbCFEopX eskocrUpH3kXiG4QLwfLnTQ9QLdoXSNazAkjRRRHZn4DnYJVg8msneEUJy8ii/HHgmzw cttVtubhmdVt9d9wMJ0wS6xnTl3rcv0KUfrWyWnaZNkbRkN0B0KpWn1tMDioYG+jAFBI RW3g57Xl5vHRUw9vZIHkRphiKU3aqqa6HZGL/BwlRJlyC+EYtL52bkx43fUeL9U4FxQC AvUdyr62Edj7uNU9zlkBQFyBBYH89dQDeMHynrz+8h4TqKrVVeeobdfdKFB8ACZ86G+R eK5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id :mime-version:in-reply-to:references:cc:to:subject:from:date :dkim-signature; bh=2/FXkDvvz78LZzi8vEuw9P0gxvIPqn8+9Qh994D56qo=; b=XC0U7ERgQZplnLRp8d3Yrpyc6BPLrqQ93hALgZwdDWWi0dBNR+RCk1sH2cx3BK6D3f xrAKU6fsqcHoFPF7Ld4GnK2SBwgOERlQ4vltIcHqLpn47Vj5iDnNs3Y2AlmsidpB82xT 35EvmdbGVzwylMFUeSQDuEmFGNVFwmnyoPxdBR5mMUhqycL2WSJeqxyODI6H8yjqVGFj lo76RbMn+dfXWyJLc0DFiaQZX0S38O3YxRkxHYos/fMk7oiZa0Nwqsplxgr1pa+W38Vy qRu3uwZAbEAlxJ1FF6ohuVFoMfZ6qEAJcfzVj+qY/MkhQrq0HYMbMisoYNVtCG/fHkPc 80vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EhX2h/EG"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x99si2844362jah.122.2021.06.24.02.59.35; Thu, 24 Jun 2021 02:59:47 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b="EhX2h/EG"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232066AbhFXKAX (ORCPT + 99 others); Thu, 24 Jun 2021 06:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbhFXKAX (ORCPT ); Thu, 24 Jun 2021 06:00:23 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8790DC061574; Thu, 24 Jun 2021 02:58:03 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id w71so4725250pfd.4; Thu, 24 Jun 2021 02:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=2/FXkDvvz78LZzi8vEuw9P0gxvIPqn8+9Qh994D56qo=; b=EhX2h/EGnTWqdqRQbpZlpJcgT0oJJ6o7Nef8q7EtPvI99smF5fr4TIG1Xp5CmTthMl XHQzIJWggbxJUXpq8OIPTnYOso57K6OBKZR9lvcFT5+8SBJA9849ahv3W1ndrCYtoccT yygIYTNJlnGOy5EhAkMecjcGkX/PpQmk6jKwKuAM0vg6/CjPiKQtp4B/woWoN5Oxyu7M ua8ZUETzbjTOqOpCOLZ+ZXZ4cbXcI88NdWfpPkU+Dnz/3z1CLTZvVnhoG0DpsDAi9bV1 nK9pW2bxw2DMCvsnbAXlJB/lKwAPvP15NgJgI5cnQ6vQYvzhGuulMUnoZMx6s+4VaanO Eqdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=2/FXkDvvz78LZzi8vEuw9P0gxvIPqn8+9Qh994D56qo=; b=I9I+2OiO6x90DSdzE2/+u34W0RL5pju25egcTYnBRXEbeEn+eItzhqfuXHLN1nyfdG zHh7yfbdwbQ6CN2dAU+5GI7NhoWXGWKkML/yM+5JESCKHYQUigGJjFYmu7Zu4sM1iUaP Lgc6yyFrwQiWBgDJ58YQ86fJPQdLxMhEF00oN9r/utwsoi02gI7npGdRIyFNGoF+e/Gy C5ILp2gJnz5V4c6/FT58Bfu6YR1FydDYfppsPGUvn6mSZ5OmIUH67BJ2zuJYgusfA9Pa oKQ30oOaODL8QlT5w+PTeMR2hOL2vynck3cPE2hasDS6ovg0BIlVklXd6XGC6BhcElNB 9vSQ== X-Gm-Message-State: AOAM53296s1cmH/B9fuYn+FHy4xvzL/cf7DDu5mAzd3NLUX+K/3ATddj uilZu52pyBlYHl5qL7d3jao= X-Received: by 2002:a62:1857:0:b029:302:fb56:df52 with SMTP id 84-20020a6218570000b0290302fb56df52mr4317733pfy.3.1624528683047; Thu, 24 Jun 2021 02:58:03 -0700 (PDT) Received: from localhost (60-242-147-73.tpgi.com.au. [60.242.147.73]) by smtp.gmail.com with ESMTPSA id y20sm2759510pfb.207.2021.06.24.02.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 02:58:02 -0700 (PDT) Date: Thu, 24 Jun 2021 19:57:57 +1000 From: Nicholas Piggin Subject: Re: [PATCH 2/6] KVM: mmu: also return page from gfn_to_pfn To: Aleksandar Markovic , Huacai Chen , Marc Zyngier , Paul Mackerras , Paolo Bonzini , David Stevens , Zhenyu Wang , Zhi Wang Cc: Alexandru Elisei , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, James Morse , Jim Mattson , Joerg Roedel , kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Sean Christopherson , Suzuki K Poulose , Vitaly Kuznetsov , Wanpeng Li , Will Deacon References: <20210624035749.4054934-1-stevensd@google.com> <20210624035749.4054934-3-stevensd@google.com> <1624524331.zsin3qejl9.astroid@bobo.none> <201b68a7-10ea-d656-0c1e-5511b1f22674@redhat.com> In-Reply-To: <201b68a7-10ea-d656-0c1e-5511b1f22674@redhat.com> MIME-Version: 1.0 Message-Id: <1624528342.s2ezcyp90x.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Excerpts from Paolo Bonzini's message of June 24, 2021 7:42 pm: > On 24/06/21 10:52, Nicholas Piggin wrote: >>> For now, wrap all calls to gfn_to_pfn functions in the new helper >>> function. Callers which don't need the page struct will be updated in >>> follow-up patches. >> Hmm. You mean callers that do need the page will be updated? Normally >> if there will be leftover users that don't need the struct page then >> you would go the other way and keep the old call the same, and add a new >> one (gfn_to_pfn_page) just for those that need it. >=20 > Needing kvm_pfn_page_unwrap is a sign that something might be buggy, so=20 > it's a good idea to move the short name to the common case and the ugly=20 > kvm_pfn_page_unwrap(gfn_to_pfn(...)) for the weird one. In fact I'm not=20 > sure there should be any kvm_pfn_page_unwrap in the end. If all callers were updated that is one thing, but from the changelog it sounds like that would not happen and there would be some gfn_to_pfn users left over. But yes in the end you would either need to make gfn_to_pfn never return a page found via follow_pte, or change all callers to the new way. If=20 the plan is for the latter then I guess that's fine. Thanks, Nick