Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752702AbcD1KcI (ORCPT ); Thu, 28 Apr 2016 06:32:08 -0400 Received: from terminus.zytor.com ([198.137.202.10]:47288 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbcD1KcF (ORCPT ); Thu, 28 Apr 2016 06:32:05 -0400 Date: Thu, 28 Apr 2016 03:31:09 -0700 From: tip-bot for Matt Fleming Message-ID: Cc: torvalds@linux-foundation.org, bp@alien8.de, tglx@linutronix.de, linux-kernel@vger.kernel.org, ard.biesheuvel@linaro.org, mingo@kernel.org, sai.praneeth.prakhya@intel.com, matt@codeblueprint.co.uk, luto@amacapital.net, peterz@infradead.org, hpa@zytor.com Reply-To: torvalds@linux-foundation.org, bp@alien8.de, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, luto@amacapital.net, mingo@kernel.org, sai.praneeth.prakhya@intel.com, matt@codeblueprint.co.uk In-Reply-To: <1461614832-17633-4-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-4-git-send-email-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] x86/mm/pat: Document the (currently) EFI-only code path Git-Commit-ID: 7fc8442f2a8a77f40565b42c41e4f2d48b179a56 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1825 Lines: 48 Commit-ID: 7fc8442f2a8a77f40565b42c41e4f2d48b179a56 Gitweb: http://git.kernel.org/tip/7fc8442f2a8a77f40565b42c41e4f2d48b179a56 Author: Matt Fleming AuthorDate: Mon, 25 Apr 2016 21:06:35 +0100 Committer: Ingo Molnar CommitDate: Thu, 28 Apr 2016 11:33:48 +0200 x86/mm/pat: Document the (currently) EFI-only code path It's not at all obvious that populate_pgd() and friends are only executed when mapping EFI virtual memory regions or that no other pageattr callers pass a ->pgd value. Reported-by: Andy Lutomirski Signed-off-by: Matt Fleming Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sai Praneeth Prakhya Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-4-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar --- arch/x86/mm/pageattr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 01be9ec..a1f0e1d 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -1125,8 +1125,14 @@ static int populate_pgd(struct cpa_data *cpa, unsigned long addr) static int __cpa_process_fault(struct cpa_data *cpa, unsigned long vaddr, int primary) { - if (cpa->pgd) + if (cpa->pgd) { + /* + * Right now, we only execute this code path when mapping + * the EFI virtual memory map regions, no other users + * provide a ->pgd value. This may change in the future. + */ return populate_pgd(cpa, vaddr); + } /* * Ignore all non primary paths.