linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Disable branch profiling in mem_encrypt.c
@ 2017-09-29 16:24 Tom Lendacky
  2017-09-29 16:51 ` Borislav Petkov
  2017-09-29 20:15 ` [tip:x86/urgent] " tip-bot for Tom Lendacky
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Lendacky @ 2017-09-29 16:24 UTC (permalink / raw)
  To: x86
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, linux-kernel,
	H. Peter Anvin

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.

Reported-by: kernel test robot <lkp@01.org>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
 arch/x86/mm/mem_encrypt.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index 3fcc8e0..16c5f37 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -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>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/mm: Disable branch profiling in mem_encrypt.c
  2017-09-29 16:24 [PATCH] x86/mm: Disable branch profiling in mem_encrypt.c Tom Lendacky
@ 2017-09-29 16:51 ` Borislav Petkov
  2017-09-29 20:15 ` [tip:x86/urgent] " tip-bot for Tom Lendacky
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2017-09-29 16:51 UTC (permalink / raw)
  To: Tom Lendacky
  Cc: x86, Thomas Gleixner, Ingo Molnar, linux-kernel, H. Peter Anvin

On Fri, Sep 29, 2017 at 11:24:19AM -0500, Tom Lendacky wrote:
> 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.
> 
> Reported-by: kernel test robot <lkp@01.org>
> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
>  arch/x86/mm/mem_encrypt.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
> index 3fcc8e0..16c5f37 100644
> --- a/arch/x86/mm/mem_encrypt.c
> +++ b/arch/x86/mm/mem_encrypt.c
> @@ -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>

Acked-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86/mm: Disable branch profiling in mem_encrypt.c
  2017-09-29 16:24 [PATCH] x86/mm: Disable branch profiling in mem_encrypt.c Tom Lendacky
  2017-09-29 16:51 ` Borislav Petkov
@ 2017-09-29 20:15 ` tip-bot for Tom Lendacky
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Tom Lendacky @ 2017-09-29 20:15 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: lkp, mingo, peterz, linux-kernel, tglx, torvalds, hpa, bp,
	thomas.lendacky, bp

Commit-ID:  bc829ee36e0ec92383c9d9b88fe08f00d4d592f8
Gitweb:     https://git.kernel.org/tip/bc829ee36e0ec92383c9d9b88fe08f00d4d592f8
Author:     Tom Lendacky <thomas.lendacky@amd.com>
AuthorDate: Fri, 29 Sep 2017 11:24:19 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
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.

Reported-by: kernel test robot <lkp@01.org>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170929162419.6016.53390.stgit@tlendack-t1.amdoffice.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/mm/mem_encrypt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index 3fcc8e0..16c5f37 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -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>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-29 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-29 16:24 [PATCH] x86/mm: Disable branch profiling in mem_encrypt.c Tom Lendacky
2017-09-29 16:51 ` Borislav Petkov
2017-09-29 20:15 ` [tip:x86/urgent] " tip-bot for Tom Lendacky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).