From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E81CD132AE for ; Mon, 4 Nov 2024 11:14:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 052986B007B; Mon, 4 Nov 2024 06:14:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F1D7B6B0088; Mon, 4 Nov 2024 06:14:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DBDD16B008A; Mon, 4 Nov 2024 06:14:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id BB4B26B007B for ; Mon, 4 Nov 2024 06:14:31 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 62C871A07B2 for ; Mon, 4 Nov 2024 11:14:31 +0000 (UTC) X-FDA: 82748154048.14.2ADE710 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf30.hostedemail.com (Postfix) with ESMTP id B825D80008 for ; Mon, 4 Nov 2024 11:13:29 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hGl1cZd3; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730718786; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OqKIvRXdL8GS1+EnYUNL0PPGa5dMIJZdOgvVukf27mM=; b=u4FtllFPXPD5u9MjPaCN6DqVLRWaueP+nu2xh9Wcm1bFpRqhHlNyuAEWfKM4Kp8+NznXwA W+mxdYIwZUX/H/ntd0iN/nBmsbPENUVRoqeQIo7C62+blAanp+2SeXVIVFq4hE2P5+CgdX 3axreqT5pADv1m9rIIZPYRfpMapFyY4= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hGl1cZd3; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730718786; a=rsa-sha256; cv=none; b=VwvbOXsVD5Ft6MugbdQmxA/bnQIz8vP1IK75TcVowby+HD4rTZgmZzAXZ2V9Ka/GASxzHB wKn9nBYg02++6UXgq7n2Kc+NpV5tZaObJ+sAjGV+veaOBUNS2CFaVGQZQzw82Ty4RtjAnT jClWmHgeK1b2N0wlCNNed4OIBQf17vg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id CF5B45C54EC; Mon, 4 Nov 2024 11:13:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25F61C4CED1; Mon, 4 Nov 2024 11:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730718868; bh=xSEGve5ZFz4au7Yl8PLV8lKxWgq5DKLCVU2jOAHKCKg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hGl1cZd3iaMgJCJ0/0ArZbRgNthLliN4uJws/RHWqxjaCbGmnZHTSYDHo7gbxqSec P5gsX6qE03b7FGK3UcTSKRenBiyiNGZIW0NPOZAVtGE1yrLl2LnGGzG6ovwMjB7yGP i5SWiyRa2np2MXGbDSQ7u2V2LsICbC+4j18IypOmPucU9lUYEvtzdS+o6aLxSN+KYe Irgw3CLemG2S4CDLZUvsp//4DiP2NaFIJ35xdX3LfocpeBNp+3rNohxRlCRU2eZyFM 8knwCRsXM6HS9jEcTe25E6EXRdlZNeNIpnFwB4nTxex3/NkYtC0BEFI3It8PeGvmeh NRvWGAhgwbgaQ== Date: Mon, 4 Nov 2024 13:11:48 +0200 From: Mike Rapoport To: "Gowans, James" Cc: "jgg@ziepe.ca" , "quic_eberman@quicinc.com" , "kvm@vger.kernel.org" , "brauner@kernel.org" , "anthony.yznaga@oracle.com" , "steven.sistare@oracle.com" , "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "Durrant, Paul" , "Woodhouse, David" , "pbonzini@redhat.com" , "seanjc@google.com" , "linux-mm@kvack.org" , "Saenz Julienne, Nicolas" , "Graf (AWS), Alexander" , "viro@zeniv.linux.org.uk" , "jack@suse.cz" , "linux-fsdevel@vger.kernel.org" Subject: Re: [PATCH 05/10] guestmemfs: add file mmap callback Message-ID: References: <20240805093245.889357-1-jgowans@amazon.com> <20240805093245.889357-6-jgowans@amazon.com> <20241029120232032-0700.eberman@hu-eberman-lv.qualcomm.com> <33a2fd519edc917d933517842cc077a19e865e3f.camel@amazon.com> <20241031160635.GA35848@ziepe.ca> <20241101134202.GB35848@ziepe.ca> <9df04c57f9d5f351bb1b4eeef764bf9ccc6711b1.camel@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9df04c57f9d5f351bb1b4eeef764bf9ccc6711b1.camel@amazon.com> X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B825D80008 X-Stat-Signature: yxj4uj3uiy4obyfaksq3ykuhssukaf84 X-HE-Tag: 1730718809-697592 X-HE-Meta: U2FsdGVkX1+sjQmRxH3hcTY87JdxWgq1rTVKXZidBEpmkwrG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gG2cU0jtkmdRgEHRyMoLj7SHl0gGWz3MeCGRyVxnLn4eKBHPuK44ah0d0ZP3T8WT0+tok/ufQ5vh59l8GpRy4kxb6Y5vVyIJDJhhNyUWgEl/oGKwuP5iNcrNf68yC3MnP0EoH/hpOtYHAJHWT95ydKeGrWmzYHhgqMJMxRyBWISa1zFax995UlwbAPtI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Sat, Nov 02, 2024 at 08:24:15AM +0000, Gowans, James wrote: > On Fri, 2024-11-01 at 10:42 -0300, Jason Gunthorpe wrote: > > > > On Fri, Nov 01, 2024 at 01:01:00PM +0000, Gowans, James wrote: > > > > > Thanks Jason, that sounds perfect. I'll work on the next rev which will: > > > - expose a filesystem which owns reserved/persistent memory, just like > > > this patch. > > > > Is this step needed? > > > > If the guest memfd is already told to get 1G pages in some normal way, > > why do we need a dedicated pool just for the KHO filesystem? > > > > Back to my suggestion, can't KHO simply freeze the guest memfd and > > then extract the memory layout, and just use the normal allocator? > > > > Or do you have a hard requirement that only KHO allocated memory can > > be preserved across kexec? > > KHO can persist any memory ranges which are not MOVABLE. Provided that > guest_memfd does non-movable allocations then serialising and persisting > should be possible. > > There are other requirements here, specifically the ability to be > *guaranteed* GiB-level allocations, have the guest memory out of the > direct map for secret hiding, and remove the struct page overhead. > Struct page overhead could be handled via HVO. But considering that the > memory must be out of the direct map it seems unnecessary to have struct > pages, and unnecessary to have it managed by an existing allocator. Having memory out of direct map does not preclude manipulations of struct page unless that memory is completely out of the kernel control (e.g. excluded by mem=X) and this is not necessarily the case even for VM hosts. It's not not necessary to manage the memory using an existing allocator, but I think a specialized allocator should not be a part of guestmemfs.` > JG -- Sincerely yours, Mike.