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

From: Kai Huang
Date: Wed Feb 09 2022 - 21:10:28 EST



> > No objection to omitting "coco". Though what about using "vmx" and "svm" instead
> > of "tdx" and "sev".
>
> I'm not dead-set on this but ...
>
> > We lose the more explicit tie to coco, but it would mirror the
> > sub-directories in arch/x86/kvm/
>
> ... having them too close in naming to the non-coco stuff, might cause
> confusion when looking at:
>
> arch/x86/kvm/vmx/vmx.c
>
> vs
>
> arch/x86/virt/vmx/vmx.c
>
> Instead of having
>
> arch/x86/kvm/vmx/vmx.c
>
> and
>
> arch/x86/virt/tdx/vmx.c
>
> That second version differs just the right amount. :-)

Having vmx.c under tdx/ directory looks a little bit strange.

vmx.c seems more like "generic non-KVM host virtualization staff".

>
> > and would avoid a mess in the scenario where tdx
> > or sev needs to share code with the non-coco side, e.g. I'm guessing TDX will need
> > to do VMXON.
> >
> > arch/x86/virt/vmx/
> > tdx.c
> > vmx.c
> >
> > arch/x86/virt/svm/
> > sev.c
> > sev-es.c
> > sev-snp.c
> > svm.c
>
> That will probably be two files too: sev.c and svm.c
>
> But let's see what the other folks think first...
>

So if I catch you guys correctly, so far I am heading towards to:

arch/x86/virt/vmx/
tdx.c

("vmx/" can be changed if you guys prefers others later).

And I am targeting to use single tdx.c to hold ~2k LoC since looks like single
file is preferred.