mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] x86/mm: Free sme_early_buffer after init
@ 2019-07-10 20:19 David Rientjes
  2019-07-16 21:19 ` [tip:x86/urgent] " tip-bot for David Rientjes
  0 siblings, 1 reply; 2+ messages in thread
From: David Rientjes @ 2019-07-10 20:19 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, Borislav Petkov
  Cc: Cfir Cohen, Thomas Lendacky, Dave Hansen, Andy Lutomirski,
	linux-kernel, x86

We want to be able to clear the contents of sme_early_buffer after
__sme_early_enc_dec() because it is used to move encrypted and decrypted
data, but since __sme_early_enc_dec() is __init we can simply free this
buffer after init.

This saves a page that is otherwise unreferenced after init.

Reported-by: Cfir Cohen <cfir@google.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 arch/x86/mm/mem_encrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -41,7 +41,7 @@ EXPORT_SYMBOL_GPL(sev_enable_key);
 bool sev_enabled __section(.data);
 
 /* Buffer used for early in-place encryption by BSP, no locking needed */
-static char sme_early_buffer[PAGE_SIZE] __aligned(PAGE_SIZE);
+static char sme_early_buffer[PAGE_SIZE] __initdata __aligned(PAGE_SIZE);
 
 /*
  * This routine does not change the underlying encryption setting of the

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-16 21:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 20:19 [patch] x86/mm: Free sme_early_buffer after init David Rientjes
2019-07-16 21:19 ` [tip:x86/urgent] " tip-bot for David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome