Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1494541lql; Tue, 12 Mar 2024 21:55:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUEXLjPRzn4SHeeQI+M2EWfZ9MARRBUiW4NeWdyuKNvySgiuTKa1ptiuRIVsNdWcv/9JtYMl4oewqdNRafbxSPFO/Ye1CKIii+wayfPcA== X-Google-Smtp-Source: AGHT+IHEhSZChhXT0IioL9LeklcgSEMNghBFd7uTMn/m2VZddcy7Ha/Bunl7GQtIp2RVtJwlmaEY X-Received: by 2002:a17:90b:3010:b0:29b:bcea:c17e with SMTP id hg16-20020a17090b301000b0029bbceac17emr3641803pjb.1.1710305744184; Tue, 12 Mar 2024 21:55:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710305744; cv=pass; d=google.com; s=arc-20160816; b=OJLzVB3XwDc1DWC0mVf853gItuGjOLh+BGh+a4xo1PB8rXdL4HvTn4GfYz7ea7U/Co iZ5myU78Ze0c5kXk23RzJy6oQxd4iSfxIYaUxOzg+jKTYbB0a8vbEj4RW+H/w3utKtGj F2GhzWO7tdvQtM5j6BJmv03c7qJUS2/v5ZAjin8Y9c/qNzl+DVmEmOFF8E4xOWVJJ6hG Sp2QJzYW9ffMVDOn2QClh+RRFB/BjsV7wUwmvIloo0ZixjK8X6vrZxpyWxQ6lMf0iJQW r9uw7K7970nPzO5auQ6Sw5FGIiuwbSRIqATPNKR12UnjfiTV3Hg0Kzd+dZfMfvvlkVB1 UA2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=RTWz8EpSDEWKJM3TEtQ8z2nh961615KfzXWZv+DoDH8=; fh=4krCrSuTNR8OQ8jYvRSPNCYnFDoXpslT+mXW4+J1+ro=; b=qltkUn5whzVTfAVYomE35E+DTXKhCAMF8O+t/fS8PAh28j8+YVwjMukiBslTKBNKkq dNlNIMG8nT0cOsIHhNgLmo6mXRhH4STYKurZnR5Cwhimmv8/zsZ6rCLROzP0HcRm6cQ8 q2AYmAG2umzxUU/U7ZC0aSBgnNJHZPU/Ww4DV7DbkWkKQrZbHLE95HZiyRHCoR7lmZ3W J0ojaxD2KVO4DzQ76Ca3QI40Wh/T2/oTWF4hI/SGCOvF53hSAgQ7jCGUgXxE0Xk2XRB8 ZwAFRwInjV6WUZIt8heEEh6wTmAPWPWLud5+bQ7tlRyaL0SDDKn1CTOuicSHkApT20GT JVDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=awKcicmA; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-101110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101110-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 pf5-20020a17090b1d8500b0029c6498f240si258791pjb.57.2024.03.12.21.55.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 21:55:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101110-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=@chromium.org header.s=google header.b=awKcicmA; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-101110-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101110-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 92C19283670 for ; Wed, 13 Mar 2024 04:55:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B904612E5E; Wed, 13 Mar 2024 04:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="awKcicmA" Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E35B1119B for ; Wed, 13 Mar 2024 04:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710305734; cv=none; b=aBUFPdpJnFYRUhCzrLymtNdxstaR1E07aRRCJBvmRbrF87axdBxBBaYU7/ETEIQk2vCA+kP/BYX3z+FeQVwgAFejB9faLLiAlz70K3LZ8LFBKMss6E+qdCb4bzgvhtYyWlyhA3FazjveY0btS8r79hxFDJ0ZdeedsJ8QoKUGK0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710305734; c=relaxed/simple; bh=RTWz8EpSDEWKJM3TEtQ8z2nh961615KfzXWZv+DoDH8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KqeATIHEls1GsehGbaosdQWhvg/01Loe4Du2iBq2OwrJg3fCSuzvneWb+T3AX37tcyrM1dUGabOdbbr/M+yf8XIxHpU3xVtHPAJEKDayuSqMrgG3pF8/hk5P8616KDnLxlE2nxGn764a38RgO/cZs3DwwnKHG6m4zBX5wFRQtVU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=awKcicmA; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-512ed314881so5592743e87.2 for ; Tue, 12 Mar 2024 21:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1710305731; x=1710910531; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RTWz8EpSDEWKJM3TEtQ8z2nh961615KfzXWZv+DoDH8=; b=awKcicmA2sv2rFN9PCIV1Fem03o9I0g9Wrvm3KyafY/yhQIPX9+EXvRl8EL+kMRONX pSLK3jilIQKwitliWT2l7MNIZ9tpcL0YzygrCKPn/mi3noAaEzb2WnG8dANN6m7EX6y5 0LYHKU7tGN3k5h9qJ1uABYfxGJZJVnvQY6Kc0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710305731; x=1710910531; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RTWz8EpSDEWKJM3TEtQ8z2nh961615KfzXWZv+DoDH8=; b=qnZjbausYMnU0v0+4TG8m9D8KH5UscX4WigU/nItftCATPUG0vZq+nSmzj7/2k185s 236PQCLv2oHdZQpCmK5YE7HQl57aD0uOqlLrspPV1diRkL/A9Q4+axytL5G5+lAel3fs xt1tT00iYltj5UVCYz0DjalsQZYq3mGROc04TUj5NdQJ3LfMrVD73osVawbt1bBWW24D Psk+kX7ByO+v3ob3qB+b5HBOIH+Qv+iJWmPbX6f6GrOCI+GvveMR3JP207CMgLJtW0/t U+cqTih0/2/D0h0fO6wE2ryBQ4p9S9NJbIP5MrzWfjYDGwil5mU140n3blR/Ug0clojj I6bQ== X-Forwarded-Encrypted: i=1; AJvYcCUqEsTGKYIUtONJpCs7STkp98glAG+I8RWVSTYA+Gs78WqNiRqlqA/rpCVeplQh3kfrvaKEnCEorrn3T0oOuAZqDw88n7aD3nl+NI7r X-Gm-Message-State: AOJu0YxfRE44gIdoxUVFhEcRG9HkkSLBJAep6AzGMXzjlRbOJOJmwLlH AsdeODWBXA9clJM2xn2XDamXxRMw4DgxCo9ZFfk79uFKnc/WwQSKnDtY9ak6KbDhK3wCcp7yeNg ZjaXUcxliEA/+VHHJs5YXdv0oSe3mgbgOBDE+ X-Received: by 2002:a05:6512:556:b0:513:c1e6:3c55 with SMTP id h22-20020a056512055600b00513c1e63c55mr1925135lfl.69.1710305731589; Tue, 12 Mar 2024 21:55:31 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240229025759.1187910-1-stevensd@google.com> In-Reply-To: From: David Stevens Date: Wed, 13 Mar 2024 13:55:20 +0900 Message-ID: Subject: Re: [PATCH v11 0/8] KVM: allow mapping non-refcounted pages To: Christoph Hellwig Cc: Christian Koenig , Sean Christopherson , Paolo Bonzini , Yu Zhang , Isaku Yamahata , Zhi Wang , Maxim Levitsky , kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 29, 2024 at 10:36=E2=80=AFPM Christoph Hellwig wrote: > > On Thu, Feb 29, 2024 at 11:57:51AM +0900, David Stevens wrote: > > Our use case is virtio-gpu blob resources [1], which directly map host > > graphics buffers into the guest as "vram" for the virtio-gpu device. > > This feature currently does not work on systems using the amdgpu driver= , > > as that driver allocates non-compound higher order pages via > > ttm_pool_alloc_page(). > > .. and just as last time around that is still the problem that needs > to be fixed instead of creating a monster like this to map > non-refcounted pages. > Patches to amdgpu to have been NAKed [1] with the justification that using non-refcounted pages is working as intended and KVM is in the wrong for wanting to take references to pages mapped with VM_PFNMAP [2]. The existence of the VM_PFNMAP implies that the existence of non-refcounted pages is working as designed. We can argue about whether or not VM_PFNMAP should exist, but until VM_PFNMAP is removed, KVM should be able to handle it. Also note that this is not adding a new source of non-refcounted pages, so it doesn't make removing non-refcounted pages more difficult, if the kernel does decide to go in that direction. -David [1] https://lore.kernel.org/lkml/8230a356-be38-f228-4a8e-95124e8e8db6@amd.c= om/ [2] https://lore.kernel.org/lkml/594f1013-b925-3c75-be61-2d649f5ca54e@amd.c= om/