From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 AC7B9497B96 for ; Mon, 12 Oct 2026 15:07:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791817641; cv=none; b=AMeFvy2wi59aF80uRShV96r5Cwc0FC005pGNLosuhmcbUHw5SStUqA9tIx2HHAew99pG7Opr/kPPZ/U5ZRpCPd8T3r6iq5uMJW8Iu+YN9ycFR7bt37P4rQXO0FpyFAFOUijtBs5Tla1DI5r3rzOT83dXWQfGsF6PGbVVd0Q9MZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791817641; c=relaxed/simple; bh=tsVU21nxAD5GAzHrBR7QE3ds3Y9VaK8s6sj4rTQ/imc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qebWM676FN+VP+PDyMcPvmqvdjIrQaylz2LbjGNkuk+2AykUe3+fTe/Srhy/RvY1p/zgpN7XzBu1/Z4OsQyAf6RV1rPbcT6WPDx3U36J6YkSXet6pphD7z+5d9w4y4u0SZBKF09CQhpHSxIcE7RHfUjIwZ/GebNmqIdMu1Lmspk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LyAGQb79; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LyAGQb79" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-48c411d6615so1372041f8f.3 for ; Mon, 12 Oct 2026 08:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791817638; x=1792422438; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=tsVU21nxAD5GAzHrBR7QE3ds3Y9VaK8s6sj4rTQ/imc=; b=LyAGQb79u9R7nttKMdtpi1fPGlIprpgO1689zl1kD4q9v/P9aIA9FyvLTNRzqFikU7 8UfrtJ1F/z64nyCqVP0vEykm1I6IDNUbhx1wn/yIoe1qlAJZPW9am9eb0WhXzBoIelI9 MSQN3ORBsfYyhEGem0TxoFRCGo+DpjeD8jZky4EUJd2YlQM9fP/ot1eoVbYVgTXbzZAv 1KD35A+sZ8s7hz3Kp8xCb/QKo1KxZJpqUHvJ7KQh/yyxVN0VPIzmyAp6t/3M1rKnbCIC 4FKfRV21UWUFXOBiSPlE+P+hrxUgmDQUgKr1tD3j0PtJTepy1r/oRPq/Vx7RhLCy8f0e glpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791817638; x=1792422438; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tsVU21nxAD5GAzHrBR7QE3ds3Y9VaK8s6sj4rTQ/imc=; b=tPzGB8+iaJY7Fk7BBhTYP9gexvu/W3G45+g8Mt7IUop1hc7INSCnU9/HEQNdFEw2Se SATKctPtRyoLQcr0QlAMPs9K5hE/0oUhWGD13bJ4kzsokq+S5qpRPkwOUmZC8r/hoGKz z071GuaWiWfMim9GUGRzO90ul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== X-Received: by 2002:a05:6000:29ce:b0:48c:6fa4:fc89 with SMTP id ffacd0b85a97d-48dbaadb050mr12203015f8f.12.1791817637606; Mon, 12 Oct 2026 08:07:17 -0700 (PDT) Received: from dev-dsk-fgriffo-1c-93421965.eu-west-1.amazon.com (54-240-197-234.amazon.com. [54.240.197.234]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48ddaefa06esm3451088f8f.20.2026.10.12.08.07.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2026 08:07:16 -0700 (PDT) From: Fred Griffoul To: Paolo Bonzini , Sean Christopherson , Marc Zyngier , Oliver Upton , Andrew Morton , David Hildenbrand , Alexander Viro , Christian Brauner , Jan Kara , Jason Gunthorpe , Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Jonathan Corbet , Shuah Khan , Ackerley Tng , "Aneesh Kumar K.V" Cc: David Woodhouse , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Steffen Eiden , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.linux.dev, iommu@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH 0/9] mm: Memory providers for guest_memfd and iommufd Date: Mon, 12 Oct 2026 15:07:15 +0000 Message-ID: <20261012150715.25132-1-griffoul@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: <20260720111259.122911-1-dwmw2@infradead.org> <20261006183235.16576-1-griffoul@gmail.com> <20261012095800.50250-1-griffoul@gmail.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=UTF-8 Content-Transfer-Encoding: 8bit Ackerley Tng writes: > Wait, is there some magic done to make struct pages represent different > frames, as in PFNs? In your model, the struct page <=> PFN mapping > doesn't stay constant? No, our memory has no struct page: it is a carve-out hidden from the host with memmap=. I meant the mapping from guest_memfd file offset to PFN. The PFNs never change, only which file and offset they back. > Do multiple VMs map the same physical memory at the same time, or is it > a move like below? Mostly moves: a page has one owner at a time. There is also a share, where a parent keeps a range and gives a child a view of it, so two VMs can map the same frames for a while. > I'm thinking that if guest_memfd wraps your provider, then your provider > can issue a revocation to guest_memfd (ctrl-f for > kvm_gmem_provider_revoke in [1]) on the move source guest_memfd inode, > then wait for an allocation request from the move target guest_memfd > inode. For the guest, this series works the same way: the provider revokes the range on the source, and the target's next guest fault asks the provider for the frame. Devices are different, because a device may not support faults. So the provider also revokes the range on the target once it owns the frames, and iommufd maps them right away. In other words, a revoke means that the frames behind a range changed, whether they went away or arrived. > guest_memfd is going to support preservation [2]. Tarun's series just > preserves memory from guest_memfd's default provider (buddy allocator) > now. For your provider, I imagine the preservation flow would preserve > whatever metadata in guest_memfd (like the attributes in the maple tree) > and then go on to notify the provider to preserve some range of PFNs (or > folios). Your provider would then basically do nothing, since those PFNs > already survive a live update. Yes, that would work for us, as long as guest_memfd does not also have to save the offset to PFN layout: the provider keeps it across the update, and guest_memfd can ask again afterwards. Thanks, Fred