Re: [RFC v2 26/32] x86/mm: Move force_dma_unencrypted() to common code

From: Kuppuswamy, Sathyanarayanan
Date: Thu May 27 2021 - 00:52:16 EST




On 5/17/21 6:28 PM, Kuppuswamy, Sathyanarayanan wrote:
Because the code is already separate.  You're actually going to some
trouble to move the SEV-specific code and then combine it with the
TDX-specific code.

Anyway, please just give it a shot.  Should take all of ten minutes.  If
it doesn't work out in practice, fine.  You'll have a good paragraph for
the changelog.

After reviewing the code again, I have noticed that we don't really have
much common code between AMD and TDX. So I don't see any justification for
creating this common layer. So, I have decided to drop this patch and move
Intel TDX specific memory encryption init code to patch titled "[RFC v2 30/32]
x86/tdx: Make DMA pages shared". This model is similar to how AMD-SEV
does the initialization.

I have sent the modified patch as reply to patch titled "[RFC v2 30/32]
x86/tdx: Make DMA pages shared". Please check and let me know your comment

My method of using separate initialization file for Intel only code will not
work if we want to support both AMD SEV and TDX guest support in same binary.
So please ignore my previous reply. I will address the issue as per your
original comments and send you an updated patch.

--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer