From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sathyanarayanan Kuppuswamy Subject: Re: [PATCH v5 06/16] x86/tdx: Make DMA pages shared Date: Wed, 20 Oct 2021 10:26:29 -0700 Message-ID: <930ec8e0-669d-8501-af66-38e4cab60a1f@linux.intel.com> References: <20211009003711.1390019-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211009003711.1390019-7-sathyanarayanan.kuppuswamy@linux.intel.com> <654455db-a605-5069-d652-fe822ae066b0@amd.com> <66acafb6-7659-7d76-0f52-d002cfae9cc8@linux.intel.com> <0b06e686-b0d8-9485-ae00-b23f805916d9@amd.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <0b06e686-b0d8-9485-ae00-b23f805916d9@amd.com> Content-Language: en-US List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Tom Lendacky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Bjorn Helgaas , Richard Henderson , Thomas Bogendoerfer , James E J Bottomley , Helge Deller , "David S . Miller" , Arnd Bergmann , Jonathan Corbet , "Michael S . Tsirkin" , Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Josh Poimboeuf Cc: Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org On 10/20/21 10:22 AM, Tom Lendacky wrote: >> >> For non TDX case, in CC_ATTR_HOST_MEM_ENCRYPT, we should still call >> amd_force_dma_unencrypted() right? > > What I'm saying is that you wouldn't have amd_force_dma_unencrypted(). I > think the whole force_dma_unencrypted() can exist as-is in a different > file, whether that's cc_platform.c or mem_encrypt_common.c. > > It will return true for an SEV or TDX guest, true for an SME host based > on the DMA mask or else false. That should work just fine for TDX. Got it. Thanks for clarifying it. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer