From: tip-bot for David Rientjes <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, cfir@google.com,
linux-kernel@vger.kernel.org, mingo@kernel.org,
rientjes@google.com, hpa@zytor.com
Subject: [tip:x86/urgent] x86/mm: Free sme_early_buffer after init
Date: Tue, 16 Jul 2019 14:19:54 -0700 [thread overview]
Message-ID: <tip-ffdb07f31252625b7bcbf1f424d7beccff02ba97@git.kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.21.1907101318170.197432@chino.kir.corp.google.com>
Commit-ID: ffdb07f31252625b7bcbf1f424d7beccff02ba97
Gitweb: https://git.kernel.org/tip/ffdb07f31252625b7bcbf1f424d7beccff02ba97
Author: David Rientjes <rientjes@google.com>
AuthorDate: Wed, 10 Jul 2019 13:19:35 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 16 Jul 2019 23:13:48 +0200
x86/mm: Free sme_early_buffer after init
The contents of sme_early_buffer should be cleared after
__sme_early_enc_dec() because it is used to move encrypted and decrypted
data, but since __sme_early_enc_dec() is __init this buffer simply can be
freed 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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1907101318170.197432@chino.kir.corp.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
index e0df96fdfe46..e94e0a62ba92 100644
--- 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
prev parent reply other threads:[~2019-07-16 21:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 20:19 [patch] x86/mm: Free sme_early_buffer after init David Rientjes
2019-07-16 21:19 ` tip-bot for David Rientjes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-ffdb07f31252625b7bcbf1f424d7beccff02ba97@git.kernel.org \
--to=tipbot@zytor.com \
--cc=cfir@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.