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

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

flat view

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date: 2026-09-24 01:31:46
Also in: kvm, linux-doc, linux-perf-users, lkml

On Wed, 23 Sep 2026 07:33:15 -0700
Sean Christopherson [off-list ref] wrote:
On Wed, Sep 23, 2026, Peter Zijlstra wrote:
quoted
On Tue, Sep 22, 2026 at 01:25:07PM +0900, Masami Hiramatsu (Google) wrote:
quoted
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

When KVM enters a guest OS, host hardware breakpoints are disabled
before running the guest. However, an NMI can occur while executing
in guest mode or during guest transition, where
arch_install_hw_breakpoint() can be invoked from NMI context.
How? AFAICT perf doesn't do that. arch_install_hw_breakpoint() is called
through pmu::add() which is strictly IPI context.
I assume it's:

  kgdb_nmi_handler()
  |
  -> kgdb_nmicallin()
     |
     -> kgdb_cpu_enter()
        |
        -> arch_kgdb_ops.correct_hw_break()
           |
           -> kgdb_correct_hw_break()
              |
              -> arch_install_hw_breakpoint()
Yes, it is done by KGDB. perf has no problem with it.

Thank you,

-- 
Masami Hiramatsu (Google) [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help