Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1059693lql; Tue, 12 Mar 2024 06:25:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWINnnhCTqylhcRFaeNbx6sO7eMitkAjpsX4L8UNVZrsWGHkpyW1tioKpto5WrfqQG+sFqvrNfzs0bOna9CDLcf5+eOIRDgKzurUAAYmA== X-Google-Smtp-Source: AGHT+IFI1dgpnFbj0LOW7ZjFcZdtlEuIuxZTUQed/TkQuEOmkGMIi8yXbpjPHis/teAwQ7fDidd2 X-Received: by 2002:a05:6358:759a:b0:17b:7738:de5a with SMTP id x26-20020a056358759a00b0017b7738de5amr514033rwf.2.1710249951405; Tue, 12 Mar 2024 06:25:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710249951; cv=pass; d=google.com; s=arc-20160816; b=LATHzNnW025vWotwgJjfEPHTiAzF4H+WlGkF/XHks+U3kIY7j9nqfQQ4GSkmcg+7qu qZEPAjK9LpETnMk+lx902YygOlWsrQSNaR4CfEE2ttk0cehszjOpEGVu72+BYVbBQRt9 ZN3B0vG2uMTctjBcHwBXrzdUDN8bX+ASiAYBtl/QEDIkHVoe3XMWTnjLj0e/HO+kwH1E J4pFvdp01glpm1THY/5TceZpFDBodF5p03YL+dZsY+tmFw927575lmXb+cIxaPkM9x+u 72IFnrr13kxF3Xi3WIJbkpB67Z33RKtF9mgjIY58BFRZ+MNeD/GeMOeQYyAjczLkafTs nmDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=4IZy2jm3/eWudJoYiacCvqxRFJ4DeM1IQcwmjFJKFTg=; fh=+sB1ZcbwPbK8mz8+HdREnWhkQc3blumO1fpKhnRdukU=; b=FWSA/5o45owzCjMtjP0SO0n9dkCoky+QF0dQDy5KPRWux4GE6hHNHYv2/N3JtZxEHo PoVeA6VX4ud10Ko2E7U7rLwD5kWzk5wGvwxrD6rOyV7mvS8AuJDONgKLk68xP1w3jyNK uIoZStPESVOKnhI4ConB9pXGPvemyG+D7Z9qO4tqkZ69GeL52FpIAhyRmvdBEvU+9ly9 GkKepy7eqX0JrLKHJgw3Kra3SF/iJOMhf6YNcyHSEuWouCkLMqyH+nwoWQWIOvzNUujb 3ay7t/hP6fkEFKOyoAFrBlOnES6rBj7Q72/lT/DPqwChrkyrweg1OYkDqQCEoSogRvp8 DkEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-100289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bg2-20020a056a02010200b005e4b71b01ddsi7399186pgb.708.2024.03.12.06.25.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 06:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-100289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 13B5D284814 for ; Tue, 12 Mar 2024 13:25:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C09197A72A; Tue, 12 Mar 2024 13:25:36 +0000 (UTC) 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: 8bit 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 --- 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/Documentation/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 booted with page table isolati (kpti=off). If KPTI needs to be disabled, this will fail with a console message "profiling buffer inaccessible. Try passing 'kpti=off' on the kernel command line". +For the full criteria that determine whether KPTI needs to be forced off or not, see function +unmap_kernel_at_el0() in the kernel sources. Common cases where it's not required +are on the CPUs in kpti_safe_list, or on Arm v8.5+ where FEAT_E0PD is mandatory. + +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 ------------------------------------------ @@ -199,7 +208,8 @@ Common errors - "Cannot find PMU `arm_spe'. Missing kernel support?" - Module not built or loaded, KPTI not disabled (see above), or running on a VM + Module not built or loaded, KPTI not disabled, interrupt not described by firmware, + or running on a VM. See 'Kernel Requirements' above. - "Arm SPE CONTEXT packets not found in the traces." -- 2.34.1