Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption
From: Dave Hansen
Date: Thu Jun 13 2019 - 14:11:17 EST
On 6/13/19 10:59 AM, Lendacky, Thomas wrote:
>> After I say all that... Why can't you just stick your data in a normal,
>> vanilla __init variable? Wouldn't that be a lot less subtle?
> The area needs to be outside of the kernel proper as the kernel is
> encrypted "in place." So an __init variable won't work here.
Ahh, that makes sense. Also sounds like good changelog fodder.
FWIW, you *could* use an __init area, but I think you'd have to work
around it in sme_encrypt_kernel(), right? Basically in the
kernel_start/end logic you'd need to skip over it. That's probably more
fragile than what you have here, though.