Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386860 > unrolled thread

[PATCH 03/40] x86/mm/pat: Document the (currently) EFI-only code path

Started byMatt Fleming <matt@codeblueprint.co.uk>
First post2016-04-25 22:20 +0200
Last post2016-04-28 12:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 03/40] x86/mm/pat: Document the (currently) EFI-only code path Matt Fleming <matt@codeblueprint.co.uk> - 2016-04-25 22:20 +0200
    [tip:efi/core] x86/mm/pat: Document the (currently) EFI-only code  path tip-bot for Matt Fleming <tipbot@zytor.com> - 2016-04-28 12:40 +0200

#1386860 — [PATCH 03/40] x86/mm/pat: Document the (currently) EFI-only code path

FromMatt Fleming <matt@codeblueprint.co.uk>
Date2016-04-25 22:20 +0200
Subject[PATCH 03/40] x86/mm/pat: Document the (currently) EFI-only code path
Message-ID<rrV9a-3ni-71@gated-at.bofh.it>
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 <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
---
 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 01be9ec3bf79..a1f0e1d0ddc2 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.
-- 
2.7.3

[toc] | [next] | [standalone]


#1389999 — [tip:efi/core] x86/mm/pat: Document the (currently) EFI-only code path

Fromtip-bot for Matt Fleming <tipbot@zytor.com>
Date2016-04-28 12:40 +0200
Subject[tip:efi/core] x86/mm/pat: Document the (currently) EFI-only code path
Message-ID<rsRwu-1zl-35@gated-at.bofh.it>
In reply to#1386860
Commit-ID:  7fc8442f2a8a77f40565b42c41e4f2d48b179a56
Gitweb:     http://git.kernel.org/tip/7fc8442f2a8a77f40565b42c41e4f2d48b179a56
Author:     Matt Fleming <matt@codeblueprint.co.uk>
AuthorDate: Mon, 25 Apr 2016 21:06:35 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
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 <luto@amacapital.net>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
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 <mingo@kernel.org>
---
 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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web