From nobody Thu Dec 18 15:08:27 2025 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 609292690C8; Wed, 23 Apr 2025 06:50:46 +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=1745391048; cv=none; b=bPb0OecR7qtDVeHUHcQiBB4VCxdqZ/4e1pi8B9hfYUbFoQrgbNGgUV8DWzUrEEvuhefkR7MNeNIkBPt0fFMnDu5M/ICaKU38QdZukTLG2TEOxds2QCD1/Wh+92Pj7W+yNsc2QpOv0oV6+n/qcQFFZzOcdTzmMwHI4/Z6F6MIjcg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745391048; c=relaxed/simple; bh=D+9wO9dNN3EYV0lv+fWUQwBnCRPK8BfN8oSeYBiKgwM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Wgp268IbbM0NyVlcyRA9+1itHDxcYU8PUgmGeH+UUzqzjxtIcxOYidJ9wjYk1FFN/jWPhx3FCOSNAeBmWDwfoMioZjnCHaHgd7CjoH8hMMgRlLPWbSTrifFwty416hYm34XbY3ypbq+RMuxU9z2qfsE2i2r4lCQgjs3GaoviloE= 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=KkFupDfh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tB7TvnSr; 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="KkFupDfh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tB7TvnSr" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1745391040; 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=X+UQEszhhyx5orvv0upRMEVuQLmNZT576sheEcGpELI=; b=KkFupDfhQSk61/vC+jqfdqXAxGK+O6AjEf6C2kGQ5fPArn2moBe9n1SBwtYtDaflHuVetC DKkuWNTs6MsOM17dJYZjBbGewK4pqiEa7T4CRhEQd0y4z1dWQwN9yGcHxpeGtNMX8krEX2 zB9TG7fyPNaaqUMRUUSqjsdQzV+MbNbcOQrDT2QQd7H/IKhaNS15sivjXJfeN2fSJQ+USv 7MsKcQLopMkRVooCo9wVuOXtahW+YdEnprOjmGsbedunBoyRZBvd03ihEZutH4XzdzpIAb oU7mP+qPT8Cf1WTVdGWhISe3+0ZJ5xDug0Atx10JNdZNRWWyagPrGiMAVWQUqA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1745391040; 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=X+UQEszhhyx5orvv0upRMEVuQLmNZT576sheEcGpELI=; b=tB7TvnSr3wIcMC6krcZbNqPS4mirEPlVVgr428x4b1TbyVzBlyWhNszjdtfvXn9gS4Apv+ 8fsj7DrGsOONzdBg== To: Steven Rostedt , Gabriele Monaco , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: john.ogness@linutronix.de, Nam Cao , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 17/22] arm64: mm: Add page fault trace points Date: Wed, 23 Apr 2025 08:50:12 +0200 Message-Id: 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" Add page fault trace points, which are useful to implement RV monitor which watches page faults. Signed-off-by: Nam Cao --- Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org --- arch/arm64/mm/fault.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index ef63651099a9..e3f096b0dffd 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -44,6 +44,9 @@ #include #include =20 +#define CREATE_TRACE_POINTS +#include + struct fault_info { int (*fn)(unsigned long far, unsigned long esr, struct pt_regs *regs); @@ -559,6 +562,11 @@ static int __kprobes do_page_fault(unsigned long far, = unsigned long esr, if (kprobe_page_fault(regs, esr)) return 0; =20 + if (user_mode(regs)) + trace_page_fault_user(addr, regs, esr); + else + trace_page_fault_kernel(addr, regs, esr); + /* * If we're in an interrupt or have no user context, we must not take * the fault. --=20 2.39.5