From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16F6B173 for ; Wed, 21 Jul 2021 00:38:56 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10051"; a="296911183" X-IronPort-AV: E=Sophos;i="5.84,256,1620716400"; d="scan'208";a="296911183" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2021 17:38:56 -0700 X-IronPort-AV: E=Sophos;i="5.84,256,1620716400"; d="scan'208";a="415424790" Received: from tassilo.jf.intel.com ([10.54.74.11]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2021 17:38:55 -0700 Date: Tue, 20 Jul 2021 17:38:54 -0700 From: Andi Kleen To: Erdem Aktas Cc: Andy Lutomirski , Joerg Roedel , David Rientjes , Borislav Petkov , Sean Christopherson , Andrew Morton , Vlastimil Babka , "Kirill A. Shutemov" , Brijesh Singh , Tom Lendacky , Jon Grimm , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , "Kaplan, David" , Varad Gautam , Dario Faggioli , x86 , linux-mm@kvack.org, linux-coco@lists.linux.dev Subject: Re: Runtime Memory Validation in Intel-TDX and AMD-SNP Message-ID: <20210721003854.GD535804@tassilo.jf.intel.com> References: Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: > > > >> Also in general i don't think it will really happen, at least > > > initially. > > > >> All the shared buffers we use are allocated and never freed. So such a > > > >> problem could be deferred. > > > > > > Does it not depend on kernel configs? Currently, there is a valid > > > control path in dma_alloc_coherent which might alloc and free shared > > > pages. > > > > If the device filter is active it won't. > > > > If I am not missing something, I do not see that the device filter > checks for CONFIG_DMA_COHERENT_POOL and if it is not enabled, > dma_alloc_coherent will allocate a regular memory, convert it to > shared and convert it back to private when it is freed. What I meant is that the only devices that will be supported (mainly virtio) initially don't ever free coherent memory And the device filter enforces that. Now we probably want to support freeing anyways just to be able to run without device filter, but it definitely doesn't have to be fast or efficient. If there's a problem with it it would be a quite reasonable implementation to keep it in a pool. -Andi