Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2540178lqz; Wed, 3 Apr 2024 00:29:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW01pwngxpuMWr7V7IiB7kiFDHRqUn2wKBDNkuF7CjCcLBhPC7VMpEMvlFUm1+23Hj8Bdm5bCY4lGSnekP1YXnRvIXb2oq0XUIK0iihWQ== X-Google-Smtp-Source: AGHT+IHRm7gDAd2CIJMJhxYUkjRPFbh+iX3up7FwV1gA1JQRUYX4VDbetnKsU4tX/7J1pEiGB+cE X-Received: by 2002:a9d:6e93:0:b0:6e9:da60:482b with SMTP id a19-20020a9d6e93000000b006e9da60482bmr1717912otr.37.1712129381499; Wed, 03 Apr 2024 00:29:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712129381; cv=pass; d=google.com; s=arc-20160816; b=hJVweHrFxpoRdPaLDtCmyr01OztCUjDXA9PNkWWf8aRvayKWBXol2cwfb32YBsvtQ8 0DPwSLwvqWEkUWS4EJwlZoiuI+MHTTbouM4lyKLJ7US0r3trDDHw8cLBtP09Hr84P5bZ sMhShjgdd2AOykqDYJLEmBR/r/7hg24DpFvLYCz0oGUjZjQJibp4gysVrFOjClnRKumi FB0br/qHi3xMFEYkscFQLjrYbPAtRzlzjJcER+Pr6ZLb2yppfoAFhvBtKaoU4lmkdqBv 3HwI4SZPqodYOXNghyh/MyBO3RyedLZQV0AAdmteBYInXfrhzwWUgEM+HhnjrIBwI1o8 j0TA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=s49hobKIVDPzW8tIlZcGSj9ukdWmgD47R+ziOoaqb7g=; fh=8kvktbBCl5T3A8UbBAJDcRGNd5jyBSsr4CICpF2kLMk=; b=JiwKNH/oVG+z+4kikfS6LNw1KKJ7SrHi6/RC/WAvhygJoLjN1ThN5kJszc7LTVILwZ j52aZufrPf22kGuzpe/JQFcKooVjlvcZw7wp8UmxkakWJTeH88TrC/Jy9GQVTaD+3z9z 07pfagj3Pn+NOY9HexG+/tYptL8aKrPo6Oww1dPY3mPH/g9itzKThIcIgP+GnduUuvWC 8IdISdvDFCYP9ShrEzv9Y+xe4xqcxyeoC5cIRXRo5MjQsT8eoKL5e+0C1u59F781XuLs b6Yn9/mzVQcvrL6lafYYYFmi0Z5hMs/SIgXKXDb+XO+nCYuSMWbEirPNt92oYerzoAIn qbyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kdYQY1D0; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-129153-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j9-20020a634a49000000b005dc5070656csi12705639pgl.785.2024.04.03.00.29.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 00:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129153-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kdYQY1D0; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-129153-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 F02E42851AD for ; Wed, 3 Apr 2024 07:19:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF7B658AAC; Wed, 3 Apr 2024 07:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kdYQY1D0" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 8B08C5674A; Wed, 3 Apr 2024 07:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712128753; cv=none; b=aDVdBdnZI8T4tJya2Q1dqNtjpGzkfGzWXP2EBLyyt2XR9Tsmc1pYoFISt6RxCvYO8JahYBM3ZEKLKdfcbdRYgIzFppeO6daJlPqL4Fwuxa8vr6rbTKELPAmhrTKA4pFp5w3+fFU5GHiooXigtEcQa68PxAoj1nlTQC2LqsO2zS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712128753; c=relaxed/simple; bh=v45mk+BONJ/8h3rercxajOQAQulxAi8eA/hXvztu0wI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Yq7Wqhw63DapHrQ+c9mgh5fXy6nA3ZamYMMzLSdGuEA7qfOCikPtN+bijPhWVhzcPAc9YEFBv4UZrsh1ctee6gg5iasnE0qg1D6w3wCuOBkymGHjOa0GaQNETLy9W3Ujc3tcDLA4SqGB39+NZsft2SfbNbCbdgNW/APV2n1Lmxc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kdYQY1D0; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-56b8e4f38a2so7257957a12.3; Wed, 03 Apr 2024 00:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712128750; x=1712733550; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=s49hobKIVDPzW8tIlZcGSj9ukdWmgD47R+ziOoaqb7g=; b=kdYQY1D0c4319EjHZk44Z0l5yU5T+bGDnW9eEZci7rHQtjA8JiSExxA4HTCxGFZSA9 5VnHGV9wt9BfuG40d88WCWLKS/i5EwfAUqb4rKbC0h8oilKM1OmFfmaDaAQB130HnthE c9dE2pegUHFslonnt2Z58ftedPsLLizIiQd8TSMrI3dukYZzntElikwvmxn5JXu94496 sST3Oq3iVfh79a4Mg5ce2sELTASZucYEpS/ij5XQHE1U95VRAudfjxVHvUxK6Ae/iBC3 ND8zR8PP5vclehYFqxY/2HKg+1CEdmKnTwE6YDu3zmvzu6JFp4Vmw0aZwwvH0J2G+Zxk WRVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712128750; x=1712733550; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s49hobKIVDPzW8tIlZcGSj9ukdWmgD47R+ziOoaqb7g=; b=udyu5JH9ADrubMFCgXJjUnMezV3PtvO7dFZTiPJFbWOa+Xl6fd9GZrPgyo6qzsFUQM nfLwvh2rI7aft07aSVmOkgf72+wAAzp9DMpTIunnULbJECJr2h8p1n68OvyQkYKVIQEI nQ+ZtEHnyVEzM2yzjfF/nhfXauWMnVJ5zc9s4uVZm9cpVJVVORRbcN51mVG6s1dXj6h3 ATfdupJpXZXn/VwxbVWwCzQKgCo9y2+fpNVXMw7L/sgvbr8Hu9tXXBMkPLzunYCMfSZG 9BO3JL7aTAFsTKqHpzj4tfRBf2JkRQHvmEpFjDpNOmPgJ4GwhUDbuU0ss/c3u+FwiaMS 94+w== X-Forwarded-Encrypted: i=1; AJvYcCXegg74n7lm1zMdpPDZApKxyEW69up5TQRbieeyJhedM0bUsJOqkoNbPDQ0rVAZ0UsDhcJdyKdvpWJVw0Mkf+YcP1HvCC1mjgZbV21XOGdQ43pJuR3prxZJ24iE4nXcTGyO X-Gm-Message-State: AOJu0YxR7JIbyID2u0xnBkCWSr+kemZ6TCMNvieOk978nfT/KVbQbXWE +ycOlMC7KZceTJXnRZGYQTDpIy7SH/e1AZ49NFQKTRYg53OkAvdC X-Received: by 2002:a50:c346:0:b0:56b:7e43:a3f6 with SMTP id q6-20020a50c346000000b0056b7e43a3f6mr1026460edb.40.1712128749359; Wed, 03 Apr 2024 00:19:09 -0700 (PDT) Received: from gmail.com (84-236-113-97.pool.digikabel.hu. [84.236.113.97]) by smtp.gmail.com with ESMTPSA id r17-20020a056402019100b0056c4a0ccaacsm7639454edv.83.2024.04.03.00.19.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 00:19:08 -0700 (PDT) Sender: Ingo Molnar Date: Wed, 3 Apr 2024 09:19:06 +0200 From: Ingo Molnar To: Andrii Nakryiko Cc: x86@kernel.org, peterz@infradead.org, mingo@redhat.com, tglx@linutronix.de, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org, song@kernel.org, kernel-team@meta.com Subject: Re: [PATCH v5 0/4] perf/x86/amd: add LBR capture support outside of hardware events Message-ID: References: <20240402022118.1046049-1-andrii@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240402022118.1046049-1-andrii@kernel.org> * Andrii Nakryiko wrote: > Add AMD-specific implementation of perf_snapshot_branch_stack static call that > allows LBR capture from arbitrary points in the kernel. This is utilized by > BPF programs. See patch #3 for all the details. > > Patches #1 and #2 are preparatory steps to ensure LBR freezing is completely > inlined and have no branches, to minimize LBR snapshot contamination. > > Patch #4 removes an artificial restriction on perf events with LBR enabled. > > v4->v5: > - rebased on top of perf/urgent branch to resolve conflicts with > 598c2fafc06f ("perf/x86/amd/lbr: Use freeze based on availability"). > > Andrii Nakryiko (4): > perf/x86/amd: ensure amd_pmu_core_disable_all() is always inlined > perf/x86/amd: avoid taking branches before disabling LBR > perf/x86/amd: support capturing LBR from software events > perf/x86/amd: don't reject non-sampling events with configured LBR > > arch/x86/events/amd/core.c | 37 +++++++++++++++++++++++++++++++++++- > arch/x86/events/amd/lbr.c | 13 +------------ > arch/x86/events/perf_event.h | 13 +++++++++++++ > 3 files changed, 50 insertions(+), 13 deletions(-) Applied to tip:perf/core for a v6.10 merge, thanks a lot Andrii! Ingo