From nobody Mon Feb 9 10:34:31 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 35C882698AF; Mon, 12 May 2025 10:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747047086; cv=none; b=C1uzuVmMY/m0sCnlvsBnJ91RoMsCDtj8Mxh0dl31bgVcPKIAzgq0GM7azq7hMYMlIyQyEu8ekCEZ/xXMFHuTs4tTtkzdOl6v3V94jJjrRy4+VaGRAnf4ZM6XcYkC9cOOqb+sVY3L1eVXdduRzE8DQwRb4z9X3FLOm4darBAmWug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747047086; c=relaxed/simple; bh=A4EJCMnwn1nvmjlAmIL8RCldwVes+eDt/ZK/Lm5Mnow=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VlI8DQCJg2vzfuECJw1ErdJYP9adXUbSeESzeCgab1sgu63XE8bYa6/T7mulccbJ5c/CbBvfIvfspxtegS6EzQJu2lgtiTl4r5FWk2749H+RsyyLPF+OlojARF6nzxH70R6PaV7+hOEO9lCZM3w8oJgzAB9pbOJPilQq0qf02YY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=U4eybwbH; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=vS65dfr1; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="U4eybwbH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vS65dfr1" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1747047079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gwFkxej4QZC7RTlNI207kU5RD71foXihmtUnBoEIdew=; b=U4eybwbHCd6ogF3v3MqzsQOV173MvIz6WaM8U1r2HQyKQ58H+o5osc2mzW8+NHBdilO8L0 gDMO+YFnBmzwesBRS46gIoGdBVpGFjTGXcNnIKh0Mx+BhjWfSrJTwhV7p/UTcBtMDQWLJN K8ZtMBKPRNaDJCihVQXZqkEJLqPg1/FypRcJpTH85cPeCgDAYOraS7RBIG9yVHpHNbx1O9 vMOT5MqeCZRXq+5BUYU5JqTqR2GYH6hh47WM5KFy+5nJ5E1aqgMfhA6sHBLTBENswYeHdv SW4LhM6WPPKUq7N3AHHChS10Lol4UkvobX4KQBIn8sj6Oi3uJ4D1LR9t8egjqw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1747047079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gwFkxej4QZC7RTlNI207kU5RD71foXihmtUnBoEIdew=; b=vS65dfr1gr2Dx6xyhV9l3evgMIJzc1+WlSYHDlAC3SbQsSpkUVabv1mbyBma91MGg36cSH qqydjZsKYzAu3qBg== To: Steven Rostedt , Gabriele Monaco , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: john.ogness@linutronix.de, Nam Cao , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra Subject: [PATCH v8 16/22] x86/tracing: Move page fault trace points to generic Date: Mon, 12 May 2025 12:50:59 +0200 Message-Id: <89c2f284adf9b4c933f0e65811c50cef900a5a95.1747046848.git.namcao@linutronix.de> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Page fault trace points are interesting for other architectures as well. Move them to be generic. Signed-off-by: Nam Cao --- Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Peter Zijlstra --- arch/x86/mm/Makefile | 2 -- arch/x86/mm/fault.c | 2 +- .../asm/trace =3D> include/trace/events}/exceptions.h | 13 ++++--------- 3 files changed, 5 insertions(+), 12 deletions(-) rename {arch/x86/include/asm/trace =3D> include/trace/events}/exceptions.h= (79%) diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile index 32035d5be5a0..629a8bf12219 100644 --- a/arch/x86/mm/Makefile +++ b/arch/x86/mm/Makefile @@ -34,8 +34,6 @@ obj-y +=3D pat/ CFLAGS_physaddr.o :=3D -fno-stack-protector CFLAGS_mem_encrypt_identity.o :=3D -fno-stack-protector =20 -CFLAGS_fault.o :=3D -I $(src)/../include/asm/trace - obj-$(CONFIG_X86_32) +=3D pgtable_32.o iomap_32.o =20 obj-$(CONFIG_HUGETLB_PAGE) +=3D hugetlbpage.o diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 7e3e51fa1f95..ad4cb1502316 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -38,7 +38,7 @@ #include /* snp_dump_hva_rmpentry() */ =20 #define CREATE_TRACE_POINTS -#include +#include =20 /* * Returns 0 if mmiotrace is disabled, or if the fault is not diff --git a/arch/x86/include/asm/trace/exceptions.h b/include/trace/events= /exceptions.h similarity index 79% rename from arch/x86/include/asm/trace/exceptions.h rename to include/trace/events/exceptions.h index 34bc8214a2d7..a631f8de8917 100644 --- a/arch/x86/include/asm/trace/exceptions.h +++ b/include/trace/events/exceptions.h @@ -7,7 +7,7 @@ =20 #include =20 -DECLARE_EVENT_CLASS(x86_exceptions, +DECLARE_EVENT_CLASS(exceptions, =20 TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code), @@ -22,7 +22,7 @@ DECLARE_EVENT_CLASS(x86_exceptions, =20 TP_fast_assign( __entry->address =3D address; - __entry->ip =3D regs->ip; + __entry->ip =3D instruction_pointer(regs); __entry->error_code =3D error_code; ), =20 @@ -30,18 +30,13 @@ DECLARE_EVENT_CLASS(x86_exceptions, (void *)__entry->address, (void *)__entry->ip, __entry->error_code) ); =20 -DEFINE_EVENT(x86_exceptions, page_fault_user, +DEFINE_EVENT(exceptions, page_fault_user, TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error= _code), TP_ARGS(address, regs, error_code)); - -DEFINE_EVENT(x86_exceptions, page_fault_kernel, +DEFINE_EVENT(exceptions, page_fault_kernel, TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error= _code), TP_ARGS(address, regs, error_code)); =20 -#undef TRACE_INCLUDE_PATH -#undef TRACE_INCLUDE_FILE -#define TRACE_INCLUDE_PATH . -#define TRACE_INCLUDE_FILE exceptions #endif /* _TRACE_PAGE_FAULT_H */ =20 /* This part must be outside protection */ --=20 2.39.5