Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp678775lqt; Mon, 18 Mar 2024 23:27:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVEGBIq7UURbOcsz2CD4PYP1DtNDdt0vO38rfr7O3HTXtcMxiBWZ/aUCE1Tv/EFcoRdbjMiiq+LMji69BDeRhH+GTTtcDLQA3O/tZ9snw== X-Google-Smtp-Source: AGHT+IE7NRMT6zIUiXWJ9Kzhv9mrA2Rpx2CeAVMpGBxZp1Z5q3fhY0J/Mo0fBPvoI0hfcUbabLQc X-Received: by 2002:a9d:774d:0:b0:6e6:a1e0:4227 with SMTP id t13-20020a9d774d000000b006e6a1e04227mr918108otl.24.1710829665406; Mon, 18 Mar 2024 23:27:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710829665; cv=pass; d=google.com; s=arc-20160816; b=zS50TS8lGYeqKaU1lD57I49WJynjFUmCoKqOqyfwAEhrTAzu8593S9BbkmfYqxas6u kBKZf50g8Te0MUGkyfZbG2H3ywMbkye9dnKyCunQ+wUEA3GkkGyl9cZYX1mtuFL0U/e2 bQ8634kBFwJ9/LJ2WsMLBmgEvWPXBXun89b4VyB8yez0ukKC6PMWN/tEkYxI8upsrM8v GkY4Lw7p+8NsVelyKTLSkZ5bhy2RwQPnYqcf5lMe926eJ00waZOcYz/NKkVIjXedstEi wltBHgvUrSW8BzmFF3eCycvhEUTM7F6xPtC+DJurjA4QL1HgROGs4XEICrEazL93E7Uf +0ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=U5hIl2aY7B11ZMNAsPi+v840t3fuUcO6Vox3nrOcilQ=; fh=UKPNOQAwC8YkrFfLY2/yVYNK2TxygjM9wecrPIUPjHI=; b=mBXhYQEBSssDvBlFd6xsNGDsuB/7xh0tH1vK+yX9/zIzIHJjnieLo4BU89/F266iXx 4//DoLDea1XD1YuD5f/VY9jtq8gzd/BxqAJ0CsBI/YRJfWrJySU2a77qmcQut9AOwNVc iYqWT/47LyvLsH0qLehZpTfcbugTbTYw+X1ASFXBMmlnhD9b1obmAL8EjSjWVF1iFb2H Ytj3o9aPRASqcNVdmfYPaZZu4ursK7j0Ms8OEwzROFRSHFziGTTfOEETKvmvzddth+Jp slSEB5PuDXnFox8Jtg1lJJpEJJ8i9va/0BpiUjCy07JEabAeFsTYDqDguC7sAn3b12rr bgpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3RZ1lIWn; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-106801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106801-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q22-20020a63e956000000b005d8bc09efb4si9557815pgj.886.2024.03.18.23.27.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 23:27:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3RZ1lIWn; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-106801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106801-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 15DE12830AD for ; Mon, 18 Mar 2024 23:20:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE1A85E089; Mon, 18 Mar 2024 23:20:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="3RZ1lIWn" 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 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.