Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1393962ybi; Tue, 16 Jul 2019 14:22:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2ukwvTeEiluYEc9r7J3QMFGSmKOGtz9n04C4LIiPjMn861ggVDGNjNAhOnQmlkYJiPyA4 X-Received: by 2002:a65:6691:: with SMTP id b17mr21321249pgw.217.1563312123123; Tue, 16 Jul 2019 14:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563312123; cv=none; d=google.com; s=arc-20160816; b=GuPHDXM3yxHY71nZREMnrDO2CaDlUkPz2KHNf2scZj1wR26wnZ6ipeZCZoFwCI1Ooh HtTGT5+FF8fZl7oEs+lSbiwiT7fS9e01RJR5UuCNR54OcRP8557rDAHgByL8sEQtT2y/ ReTGC3Tf+FOmls7UiJ1aW96Uj/D0lq3W6b23FLZ8KHTsHyv0OGT72R/29rzFqVzPfD6G bRyeKST+J8+7AGNctdGHbGw5BrDwXctTqWCv4d39/Z7KDSeCrooeqXsAFItXsBEBfJEp JYrspu72sVXsfA1iMk+zVz/cGisrpc289t2gHCQKtJcpzdgqj37/Yad9fg4tHX+Bh9Nc DDmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=kZwr/64WSZaONd6w9ae4EPZGcolw3omtqDm6IpXkvrI=; b=ACKHiy6MMcxd9gFZJ6dFNkOzzzpIsfvpGep4F+QblBaoIDvF/A/X/EPDcd0WKgNTiV q3MQ7WYQbIjgAEc7t2aTFd+c+Z/qUhLxAr3xx9tEIT1B7Z2ixSXNc6W3LgpziOD5PKQu TGWJWJNJlhSMqOKkLwyGmwpffbHhjOlJoEzbmQII76d9hVRLo91e+BCC+riCo7vALUNO d7uBBvSBo6bEv/EJjVwK/yk+jFL46ZedyBrJeIJXR8kvQvoan4NCHtlxoHidzdEKHpXC OvkKEvhea+8T9tQ6gj9+EPD51wykwRK2yU+yf9Yf9NM7VCktxPfR3P9l3rFq/pNE3Y4O s6lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=wqGusLJf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn5si21058473plb.170.2019.07.16.14.21.46; Tue, 16 Jul 2019 14:22:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019061801 header.b=wqGusLJf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387675AbfGPVUE (ORCPT + 99 others); Tue, 16 Jul 2019 17:20:04 -0400 Received: from terminus.zytor.com ([198.137.202.136]:48781 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728118AbfGPVUE (ORCPT ); Tue, 16 Jul 2019 17:20:04 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6GLJtha1229621 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 16 Jul 2019 14:19:55 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6GLJtha1229621 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019061801; t=1563311995; bh=kZwr/64WSZaONd6w9ae4EPZGcolw3omtqDm6IpXkvrI=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=wqGusLJf0Bv4p26jT02rh/g0FRU6dGBkVFMPIP0uopdaGekHfikqOoWwErMaIkciS cYbTRd9geUSoTmymFT68Fok54n8RCtYlJ9bMm5uY9W0m2Yi7MJpVr3IqR3+w9LEz8s OsVW95zq5u59tV0y2iPIYQ1bB4cc65T54KoC3S1ln3FEQ+zdf1I4NZ5q8b5vygUcjf xJPpqKVOQazAFYJNc7LIculjfAYaiV3Jj/Rjsj8cbqjSDVDhikeAlAxJelJsalIlSb r+GriudhM1LHpjcA9erOvZjq9ABB6Ot1GMOAy443J4yvvfuQAJUgM3ktGclevmcQLR hSAgRvW9NT1Ow== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6GLJsJ41229618; Tue, 16 Jul 2019 14:19:54 -0700 Date: Tue, 16 Jul 2019 14:19:54 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for David Rientjes Message-ID: Cc: tglx@linutronix.de, cfir@google.com, linux-kernel@vger.kernel.org, mingo@kernel.org, rientjes@google.com, hpa@zytor.com Reply-To: hpa@zytor.com, mingo@kernel.org, cfir@google.com, linux-kernel@vger.kernel.org, rientjes@google.com, tglx@linutronix.de In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/mm: Free sme_early_buffer after init Git-Commit-ID: ffdb07f31252625b7bcbf1f424d7beccff02ba97 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_24_48,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ffdb07f31252625b7bcbf1f424d7beccff02ba97 Gitweb: https://git.kernel.org/tip/ffdb07f31252625b7bcbf1f424d7beccff02ba97 Author: David Rientjes AuthorDate: Wed, 10 Jul 2019 13:19:35 -0700 Committer: Thomas Gleixner 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 Signed-off-by: David Rientjes Signed-off-by: Thomas Gleixner 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