Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp57867pxv; Thu, 24 Jun 2021 02:44:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcodELkvj3PLP5C/456D2foSPEaf03mtVFOl2gCQZYQQl5ElVQe3G2RrKa3pK2v0XLJ4Ok X-Received: by 2002:aa7:dc0a:: with SMTP id b10mr5872441edu.134.1624527869749; Thu, 24 Jun 2021 02:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624527869; cv=none; d=google.com; s=arc-20160816; b=uaRhsMQAqgpVm6UNoOV+ZbsdqXL0/CkrHIiKSPwyDxdeA9SYLCQ83WdjS19fUBxpOO 7WNGsOEgs63VGlay+n4krS1UpkqActrtWVLtcPimmpDuWjxG50rs1dzjjwBHFy7MbCGK XAbtqHcAUkajRMTSUhX1fygVxcdtGh3za4aJ3nOLQ1+Q8lReet0rfP5sankBDcDBkel1 7lerWlVeyE7TmOXgaJEdpMybcy5VlSM2fWA9w2jvYCBA+fYVCFLoFm9wYg0Yysy3TtMy JupIKrOWRQfhbDOc1YgF8c1HwQOO5B3FKwGbtdIwqKY4kAbtkWgeOl26RptuOUNp0zqO Dt2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=jyD4vH5kMZavgg+0al23ybbW1mNcrfB3c+Wxr6kYX38=; b=MHmQezlP4YuuZ8HcB0ghGTwIRDtwjTu1yh5iGMm/zzfFwlnIzgZVg5QNzFGq84Bxwk 8OyPUWAzSqNGjPqYvz+xTbY8bGbnFQuA1+t0VooKFuHIXhJKbu4Ooqy5Ppo5E3NRfrUD NtmMjHkP9OZcL7BCEi8niKJRj7UspPDZRL85NMJpt3ORjUKkNxBffH9tDH109bbhF+NA hV58o9gD1JccUTIxPuu/ioCt7Kq3ebK/c3gCr0/k23w+duF1XutyqQ24q8/Z30393Wfs XAUkcE4VH3LgZ7hLx6UEFPWkZhcCAZUrZjQAZN1cW808MtOiZSq7Msi2Okr/3asSa4JN oCiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Dg09Q1JB; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si2357291ejk.374.2021.06.24.02.44.04; Thu, 24 Jun 2021 02:44:29 -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=@redhat.com header.s=mimecast20190719 header.b=Dg09Q1JB; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232014AbhFXJpB (ORCPT + 99 others); Thu, 24 Jun 2021 05:45:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56922 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231971AbhFXJo6 (ORCPT ); Thu, 24 Jun 2021 05:44:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624527759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jyD4vH5kMZavgg+0al23ybbW1mNcrfB3c+Wxr6kYX38=; b=Dg09Q1JBF1FT2yGNlpUzg5ZmMVjnOBAvUUr/3l3rEgNzCEWl6NxXAbpZOaTky7eftJRdKJ oLpHNwtWiHd3s5w1WybrIvw/U5xAXkcr7IYk7Yf6x3VaO8BxsZglrteqpEmK2bmTaeJjz8 YWZIaYY8hOjiyj/sr/s0Lnv4p8Zlgy0= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-126-hbzunVB9MtOHisGwD-jRnQ-1; Thu, 24 Jun 2021 05:42:38 -0400 X-MC-Unique: hbzunVB9MtOHisGwD-jRnQ-1 Received: by mail-ed1-f71.google.com with SMTP id m4-20020a0564024304b0290394d27742e4so3023679edc.10 for ; Thu, 24 Jun 2021 02:42:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jyD4vH5kMZavgg+0al23ybbW1mNcrfB3c+Wxr6kYX38=; b=hNN/IP/qfmk+gTPVUHXIZ+CL3LS8uiGEm8k+Bs6HeBXqFeM8QBny6idbLk5a+YuK3Q Tk3+OE36+y+M7SIZmtFhC/W5xq7T43j/ah+K2hkzm3gnwTTzLBEDqwGvbfTkc6fJcwVs zwF1Gwonf6JO+kwr7UR3ssug4cFk3cMseb108kDBOoHXZDdXy3owoXlmAEwM/0AeST1i aPIGue07psNFWNb0et5wd6D5K4TJbD04kMIY5UwtULkoyj9GGmCChrDAMOPY27I1qZkE 1/0bcxUGU4uxtPb4aEqDdDmCcLgQnar3OQi/6+/JJwaDPXIUrIHpEs4fVv+pNNHG93Zu 26Mg== X-Gm-Message-State: AOAM531pMFjlOlnJ0PRPPFxNhILJO43TTGJIjMTO6YVXlvRbXAzXM0Ys d0NaRZ5lW23FwBOEdZmhEZFK8uu0O/adKalgKTdmjLXAm/eTeskEVddAIE3hfWhVdVtvoeBAp8K ZkifMAOSDTMwc7n75MBCqDJwp X-Received: by 2002:a05:6402:54c:: with SMTP id i12mr5909967edx.64.1624527756950; Thu, 24 Jun 2021 02:42:36 -0700 (PDT) X-Received: by 2002:a05:6402:54c:: with SMTP id i12mr5909945edx.64.1624527756727; Thu, 24 Jun 2021 02:42:36 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id jz27sm944475ejc.33.2021.06.24.02.42.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 02:42:35 -0700 (PDT) Subject: Re: [PATCH 2/6] KVM: mmu: also return page from gfn_to_pfn To: Nicholas Piggin , Aleksandar Markovic , Huacai Chen , Marc Zyngier , Paul Mackerras , 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> From: Paolo Bonzini Message-ID: <201b68a7-10ea-d656-0c1e-5511b1f22674@redhat.com> Date: Thu, 24 Jun 2021 11:42:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1624524331.zsin3qejl9.astroid@bobo.none> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Needing kvm_pfn_page_unwrap is a sign that something might be buggy, so it's a good idea to move the short name to the common case and the ugly kvm_pfn_page_unwrap(gfn_to_pfn(...)) for the weird one. In fact I'm not sure there should be any kvm_pfn_page_unwrap in the end. Paolo