Re: [PATCHv2 00/29] TDX Guest: TDX core support

From: Kai Huang
Date: Wed Feb 09 2022 - 07:04:22 EST


On Wed, 9 Feb 2022 12:40:17 +0100 Borislav Petkov wrote:
> On Thu, Feb 10, 2022 at 12:30:33AM +1300, Kai Huang wrote:
> > Because SEAM, P-SEAMLDR can logically be independent, so I feel it's better to
> > have separate C files for them.
>
> Most of those look like small files. I don't see the point of having it
> all in separate files - you can just as well put them in tdx.c and carve
> out only then when the file becomes too unwieldy to handle.

arch/x86/kernel/tdx.c is already taken by this series. This is the reason that
I think perhaps it's better to rename it to reflect it is for TDX guest support.

>
> > Thanks for the information. However, for now does it make sense to also put
> > TDX host files under arch/x86/kernel/, or maybe arch/x86/kernel/tdx_host/?
>
> Didn't you just read what I wrote about "kernel"?
>
> > As suggested by Thomas, host SEAMCALL can share TDX guest's __tdx_module_call()
> > implementation. Kirill will have a arch/x86/kernel/tdxcall.S which implements
> > the core body of __tdx_module_call() and is supposed to be included by the new
> > assembly file to implement the host SEAMCALL function. From this perspective,
> > it seems more reasonable to just put all TDX host files under arch/x86/kernel/?
>
> It would be a lot harder to move them to a different location later,
> when they're upstream already. I'm talking from past experience here.

Are you suggesting even for now we can start to put TDX host support to
arch/x86/coco/tdx/ ?

>
> But let's see what the others think first.

Sure thanks for comments.

>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette