From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 905145DF2D; Mon, 18 Mar 2024 23:20:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710804048; cv=none; b=ptHv1SOe8RZBxmvU9vy9AB27E+UxjI0G/bWhAws28Eprp8FxMufZEWosYKlBkKozHnaOOvGu2I/5DT1t1cJ2ZpLULQVHOslMuIUEujItdY+YjvaKBg7iURheNAE4v4eCPDIvYG4fT3uTBmu3hFVYcouZCzOMz/47shcTGvuMva8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710804048; c=relaxed/simple; bh=DDHPuHjimB+eInGEiyuX23sCywLwLYXf4GLYlJb7AWY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s//hlv5HP9OxkONus6Ql6BcxtLhx0nWk53rDEMIQ0SyP3YIHtmG+yL7ISu+Jn8ZMNtZxbMVhbv3n/I9GDmFB+Su1MQ+Id+QYPhqYzxR01AaO+L180fxbk5XE3lVGSK5tyQ/NvINXCa/mCmz9M1ObjO1ryB65aMdTU9n/OE+/P7k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=3RZ1lIWn; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="3RZ1lIWn" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=U5hIl2aY7B11ZMNAsPi+v840t3fuUcO6Vox3nrOcilQ=; b=3RZ1lIWnO0oWioItdZPDwSg9rF EsyCQtd7T3cLWBxmAjAEpkvTFkcHEYQ1gM4uCyKlfY0x5IWBgd/nzM5BxShXPz3kqAbHEerSvMWv4 l5bA2UDexKOMPIFD/BWlomNsu1kQP5jDMGYiKcTJWGcF9+s1ifnKdBZYbewBulXj0ls0KMte2tkYU Wnz78Ch3JZQrEoeCuEqNFc733Ds+qJPIoOGnmGRbb58btmR3aSnQsjItIBR+f7cbhm+P3EKtdkHQ/ MehX1Ea56OmyMghzoowEKb6MbP2euzT22LPDI4egr8Oa84S/Ggkhpw5G2B5Ia2AseuzgHBkpHgt9C 7cxfHhrg==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmMHX-0000000AWmW-3N6Y; Mon, 18 Mar 2024 23:20:39 +0000 Date: Mon, 18 Mar 2024 16:20:39 -0700 From: Christoph Hellwig To: Paolo Bonzini Cc: Christoph Hellwig , Christian =?iso-8859-1?Q?K=F6nig?= , David Stevens , Sean Christopherson , Yu Zhang , Isaku Yamahata , Zhi Wang , Maxim Levitsky , kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v11 0/8] KVM: allow mapping non-refcounted pages Message-ID: References: <9e604f99-5b63-44d7-8476-00859dae1dc4@amd.com> <93df19f9-6dab-41fc-bbcd-b108e52ff50b@amd.com> <985fd7f8-f8dd-4ce4-aa07-7e47728e3ebd@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, Mar 18, 2024 at 02:10:55PM +0100, Paolo Bonzini wrote: > Another possibility is to have a double-underscore version that allows > FOLL_GET, and have the "clean" kvm_follow_pfn() forbid it. So you > would still have the possibility to convert to __kvm_follow_pfn() with > FOLL_GET first, and then when you remove the refcount you switch to > kvm_follow_pfn(). That does sound much better. Then again anything that actually wants pages (either for a good reason or historic reasons) really should be using get/pin_user_pages anyway and not use follow_pte.