Thread (45 messages) 45 messages, 6 authors, 12d ago

Re: [PATCH v17 02/13] perf/x86, KVM: Prevent host debug register leak into guest OS on NMI

flat view

From: Peter Zijlstra <peterz@infradead.org>
Date: 2026-09-23 09:16:02
Also in: kvm, linux-doc, linux-perf-users, lkml

On Tue, Sep 22, 2026 at 01:25:07PM +0900, Masami Hiramatsu (Google) wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
index f846c15f21ca..0473a5c95856 100644
--- a/arch/x86/kernel/hw_breakpoint.c
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -102,6 +102,9 @@ int arch_install_hw_breakpoint(struct perf_event *bp)
 
 	lockdep_assert_irqs_disabled();
 
+	if (perf_guest_in_guest())
That naming is hilariously bad :-)
quoted hunk ↗ jump to hunk
+		return -EBUSY;
+
 	for (i = 0; i < HBP_NUM; i++) {
 		struct perf_event **slot = this_cpu_ptr(&bp_per_reg[i]);
 
Note how the other -EBUSY return is a WARN. Why is silently not doing
anything not a WARN in this case?

And I suppose this is KGDB again?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help