Re: [PATCH] x86/startup: Let the caller retrieve encryption mask

From: Borislav Petkov
Date: Mon Jun 16 2025 - 11:33:55 EST


On Mon, Jun 16, 2025 at 12:34:13PM +0000, Khalid Ali wrote:
> From: Khalid Ali <khaliidcaliy@xxxxxxxxx>
>
> Don't return encryption mask . This makes __startup_64() to handle
> doing the actual work including encrypting the kernel. The caller has
> already access to encryption mask and can directly retrieve it. On C
> code, the caller can call sme_get_me_mask() and include /arch/x86/include/asm/mem_encrypt.h
> directly while on assembly functions like startup_64 the "sme_me_mask"
> is directly accessible to them if CONFIG_AMD_MEM_ENCRYPT is set. This
> also makes consistent with the way secondary_startup_64_no_verify label
> is handled. On intel CPUs this is not even neccessary, so we should
> retrieve the mask only if CONFIG_AMD_MEM_ENCRYPT is set.

What Thomas told you about structuring commit messages:

https://lore.kernel.org/r/875xgziprs.ffs@tglx

Do it please and then send patches.

Thx.

--
Regards/Gruss,
Boris.

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