mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/sev: Disable ftrace branch profiling in SEV startup code
@ 2025-01-07 15:18 Ard Biesheuvel
  2025-01-15  9:17 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Ard Biesheuvel @ 2025-01-07 15:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, Ard Biesheuvel, Tom Lendacky, kernel test robot

From: Ard Biesheuvel <ardb@kernel.org>

Ftrace branch profiling inserts absolute references to its metadata at
call sites, and this implies that this kind of instrumentation cannot be
used while executing from the 1:1 mapping of memory.

Therefore, disable ftrace branch profiling in the SEV startup routines,
by disabling it for the entire SEV core source file.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501072244.zZrx9864-lkp@intel.com/
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/x86/coco/sev/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index 86898547056e..b5c6c4afd1cc 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -9,6 +9,8 @@
 
 #define pr_fmt(fmt)	"SEV: " fmt
 
+#define DISABLE_BRANCH_PROFILING
+
 #include <linux/sched/debug.h>	/* For show_regs() */
 #include <linux/percpu-defs.h>
 #include <linux/cc_platform.h>
-- 
2.47.1.613.gc27f4b7a9f-goog


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

* [tip: x86/boot] x86/sev: Disable ftrace branch profiling in SEV startup code
  2025-01-07 15:18 [PATCH] x86/sev: Disable ftrace branch profiling in SEV startup code Ard Biesheuvel
@ 2025-01-15  9:17 ` tip-bot2 for Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Ard Biesheuvel @ 2025-01-15  9:17 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: kernel test robot, Ard Biesheuvel, Borislav Petkov (AMD),
	Tom Lendacky, x86, linux-kernel

The following commit has been merged into the x86/boot branch of tip:

Commit-ID:     cf4ca80650908628bf1c0c29e3fd236b1915d789
Gitweb:        https://git.kernel.org/tip/cf4ca80650908628bf1c0c29e3fd236b1915d789
Author:        Ard Biesheuvel <ardb@kernel.org>
AuthorDate:    Tue, 07 Jan 2025 16:18:27 +01:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 14 Jan 2025 19:10:32 +01:00

x86/sev: Disable ftrace branch profiling in SEV startup code

Ftrace branch profiling inserts absolute references to its metadata at
call sites, and this implies that this kind of instrumentation cannot be
used while executing from the 1:1 mapping of memory.

Therefore, disable ftrace branch profiling in the SEV startup routines,
by disabling it for the entire SEV core source file.

Closes: https://lore.kernel.org/oe-kbuild-all/202501072244.zZrx9864-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20250107151826.820147-2-ardb+git@google.com
---
 arch/x86/coco/sev/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index 8689854..b5c6c4a 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -9,6 +9,8 @@
 
 #define pr_fmt(fmt)	"SEV: " fmt
 
+#define DISABLE_BRANCH_PROFILING
+
 #include <linux/sched/debug.h>	/* For show_regs() */
 #include <linux/percpu-defs.h>
 #include <linux/cc_platform.h>

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

end of thread, other threads:[~2025-01-15  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-07 15:18 [PATCH] x86/sev: Disable ftrace branch profiling in SEV startup code Ard Biesheuvel
2025-01-15  9:17 ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®