On Wed, Jul 26, 2017 at 11:47:32AM -0500, Tom Lendacky wrote: > If it's made static then the sme_active()/sev_active() inline functions > would need to be turned into functions within the mem_encrypt.c file. So > there's a trade-off to do that, which is the better one? Simple: why do we have functions if the variables are exported? The reasoning for sme_me_mask is more or less obvious but for sev_enabled... IOW, either make the bool static and unlinine the function - this way you're free to change how you determine whether SEV is enabled later as callers will be using the function. Or, if it doesn't really matter because you can always change callers later, simply drop sev_active() the function and use a bool sev_active everywhere. > The kernel needs to distinguish between running under SME and running > under SEV. SME and SEV are similar but not the same. The trampoline code > is a good example. Before paging is activated, SME will access all > memory as decrypted, but SEV will access all memory as encrypted. So > when APs are being brought up under SME the trampoline area cannot be > encrypted, whereas under SEV the trampoline area must be encrypted. I guess you're sensing by now that we need this clarification in a comment above it... :-) -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html