Skip to contentSkip to conversation

x86/mm: Disable branch profiling in mem_encrypt.c

PATCH In review Tom Lendacky 3 participants 3 messages Sep 29, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: Disable branch profiling in mem_encrypt.c

Some routines in mem_encrypt.c are called very early in the boot process, e.g. sme_encrypt_kernel(). When CONFIG_TRACE_BRANCH_PROFILING is defined the resulting branch profiling associated with the check to see if SME is active results in a kernel crash. Disable branch profiling for mem_encrypt.c by defining DISABLE_BRANCH_PROFILING before including any header files.

---
 arch/x86/mm/mem_encrypt.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/mm/mem_encrypt.c +2 -0
index 3fcc8e0..16c5f37 100644
@@ -10,6 +10,8 @@
  * published by the Free Software Foundation.
  */
 
+#define DISABLE_BRANCH_PROFILING
+
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/mm.h>
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Tom Lendacky

Some routines in mem_encrypt.c are called very early in the boot process, e.g. sme_encrypt_kernel(). When CONFIG_TRACE_BRANCH_PROFILING is defined the resulting branch profiling associated with the check to see if SME is active results in a kernel crash. Disable branch profiling for mem_encrypt.c by defining DISABLE_BRANCH_PROFILING before including any header files.

---
 arch/x86/mm/mem_encrypt.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/mm/mem_encrypt.c +0 -0
index 3fcc8e0..16c5f37 100644

arch/x86/mm/mem_encrypt.c line 17

Quoted 8 lines
arch/x86/mm/mem_encrypt.c +2 -0
@@ -10,6 +10,8 @@
  * published by the Free Software Foundation.
  */
 
+#define DISABLE_BRANCH_PROFILING
+
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/mm.h>
Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#2 lore raw
In reply to Tom Lendacky
x86/mm: Disable branch profiling in mem_encrypt.c
Commit-ID:  bc829ee36e0ec92383c9d9b88fe08f00d4d592f8
Gitweb:     https://git.kernel.org/tip/bc829ee36e0ec92383c9d9b88fe08f00d4d592f8
Author:     Tom Lendacky <[email protected]>
AuthorDate: Fri, 29 Sep 2017 11:24:19 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 29 Sep 2017 19:37:51 +0200

x86/mm: Disable branch profiling in mem_encrypt.c

Some routines in mem_encrypt.c are called very early in the boot process, e.g. sme_encrypt_kernel(). When CONFIG_TRACE_BRANCH_PROFILING=y is defined the resulting branch profiling associated with the check to see if SME is active results in a kernel crash. Disable branch profiling for mem_encrypt.c by defining DISABLE_BRANCH_PROFILING before including any header files.

---
 arch/x86/mm/mem_encrypt.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/mm/mem_encrypt.c +2 -0
index 3fcc8e0..16c5f37 100644
@@ -10,6 +10,8 @@
  * published by the Free Software Foundation.
  */
 
+#define DISABLE_BRANCH_PROFILING
+
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/mm.h>