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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A387E7719E for ; Mon, 13 Jan 2025 10:25:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXHce-000193-1c; Mon, 13 Jan 2025 05:24:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXHca-00018s-L8 for qemu-devel@nongnu.org; Mon, 13 Jan 2025 05:24:38 -0500 Received: from mgamail.intel.com ([192.198.163.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXHcY-0003Ar-7t for qemu-devel@nongnu.org; Mon, 13 Jan 2025 05:24:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736763874; x=1768299874; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=F4qf+2lORgz1p+95k0zKTTdI+gT5PnvTukho1wgb1nM=; b=Y7ro5RRtRIJDkgvR4PWl3Rf6yXOPCCPFOed0TRZHOme7b//TLaQh4p4g itCcr2BTFGQjwjfOPeLxDLoaFkMUOILZ0booQwbkqisEJhtD/jxhQ3LYE HhyxTU4/Lpd1ZXr440Vzo562WBboGJSbOZ0iNZ67f1wtzfEsVbpKe9LtZ EuzsdhQU2f9qcl6KsB8VErTSJGWmRrOob8gHqi/LYdWdQVlLLuszfZblg 6ucOn1bd94hcIjiONtUTxBsxTK5SDXsJGK4DzOEPSFdBCRuMngzZw9kpP uqm/1AWaKHEFuDNDpUGr1Jhim3zxt9bHqm7nvfSHXYuruOxQY6yh4TOiX Q==; X-CSE-ConnectionGUID: qDnr2pdwRRG7FdKcolGVDg== X-CSE-MsgGUID: RMcH4Nv6RuGgF7n0KHzE2w== X-IronPort-AV: E=McAfee;i="6700,10204,11313"; a="37246119" X-IronPort-AV: E=Sophos;i="6.12,310,1728975600"; d="scan'208";a="37246119" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2025 02:24:28 -0800 X-CSE-ConnectionGUID: Rf+dTPLGTnCIgxLFGBw4Yg== X-CSE-MsgGUID: EcR+H/ruS/OfAorpyr/i6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="104946053" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orviesa007.jf.intel.com with ESMTP; 13 Jan 2025 02:24:25 -0800 Date: Mon, 13 Jan 2025 06:23:18 +0800 From: Xu Yilun To: Chenyi Qiang Cc: Alexey Kardashevskiy , David Hildenbrand , Paolo Bonzini , Peter Xu , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Michael Roth , qemu-devel@nongnu.org, kvm@vger.kernel.org, Williams Dan J , Peng Chao P , Gao Chao , Xu Yilun Subject: Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager Message-ID: References: <80ac1338-a116-48f5-9874-72d42b5b65b4@intel.com> <219a4a7a-7c96-4746-9aba-ed06a1a00f3e@amd.com> <58b96b74-bf9c-45d3-8c2e-459ec2206fc8@intel.com> <8c8e024d-03dc-4201-8038-9e9e60467fad@amd.com> <4d22d3ce-a5a1-49f2-a578-8e0fe7d26893@amd.com> <2b799426-deaa-4644-aa17-6ef31899113b@intel.com> <565fb987-a16d-4e15-ab03-807bf3920aa1@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <565fb987-a16d-4e15-ab03-807bf3920aa1@intel.com> Received-SPF: none client-ip=192.198.163.14; envelope-from=yilun.xu@linux.intel.com; helo=mgamail.intel.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, DKIMWL_WL_HIGH=-0.025, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Mon, Jan 13, 2025 at 11:34:44AM +0800, Chenyi Qiang wrote: > > > On 1/10/2025 5:50 AM, Xu Yilun wrote: > > On Fri, Jan 10, 2025 at 05:00:22AM +0800, Xu Yilun wrote: > >>>> > >>>> https://github.com/aik/qemu/commit/3663f889883d4aebbeb0e4422f7be5e357e2ee46 > >>>> > >>>> but I am not sure if this ever saw the light of the day, did not it? > >>>> (ironically I am using it as a base for encrypted DMA :) ) > >>> > >>> Yeah, we are doing the same work. I saw a solution from Michael long > >>> time ago (when there was still > >>> a dedicated hostmem-memfd-private backend for restrictedmem/gmem) > >>> (https://github.com/AMDESE/qemu/commit/3bf5255fc48d648724d66410485081ace41d8ee6) > >>> > >>> For your patch, it only implement the interface for > >>> HostMemoryBackendMemfd. Maybe it is more appropriate to implement it for > >>> the parent object HostMemoryBackend, because besides the > >>> MEMORY_BACKEND_MEMFD, other backend types like MEMORY_BACKEND_RAM and > >>> MEMORY_BACKEND_FILE can also be guest_memfd-backed. > >>> > >>> Think more about where to implement this interface. It is still > >>> uncertain to me. As I mentioned in another mail, maybe ram device memory > >>> region would be backed by guest_memfd if we support TEE IO iommufd MMIO > >> > >> It is unlikely an assigned MMIO region would be backed by guest_memfd or be > >> implemented as part of HostMemoryBackend. Nowadays assigned MMIO resource is > >> owned by VFIO types, and I assume it is still true for private MMIO. > >> > >> But I think with TIO, MMIO regions also need conversion. So I support an > >> object, but maybe not guest_memfd_manager. > > > > Sorry, I mean the name only covers private memory, but not private MMIO. > > So you suggest renaming the object to cover the private MMIO. Then how Yes. > about page_conversion_manager, or page_attribute_manager? Maybe memory_attribute_manager? Strictly speaking MMIO resource is not backed by pages. Thanks, Yilun > > > > >> > >> Thanks, > >> Yilun > >> > >>> in future. Then a specific object is more appropriate. What's your opinion? > >>> > >> >