Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp113094lqj; Thu, 11 Apr 2024 11:17:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGKX6f6KKAi7+jS/+b5Aow+l0w59o0wL/Yy9AvXt6VRfG+ns3OMhj2XqKOVs7e856SAAds1hS3AKU+mKmDDPb4FPq50+/Qp+Y3rlPS5w== X-Google-Smtp-Source: AGHT+IG4UrURSqrgoj20R/b0jskadpRmjFm0uj4ULEOxkennYGhoiIOz3/6JKzE7WH7n5GUCdWKy X-Received: by 2002:a05:6a00:cd3:b0:6e6:b71f:e80b with SMTP id b19-20020a056a000cd300b006e6b71fe80bmr626539pfv.7.1712859459019; Thu, 11 Apr 2024 11:17:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712859459; cv=pass; d=google.com; s=arc-20160816; b=mfleGTZsNFOqdnWWXFlhBTEkY3gqDBuCMfHgIQH+827tV7Bbo4Ius/vKBj6Q1jgYgv Y5Afb7PypRGBM0ORrrRinZMkaUh72hQfQ4LSCbPmJr+Te+YBGGBSFzlDj7R0wsbSjb8o j4LMvBUyCOhpWj1AageudODKp+aLXRG0f57NYo+jMN6z2T/IU6WPlxEffP49wIQmRS5H HIkDqHkhLjCq88AdXJjoLFHi4TxmLAfwS29b7TLG2D6WlWbxOUuFXjUCvlWZQbqXkKCB TXwdcPGuUUA1s6WmcFfh5bwY7QMDzQd49JtLZwp7zYfVKL6Hym5IHZK1+4sK7O4sqaG8 XxFg== 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=pbe+N+ArnFJu6oo3t2QxqRzeLGyanm8Bt8NltXAuiV8=; fh=v2J+/24GW16juk29Zv3tPdX5RMOBsOfvzY+e7Oo4joA=; b=ifGXms/v3B+9MoRQdwETL4SAwc8nnl1BS8HRkhFNNgp7O2yYTDLq4VPAgKuZjpQWW0 KvDkPWEx8GAzkJLbp3lbfDLuMK5dV6HpszuFc6S5efA8oCxKw7vikY6OnVPZwMkTOG1A NzOWARcnvo/VvvFgb6CtpHWllWmztheVo1+KqrC6T552PjxCZ66HA5O/nlRvIcD3gq+v Ke6a3uHJNPLSHo8A0watW9OewJZV+9wdGOCqmaF6CheBT+zJnZJEwLWgjaJ1McA42Qj9 jFmG631nH3o4sN2/dTKnyuJurJ6x2zx99/guXOoqHXQDXXefLjsCxk7iweYK5SFAc5N/ IXTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ICJlgC4d; 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-141395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d8-20020a63ed08000000b005dc9617013bsi1621422pgi.33.2024.04.11.11.17.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ICJlgC4d; 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-141395-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141395-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C46FA289168 for ; Thu, 11 Apr 2024 18:16:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6465182DF; Thu, 11 Apr 2024 17:24:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ICJlgC4d" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 AD5F8205E3D for ; Thu, 11 Apr 2024 17:24:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712856264; cv=none; b=utqffH5GzbWQFSqvMsgvicffhB8SX53wXu7MjiPh501GGqZynMm7MtQ0zKqS2vncshkWI6JFuz91eRxACxr9uwsFYnA9M2SQcAd5+rHpSxN+CNFD2M55D81FMrBbf7t6BxB9FoszRj5cCeQIVe7kqyUTX/oRWQeSjfPXrJxUL0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712856264; c=relaxed/simple; bh=OvyPA4qcqhT8afxo9TDbGb0P1gxyjdE+tUpwI4Y5ptU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CCVuE9OcpXQILv+I/vC9fMpfILlPrIAyiNuw9rtaS8vglRWjoLJB817X7Xw3IboIn5Nhy9vOP5RrMH5SjGFDFVNCpUzH0psZE84iFHqw7iHYOwGHBf+yIjK3Znk5CsZWVWMVsEw0fMkXodPVnT3pCmGeF1FFjRrAQVCKGHCSMLg= 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=ICJlgC4d; arc=none smtp.client-ip=209.85.208.44 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-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-56e2e851794so873a12.0 for ; Thu, 11 Apr 2024 10:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712856261; x=1713461061; 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=pbe+N+ArnFJu6oo3t2QxqRzeLGyanm8Bt8NltXAuiV8=; b=ICJlgC4d/3wHMB2y72CNjmO71BwtmgY37MSB65HSmXeoh04wOjETNAhmw92q6w005D W6xRGC+nJ4D6BG90xmeuaKWLDaEnnRXd/uuiAwqtSYfk/VemLXly5A7nGfdpDEhlOsGH afm9ZPVInUgdPYK7Cd3z5j1M67Lw0yOlgAoNmhEgkC47zayfJTAGSYZgqONvtEzFuhlQ CRz1FOilUjB1d/3vlV90xwjXsqZSfdOfCe3nKx5Zj+iz7F+2P2xetdAiozyDF0fJczGl sKionBW7wZGtJ4LWgbe6SLFzQZvN9S2slsJ0JbC4BHyx/xDeTbV4PBc6zdwLP8SGwtcb RIqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712856261; x=1713461061; 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=pbe+N+ArnFJu6oo3t2QxqRzeLGyanm8Bt8NltXAuiV8=; b=EiEVcVUaO7PaJjZV5e5G3eAEdC3E6Wian8GAxM8m8jrVkHludUTREIN6L4oxxuEdO4 Q3MFTRfVptiY+3zxcUmxC9rlWFsMLyR2l06z0TfaVC5G1VVRMhPCRSJhuX1NJy+xLE6g mpyLc1wpNWA4dkSSJSAAGPn8gvpPRJ1aFgqIORxNHJNWy59LxigcXi8fWegSTqvkZykJ 4Pic1RHl9NG4i2dGPnI/YvRcSf/Ntxn8S+khLly9et5i8JKXzi3AzfOg3IkwrwSuXPNP t0mxsJskJ8v4mq2tXwmkc0blqR5CgxSeXRrfCloW6aPUrT8YOZ24aWnA5A9DCzKQqmQA 4+Ng== X-Forwarded-Encrypted: i=1; AJvYcCXWsqORqNgZk7SqzWgibdKL0DCNeOLzyg2c28KonNu03PK2JMI4TKp+IV23e2J2ttxLiJvDGP2PHEfNEgfSyo3WXXpr+FVyDoiZGCtJ X-Gm-Message-State: AOJu0Yx7q+0PkaG2ZeGXS6gzcRp2JvTidBeoqF85QnJAQ+KkBOkv+CW0 VZgct8X4puQO1p/reTzLonTQBd41B2cWQ+kDrHryFtc6sNqAZ8AEL8zJz6S+9cqCYvNOAfWwguK YwDnG61hBUazi9NiuMwwJ8HPmM/GnvPk/hKS0 X-Received: by 2002:a05:6402:34ca:b0:56f:ed6f:2b6d with SMTP id w10-20020a05640234ca00b0056fed6f2b6dmr129606edc.6.1712856260820; Thu, 11 Apr 2024 10:24:20 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240126085444.324918-1-xiong.y.zhang@linux.intel.com> <20240126085444.324918-2-xiong.y.zhang@linux.intel.com> <56a98cae-36c5-40f8-8554-77f9d9c9a1b0@linux.intel.com> In-Reply-To: <56a98cae-36c5-40f8-8554-77f9d9c9a1b0@linux.intel.com> From: Jim Mattson Date: Thu, 11 Apr 2024 10:24:06 -0700 Message-ID: Subject: Re: [RFC PATCH 01/41] perf: x86/intel: Support PERF_PMU_CAP_VPMU_PASSTHROUGH To: "Liang, Kan" Cc: Sean Christopherson , Xiong Zhang , pbonzini@redhat.com, peterz@infradead.org, mizhang@google.com, kan.liang@intel.com, zhenyuw@linux.intel.com, dapeng1.mi@linux.intel.com, kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, zhiyuan.lv@intel.com, eranian@google.com, irogers@google.com, samantha.alt@intel.com, like.xu.linux@gmail.com, chao.gao@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 11, 2024 at 10:21=E2=80=AFAM Liang, Kan wrote: > > > > On 2024-04-11 1:04 p.m., Sean Christopherson wrote: > > On Fri, Jan 26, 2024, Xiong Zhang wrote: > >> From: Kan Liang > >> > >> Define and apply the PERF_PMU_CAP_VPMU_PASSTHROUGH flag for the versio= n 4 > >> and later PMUs > > > > Why? I get that is an RFC, but it's not at all obvious to me why this = needs to > > take a dependency on v4+. > > The IA32_PERF_GLOBAL_STATUS_RESET/SET MSRs are introduced in v4. They > are used in the save/restore of PMU state. Please see PATCH 23/41. > So it's limited to v4+ for now. Prior to version 4, semi-passthrough is possible, but IA32_PERF_GLOBAL_STATUS has to be intercepted and emulated, since it is non-trivial to set bits in this MSR.