From nobody Sun Feb 8 12:58:21 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84B3C5820A; Tue, 12 Mar 2024 13:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710249936; cv=none; b=neiVOsvrtwShF0AjMJ526/GRuj5YLuN2KsQF+08/yjCfV9X9+qZUAhrSrtvCZU/MX2K9CMqTe+eMHy77EpGUg+epgskxH3D56/cf+y3/traFk6dXinYYutFI6F1Yl909xtLBM54QxweKqMADRnoz3YsAeRGsSIMx+qaJnM3iuIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710249936; c=relaxed/simple; bh=h0F/trfAXXYdqEzqin5+0bJCK93Ym81jka9vQjFNIrs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WfvYk3huILrTFR5DxVddnerCL6dwM+tp8aLNseCs7b4hmVyaxM6Bc5s8GTTb1+Aqcb598DXKuZpNsWNHDsxJ8rtQEksXclnpgBorYXizyAuA5NQDFSrbzkoG7eaFpHzTBWkVJ7kgNN1oMA2IEjCkK3hdI5BG3F1FYNDPru5aNfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 24ADC1007; Tue, 12 Mar 2024 06:26:11 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 682773F762; Tue, 12 Mar 2024 06:25:31 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-kernel@vger.kernel.org Subject: [PATCH] perf docs: arm_spe: Clarify more SPE requirements Date: Tue, 12 Mar 2024 13:25:07 +0000 Message-Id: <20240312132508.423320-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 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" The question of exactly when KPTI needs to be disabled comes up a lot because it doesn't always need to be done. Add the relevant kernel function and some examples that describe the behavior. Also describe the interrupt requirement and that no error message will be printed if this isn't met. Signed-off-by: James Clark Reviewed-by: Ian Rogers --- tools/perf/Documentation/perf-arm-spe.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-arm-spe.txt b/tools/perf/Documen= tation/perf-arm-spe.txt index bf03222e9a68..0a3eda482307 100644 --- a/tools/perf/Documentation/perf-arm-spe.txt +++ b/tools/perf/Documentation/perf-arm-spe.txt @@ -116,6 +116,15 @@ Depending on CPU model, the kernel may need to be boot= ed with page table isolati (kpti=3Doff). If KPTI needs to be disabled, this will fail with a console = message "profiling buffer inaccessible. Try passing 'kpti=3Doff' on the kernel command line". =20 +For the full criteria that determine whether KPTI needs to be forced off o= r not, see function +unmap_kernel_at_el0() in the kernel sources. Common cases where it's not r= equired +are on the CPUs in kpti_safe_list, or on Arm v8.5+ where FEAT_E0PD is mand= atory. + +The SPE interrupt must also be described by the firmware. If the module is= loaded and KPTI is +disabled (or isn't required to be disabled) but the SPE PMU still doesn't = show in +/sys/bus/event_source/devices/, then it's possible that the SPE interrupt = isn't described by +ACPI or DT. In this case no warning will be printed by the driver. + Capturing SPE with perf command-line tools ------------------------------------------ =20 @@ -199,7 +208,8 @@ Common errors =20 - "Cannot find PMU `arm_spe'. Missing kernel support?" =20 - Module not built or loaded, KPTI not disabled (see above), or running o= n a VM + Module not built or loaded, KPTI not disabled, interrupt not described = by firmware, + or running on a VM. See 'Kernel Requirements' above. =20 - "Arm SPE CONTEXT packets not found in the traces." =20 --=20 2.34.1