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

From: Dave Hansen
Date: Wed May 12 2021 - 12:37:03 EST


On 5/12/21 6:08 AM, Kirill A. Shutemov wrote:
>> That's not an excuse to have a bunch of AMD (or Intel) feature-specific
>> code in a file named "common". I'd make an attempt to keep them
>> separate and then call into the two separate functions *from* the common
>> function.
> But why? What good does the additional level of inderection brings?
>
> It's like saying arch/x86/kernel/cpu/common.c shouldn't have anything AMD
> or Intel specific. If a function can cover both vendors I don't see a
> point for additinal complexity.

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.