Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1300292lql; Tue, 12 Mar 2024 12:56:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVk/7u6fsdWEShTUtvyNP4MXI++9jAPekByhKng9Sb/1XI/9DMVHxfSbYalnsn2VKu4AUMk2Z0ZpawDYxSksuI13WbkCzoCD+jTbWp9kw== X-Google-Smtp-Source: AGHT+IERwBm0sSe8+hP6CGPU/cYAgyAg1EstI3lkCzgvYGJ0yw0BOHrRnMZYaqoSjxB58notsGjp X-Received: by 2002:a17:907:d047:b0:a46:3aa2:d452 with SMTP id vb7-20020a170907d04700b00a463aa2d452mr3748188ejc.64.1710273396128; Tue, 12 Mar 2024 12:56:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710273396; cv=pass; d=google.com; s=arc-20160816; b=TfOSWhSSpafpfhUeGMDh9SzkHjLfcUp+rEHmvmJlBtg+AyEK3A9Pv8gGgP16K2unJo ipeXlF3STIUBFFB/shLDznLMyF5/To8N+1Gd+VFOn62WM74Bn/jON5KlFV8VyuwexzgQ IoLlqGGnddGH04L0ozHhM/F/MWwqPEUVMW7Rh1o2WYZMUdP8k5jNgA5cwRsgpMFoEhiW hxmLc59e7jSKprW5UXu83qeoLpKwUntZjxXDM8OCg9j5t9hhKvXp9XDBHzaeaomIcG16 lnaGZnzwYBewbgqLBACuW8vkUFYTTfxHQnPRvCdbyQWyJaRSDlPu7iiKKStQ2eLpGxIO Bs/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=hf5HSohkhQcxAR7Z7ENUcmxxLo3lTcaUMn5gqzq++Kk=; fh=OcCxRuUkcFsxZv3NfiNbjp2V+Tv241ETqcct/zILcac=; b=kBHZ1IewG+Jgk1KWDi6gn2wof5P2txIzlZLwVQqCrOxPI7U1rZwSt5NPfBwy9dV45B Blp3J1of8uMnoHnIVV4Rwi5kEMm1MN5eYo4I568lwN0ExBG99aG3d/Y+JGi1t8XSiAPT dkaDyZCnK/zwXDwx/bHGgivU0Yc0384v4+xmo4BTYnLwbHDj9GlDOQ7E3ICAy2vn925b Hvs1hEv7azdDVW1wJEMFP2igDDRHdH9qdeyhfebSYOwabYEgXewuWVQLm+eJzEGXjeTP rKZmLGUUzaDAxOvDEVKBy1VM29waZqhb4rTAwiYQ11DXkrERKZUZiOzDQWR5hsfSYN8E wRpQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tljUnGRC; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-100730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id la15-20020a170907780f00b00a44ecd55a87si3539560ejc.19.2024.03.12.12.56.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 12:56:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tljUnGRC; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-100730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D58531F24149 for ; Tue, 12 Mar 2024 19:56:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11D26142654; Tue, 12 Mar 2024 19:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tljUnGRC" Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B84BD1E53F for ; Tue, 12 Mar 2024 19:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710273387; cv=none; b=lic+EVkBiGAAiwrJyjbkiKMpwCgkcPZVdjJ6I31mtjaXOlayo7vB75TvM4+npIicqE/XcufQYRgizGTRbgNspTOGjPoPm6R4B84ME6ZVr19R7nlJoH0OwbFAolsX/1rn2TKXkcUoLuQxEG08jbbQ4QVPsTRmucsHwTUl5S5nIDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710273387; c=relaxed/simple; bh=JpCfWmE3gZ134IFjyr24O/ViKidoaAIpyYk5Xdh/x70=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CkqzBJIB/4nUlNb1NV9/41wv16I/JhsRurjC9GyLtpUfa1YCqSDgdlXsFBXo6iCtKd1uyQw6yaiFKXUC1/CIapZpabFWoazDXy+iwt0LoTxOvJ1FfdeKqm97oJttGAKHrjH3jErFwCCTBJk+ynou48LcHWxrOLvjFQOCLpdAsc8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tljUnGRC; arc=none smtp.client-ip=209.85.166.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-36645c1169cso28605ab.0 for ; Tue, 12 Mar 2024 12:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710273385; x=1710878185; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hf5HSohkhQcxAR7Z7ENUcmxxLo3lTcaUMn5gqzq++Kk=; b=tljUnGRC4WM8+MbRu/n/q3a0kauBZw0DWdItMfnVylmT1iJCMn0Di4Ps2iMCRkzxwW XTckUE8ycXSKLacd90G4+gF0IWGSQFsMSM0qJffNEB6AMj5A/2xtTCT8xl5c/7w/aqVZ GYFXrgYLzqUNIQt+N59bpnmQ7pNIQhA0PcZ9oOJnq+toyKAvEyM5yOhPhQm70jFIOW27 n6py1/rI9tNCOydWi/kn7/cFDAsZMuwb7Wv3tSZQl26yW6mfpV2tW3qQUC4EPzDet2EJ 9En2r5vyz7GN51kXpwbSUK1Wjf9Z081SNX6aLZRwAUuqr/NapDiDVM6XxsWtq9SHlRdC eMkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710273385; x=1710878185; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hf5HSohkhQcxAR7Z7ENUcmxxLo3lTcaUMn5gqzq++Kk=; b=TSWOYut3offg1eCf7T7VuT9YYGuyq/Ma/PjsDvFKsHfe+Pra7Soa+m7ongpUT0SIIQ bFPYJHyHv5Pb22fobDq4lFb54M5vEQ6VCZFG7Ag5G53nIUDDdkaCPj7dJ5518B4CYKZC PJVH2U0gG5CJJaW2RwIvwYGYYAkNq1rj6Mo2fStfr4B/Pq985xiSbXmq6g6khoV9UMKn E66LC7/H2b6TFkytbWnvWGAuNQIZGRQkKaSq4hnlUzGIxvTo0SPYNoLcGLDdxHWiH7he wdiQuLmNir4XEH4i5sPxwA/hQHAcoPr9n9dCI2tr/fTkMj3fTFKzTCCl9xsVpuslhjAA T8/Q== X-Forwarded-Encrypted: i=1; AJvYcCXJPKCsgzrShonQAS5EaBsQJet8UD/3rQZiDtoLGICAomtShw5wF0nl3FFDzsm66vMvCO/zip8OuI8L0a2JYXGPDlNz4WPzXgHdARXh X-Gm-Message-State: AOJu0Ywx6FqdB5zM9zkOp4kqrNmrnYjv1EnfcinYEDizaPZIJcbIfw/t AYo8S133RqowrSARrj6ZsyxdcMc4zVW6mMARe0oCjL83Z6hYW+USjUWCAIEJavEdk/P3iiqIDdp Fg5lte9VY4+324/lLwvOQfVdvONJARmDIcsoZ X-Received: by 2002:a05:6e02:1787:b0:363:db1c:22ef with SMTP id y7-20020a056e02178700b00363db1c22efmr18997ilu.24.1710273384776; Tue, 12 Mar 2024 12:56:24 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240312132508.423320-1-james.clark@arm.com> In-Reply-To: <20240312132508.423320-1-james.clark@arm.com> From: Ian Rogers Date: Tue, 12 Mar 2024 12:56:09 -0700 Message-ID: Subject: Re: [PATCH] perf docs: arm_spe: Clarify more SPE requirements To: James Clark Cc: linux-perf-users@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 12, 2024 at 6:25=E2=80=AFAM James Clark w= rote: > > 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 Thanks, Ian > --- > 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/Docum= entation/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 bo= oted with page table isolati > (kpti=3Doff). If KPTI needs to be disabled, this will fail with a consol= e message "profiling buffer > inaccessible. Try passing 'kpti=3Doff' 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 ma= ndatory. > + > +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 interrup= t 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 describe= d by firmware, > + or running on a VM. See 'Kernel Requirements' above. > > - "Arm SPE CONTEXT packets not found in the traces." > > -- > 2.34.1 >