From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DBC92E8897; Wed, 15 Jul 2026 01:44:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784079870; cv=none; b=sB1L7LlKtubaifBZd6hfY2fuUPA/iIeaUb8MTNfwS1xhvALT+JnxlRDN7RfChhCA8o6R8y8kf/1nZkQnNs5kejM8WBA16Tgs3EdWaxHT2jXKOn6VvisCymF3OU3eAaMAhcdac95t54uffqxxjGrXgOQDTcA5J64UieK/cBw+Hys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784079870; c=relaxed/simple; bh=BFbZh+ntuWHBtFTy0Ki3TzUY5YSGmIRu5fpRYKoG3v0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iOp7+8PRU6ZRlg3kOM8zDU36OmibtKuvTimN0NPcOOPTaGPFBv8CZYfZH8LlcUua3YSQ1KNOatoCELwV5OmP/7vF4Rtm2ffHRolISwlShM69VX2yxqOLAA1/LxL6Dkxio7B1EIZltrB1fnlLN0mEXb5X3LhDozfMsSB/mWDf3OQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AUx9KCLa; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AUx9KCLa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 163501F000E9; Wed, 15 Jul 2026 01:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784079869; bh=M+9gUWXB1JxNkcnC7x8wAJsFruNd1Q8F6mv3i+BG7A4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AUx9KCLag7Jt0GSDr2YrUtqkv4sdPaylmgQZhgQk2NABmoVZPgKR+5HWk8ArBNDoe /U4+DJOtR+5SNEXdjDsiE0RuN6+9KBAD9LTL+4+1XHkCFqp1RJXaEi40I5oSpZcK86 D/65w9aQuwqx1+fexB8jGQmgsnDKIOTVNYumAGnFvMobADyrU3d7qEQwZqk2G5FmGw PlBzsbEkHEOgjLMTEHGYTQejD6oynN0FAnF0DAp6wCHj0B3c1AFIruxNwy6WG0NRm3 omYDktiCqWpgvTM7yVLyQ761lasQvXwn66qWgqF6q9N+P3uH+ulhDPL7iKROLhjP1w RuTV8L82l+IVw== From: "Masami Hiramatsu (Google)" To: Steven Rostedt , Peter Zijlstra , Ingo Molnar , x86@kernel.org Cc: Jinchao Wang , Mathieu Desnoyers , Masami Hiramatsu , Thomas Gleixner , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Alexander Shishkin , Ian Rogers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH v7 02/10] x86: hw_breakpoint: Add a kconfig to clarify when a breakpoint fires Date: Wed, 15 Jul 2026 10:44:21 +0900 Message-ID: <178407986179.95826.1630626264869856006.stgit@devnote2> X-Mailer: git-send-email 2.43.0 In-Reply-To: <178407983818.95826.12714571928538799781.stgit@devnote2> References: <178407983818.95826.12714571928538799781.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit From: Masami Hiramatsu (Google) Add CONFIG_HAVE_POST_BREAKPOINT_HOOK which indicates the hw_breakpoint on that architecture fires after the target memory has been modified. This is currently x86 only behavior. Signed-off-by: Masami Hiramatsu (Google) --- arch/Kconfig | 10 ++++++++++ arch/x86/Kconfig | 1 + kernel/trace/Kconfig | 1 + 3 files changed, 12 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index fa7507ac8e13..959aee9568ff 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -457,6 +457,16 @@ config HAVE_MIXED_BREAKPOINTS_REGS Select this option if your arch implements breakpoints under the latter fashion. +config HAVE_POST_BREAKPOINT_HOOK + bool + depends on HAVE_HW_BREAKPOINT + help + Depending on the arch implementation of hardware breakpoints, + some of them provide breakpoint hook after the target memory + is modified. + Select this option if your arch implements breakpoints overflow + handler hooks after the target memory is modified. + config HAVE_USER_RETURN_NOTIFIER bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bdad90f210e4..6b7e14ef8cfb 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -246,6 +246,7 @@ config X86 select HAVE_FUNCTION_TRACER select HAVE_GCC_PLUGINS select HAVE_HW_BREAKPOINT + select HAVE_POST_BREAKPOINT_HOOK select HAVE_IOREMAP_PROT select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64 select HAVE_IRQ_TIME_ACCOUNTING diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index b58c2565024f..d9b6fa5c35d9 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -866,6 +866,7 @@ config WPROBE_EVENTS bool "Enable wprobe-based dynamic events" depends on TRACING depends on HAVE_HW_BREAKPOINT + depends on HAVE_POST_BREAKPOINT_HOOK select PROBE_EVENTS select DYNAMIC_EVENTS help