Re: [PATCH RFC v9 05/51] x86/coco: move CONFIG_HAS_CC_PLATFORM check down into coco/Makefile

Michael Roth
2023-06-20T20:43:41Z

On Tue, Jun 20, 2023 at 02:09:20PM +0200, Borislav Petkov wrote:
> On Sun, Jun 11, 2023 at 11:25:13PM -0500, Michael Roth wrote:
> > Currently CONFIG_HAS_CC_PLATFORM is a prereq for building anything in
> ^^^^^^
>
> Use proper english words pls.
>
> > arch/x86/coco, but that is generally only applicable for guest support.
> >
> > For SEV-SNP, helpers related purely to host support will also live in
> > arch/x86/coco. To allow for CoCo-related host support code in
> > arch/x86/coco, move that check down into the Makefile and check for it
> > specifically when needed.
>
> I have no clue what that means. Example?

Basically, arch/x86/coco/Makefile is never processed if arch/x86/Kbuild
indicates that CONFIG_HAS_CC_PLATFORM is not set. So if we want to have
stuff in arch/x86/coco/Makefile that build for !CONFIG_HAS_CC_PLATFORM,
like SNP host support, which does not rely on CONFIG_HAS_CC_PLATFORM
being set, that check needs to be moved down into arch/x86/coco/Makefile.

>
> The last time we talked about paths, we ended up agreeing on:
>
> https://lore.kernel.org/all/Yg5nh1RknPRwIrb8@zn.tnic/
>
> So your "helpers related purely to host support" should go to
>
> arch/x86/virt/svm/sev*.c
>
> And just to keep it simple, that should be
>
> arch/x86/virt/svm/sev.c
>
> and if there's real need to split that, we can do that later.

Ok, makes sense.

Thanks,

Mike

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