Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2825077rdb; Mon, 12 Feb 2024 19:40:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWcB1smuzQo/4hAZbduGQKaPQ2MbOQC+yvkV/FB3nn1yl2DxdHN4Oujt8JQv6jEVqpttiE67hQ6BtFjN6mF9+VRTESNBJbUjDL/5+XZfw== X-Google-Smtp-Source: AGHT+IFnasClroCppyn9oSGo/465i3jUqoFQ1//mr3QrNIVZX/aqsDCKa9sTlx7hSvzbXTaLu73n X-Received: by 2002:a05:6402:b03:b0:561:f8f0:1633 with SMTP id bm3-20020a0564020b0300b00561f8f01633mr114417edb.25.1707795608035; Mon, 12 Feb 2024 19:40:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707795608; cv=pass; d=google.com; s=arc-20160816; b=iKfvcfBqGg7n99brde1f9t0i62vViXiSmX1tq1vcCzIh62LRakfOiLumihI7R2b/mE Vl3haTVEN90UXbhU6MWbK/mWYjwygaLlyBPj9qr2ErM7MOJpgfDnricCXajFo7E81vTn gA8mSCgPKa1mb2GXK8AMs9OTYFGdixdvKex4dyTgmICm5Q26nS9eZSxdi20a3yubktQr sXequ/i3R2EP5iGC4zgQJ5n5d7ykTecEqFKgWPwQC0tNKDZn/xF7UAsoAUs9fyFGQPEq zLHWSGljHpqJL8OpoejffNVowJL+c135wpN+UdDBZ13mUmNAaJwpTM7Jvse40tb8SO+Z dSwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=RA6zNvnSFSM19FK25XmCjdxkJlEdzHYrL47jTvjMoZg=; fh=AIr/ugkRTIBjoKohZmMB36Wjv9iju2kxE+0m3h5I7y8=; b=TfJc0U6FpXrTQK3+jVKSS/fRqmg6dID5P2qdWvwH2JWFgDEE0wCd3yfp1oETmLDWkb Z6Ifr6LTiSh9VY5RVLUDPu6HNGzRbM96uLKPFQbCqn0dMDtMmL1/PgKyULy0StRj20zr nnh9lHC2hMDwUGmGui8DYq+8oevtMChrjIePxHI+ub2wpN+7wZ+jLivQgal5fnlBNur9 76ITQazvgU32dr6MWi0TAQZuXOsza6ExHmasRrX5pLlNsNjBFpntPF8pDJz8jg5KTSKh t4iQEiqV0x19FeNsrDePgqGam+maoDkVDP0qW/tWagf4JngbkfeXfr2RqxMKCQVXXhbW b/XA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iqHm2blK; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCUfPhsOfL3idggPRaPFG2fz4T/owIkr/qgmOge0Eh0oi3raicAXvuXbueyIpk4EAuQqXEYuwjLOZ2wLThLzZGV0K6U9XxJPrgdpZFPFxg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y63-20020a50bb45000000b005600a1d5da0si3323230ede.674.2024.02.12.19.40.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 19:40:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=iqHm2blK; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 98C051F23C9C for ; Tue, 13 Feb 2024 03:40:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29335D26B; Tue, 13 Feb 2024 03:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iqHm2blK" Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (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 E5726BE58 for ; Tue, 13 Feb 2024 03:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707795593; cv=none; b=b3mpDSauglFUgPvMBpEmKpGUYbbRGuGKEphpoTv1TACIEvdpzXq6E447GvtzfzyXubz37YbBmm7JCCQRdi3ewBj6C3uPIbgn/0Zqf1P7WjcsABK91EnRouhpqeDeOIS/RMcZGx4Ey0w2rZjve7xGmrAXRlxnlrNz5ExjW8FVu/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707795593; c=relaxed/simple; bh=5+qYZYJemzYwmTCaksNFbQuIKvJDzxrLlD2bZz/R0H8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cVDxj2mAm0EptzbKumj1iFAPWV4My0WsU34lx7RKbhGjbuGxmc8NJPBTNjQ8cii4obmLGBUeZlCxbEdyZdssB+iccPPpV/jvdr5JBimWBllprb0yalYAqYJ2W68lI5ZFIBdQhNV0XzUv8p5iNL3hif7qTQg97me7CDFTxyUPRMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=iqHm2blK; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-6e0a646cf95so2038050b3a.1 for ; Mon, 12 Feb 2024 19:39:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707795591; x=1708400391; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=RA6zNvnSFSM19FK25XmCjdxkJlEdzHYrL47jTvjMoZg=; b=iqHm2blKCbxI+zmJl7oaUHywzfPRoyciVuywnPzNHJ7b60FonHTeDx+NQ3x94SdoxO S0MhGe9SPTYqfiIlF1uK0eh/m3pK0yT+GVp3GxaU9S3opnPCxxwIM43B9kf3eXnccFOG ZXi3AmiH2OQRhw4nEaD2WoxrUBE0Pq2ULPrcaUz/15aR2JrDVmwLl9j9GGIILHiRCbv1 Rp68CqKu5VLa15wnYcqAqjxm1fwjYFmFqT30WnKUz23spVWuYclFM73jwyGA9O/b+uy3 v/kUKTz4SQrxVOmPZ14pehFFp37ajFEA//nXtlePAsN/vxUmjVfw2h417pyvczIO1W5F CvzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707795591; x=1708400391; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=RA6zNvnSFSM19FK25XmCjdxkJlEdzHYrL47jTvjMoZg=; b=aFBKZc/9zo1ZjjgJLxdzCqEs7vqgI+LdMwULPHQR5vp7MdbCHp/txlyteMK6Yd5alj KpTPlPiJtEkM2xdbb9o0bROoNPjW/VdysVlJ2O8f10OlyvzZ3B8ABknqrmISq6L262KM 5IjLw7zkq9qNm6t5CpGt5bVjiz5ZqOawXCpQxrzoH537z8BwN/BL3hO+/KVIjvKpWntE 7An5uR2NzL1xIX//d/3Lw4smpJPEJBBmSyB+KBZbL4uGMyt5idcWQfaSsjFkO6QN+AB5 Dq0QwA4cp+fmXxweoKexk4F0JKBKepgv1gfeAtXSLg53zmpb8R0mI6y01I7DXllTG43w CJ2w== X-Forwarded-Encrypted: i=1; AJvYcCUmdnVfXhrgxbJccyyaE7D4FWZJunESNVbLgrqSo7GFqjEnRAugw5VzrgQkHGrRcXRep98RNS93poA8xq1MKtcPGuqkdw3fvXJ5aIfm X-Gm-Message-State: AOJu0YyzNqA2DCk5402lmPOerIhJ+fNQLlO7kRxFZCV96yIU0qYwPf4l 3FVZByFPspvWZxDLYd04pl/C6jWT7cTTq7AZyGGsVL8JwtQGahAprKMBGHfvZwr1pG3gH9jZyj6 i/g== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:2d2a:b0:6e0:e2f8:cf40 with SMTP id fa42-20020a056a002d2a00b006e0e2f8cf40mr175477pfb.0.1707795591087; Mon, 12 Feb 2024 19:39:51 -0800 (PST) Date: Mon, 12 Feb 2024 19:39:49 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20230911021637.1941096-1-stevensd@google.com> Message-ID: Subject: Re: [PATCH v9 0/6] KVM: allow mapping non-refcounted pages From: Sean Christopherson To: David Stevens Cc: 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 Mon, Feb 05, 2024, Sean Christopherson wrote: > On Tue, Dec 19, 2023, Sean Christopherson wrote: > > On Tue, Dec 12, 2023, David Stevens wrote: > > > On Tue, Oct 31, 2023 at 11:30=E2=80=AFPM Sean Christopherson wrote: > > > > > > > > On Tue, Oct 31, 2023, David Stevens wrote: > > > > > Sean, have you been waiting for a new patch series with responses= to > > > > > Maxim's comments? I'm not really familiar with kernel contributio= n > > > > > etiquette, but I was hoping to get your feedback before spending = the > > > > > time to put together another patch series. > > > > > > > > No, I'm working my way back toward it. The guest_memfd series took= precedence > > > > over everything that I wasn't confident would land in 6.7, i.e. lar= ger series > > > > effectively got put on the back burner. Sorry :-( > > >=20 > > > Is this series something that may be able to make it into 6.8 or 6.9? > >=20 > > 6.8 isn't realistic. Between LPC, vacation, and non-upstream stuff, I'= ve done > > frustratingly little code review since early November. Sorry :-( > >=20 > > I haven't paged this series back into memory, so take this with a grain= of salt, > > but IIRC there was nothing that would block this from landing in 6.9. = Timing will > > likely be tight though, especially for getting testing on all architect= ures. >=20 > I did a quick-ish pass today. If you can hold off on v10 until later thi= s week, > I'll try to take a more in-depth look by EOD Thursday. So I took a "deeper" look, but honestly it wasn't really any more in-depth = than the previous look. I think I was somewhat surprised at the relatively smal= l amount of churn this ended up requiring. Anywho, no major complaints. This might be fodder for 6.9? Maybe. It'll = be tight. At the very least though, I expect to shove v10 in a branch and sta= rt beating on it in anticipation of landing it no later than 6.10. One question though: what happened to the !FOLL_GET logic in kvm_follow_ref= counted_pfn()? In a previous version, I suggested: static kvm_pfn_t kvm_follow_refcounted_pfn(struct kvm_follow_pfn *foll, struct page *page) { kvm_pfn_t pfn =3D page_to_pfn(page); foll->is_refcounted_page =3D true; /* * FIXME: Ideally, KVM wouldn't pass FOLL_GET to gup() when the call= er * doesn't want to grab a reference, but gup() doesn't support getti= ng * just the pfn, i.e. FOLL_GET is effectively mandatory. If that ev= er * changes, drop this and simply don't pass FOLL_GET to gup(). */ if (!(foll->flags & FOLL_GET)) put_page(page); return pfn; } but in v9 it's simply: static kvm_pfn_t kvm_follow_refcounted_pfn(struct kvm_follow_pfn *foll, struct page *page) { kvm_pfn_t pfn =3D page_to_pfn(page); foll->is_refcounted_page =3D true; return pfn; } And instead the x86 page fault handlers manually drop the reference. Why i= s that?