Re: [PATCH v4 04/15] x86/sev: Check for the presence of an SVSM in the SNP Secrets page

From: Borislav Petkov
Date: Wed May 22 2024 - 13:24:39 EST


On Wed, May 22, 2024 at 11:15:28AM -0500, Tom Lendacky wrote:
> Or what I originally proposed:
>
> if (!IS_ALIGNED(caa, PAGE_SIZE))
>
> Which also works without including mm.h.

It works because of the same nasty reason:

$ make arch/x86/boot/compressed/sev.i
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CPP arch/x86/boot/compressed/sev.i
$ grep align.h arch/x86/boot/compressed/sev.i
# 1 "./include/linux/align.h" 1

The include hell pulls in that linux/ namespace header into the
decompressor. Which it should not to.

So no, please use the open-coded thing. I probably should start
untangling the decompressor slowly and do small sets because otherwise
this'll never get split properly.

;-\

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette