Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp448124rdb; Tue, 31 Oct 2023 11:48:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVlljtslZ7Xj3nVxXuV2bgxMr73GXqTrCUAWWPCd+T3L+XZKdCSFl4qouHZgusYaKA/EEB X-Received: by 2002:a17:902:ea02:b0:1cc:5648:f15c with SMTP id s2-20020a170902ea0200b001cc5648f15cmr5893447plg.48.1698778098384; Tue, 31 Oct 2023 11:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698778098; cv=none; d=google.com; s=arc-20160816; b=TXMWISxMmxlPcNzlJepIh8eNw7R7mKO4taJMAyhGAuLtaF+1sCNoKIejPTVQKMYpjS gdJKid5i5SJIQN8NddTUzLlGY8nVN7CloMjc9CVs8Z0o1u4XckpteM5JwGzofuXMt/J6 C/CMx8nufXLOTeAkURhgCSOuhHj9p281wXKWNl2x2EEeeesKLMRyLDi6tJWC7+WzEX6N SEhds0y/oJWgNcRHkCRck5oQEgYELOJlyQStsNWwFVo/Zcm0cH36OnUCQwnLsEzbUAmU V274dUezCS0vHJEPFcRf/1SVzfT7+FYHv9i5LT5WtBdpepuR1VL1brTDteud0SSzM6xC sPiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=T4SYutzdU2lYd0Ydt06asj331E5VhblLHsx51CrMqmA=; fh=IU++XeWNHARdCmzNX1WL+adJi0RuNVWZFmryfnQSNc8=; b=q36FMG4/WXMSvyKzhiB9KTBvy2s8OqBIy1EaXaCHuTpe53vQklXMukiqzdKGK1XRnX pw8Ew6zUUSg6M5vVPRuW3W4zw7hnhYhKn2EHah1oGN+N0xAsflxi552VFBnoyOnu58Yo Cn76pPihRhxxgP2wxUes91n02b7t9HiY6C+1TJ3Q3kKtgM3IENhplREI/wM/uNwx/X21 6iMOc4VkksHxyaxeQCADFo9LmFbfErJWHzIkNn61ToLKvpxG6jP47cuC+VLykRv3FjvD 3RR2iYmDVSxEPpJ3LSGm+kTR6GMRFqhQYIgA6zww/rw8CKEDC4qd4r+eRwkhhzaKbux1 2OZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="YJnTQ/WR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k17-20020a170902c41100b001ca33bba8ecsi1370599plk.371.2023.10.31.11.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 11:48:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="YJnTQ/WR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id ED67E80CC222; Tue, 31 Oct 2023 11:48:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233057AbjJaSsM (ORCPT + 99 others); Tue, 31 Oct 2023 14:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233401AbjJaSsK (ORCPT ); Tue, 31 Oct 2023 14:48:10 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A620F3 for ; Tue, 31 Oct 2023 11:48:08 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-54357417e81so2442a12.0 for ; Tue, 31 Oct 2023 11:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698778087; x=1699382887; 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=T4SYutzdU2lYd0Ydt06asj331E5VhblLHsx51CrMqmA=; b=YJnTQ/WRC2U3bPZjGOWHbLsEkzSghyqbu7bDhyEcSK+kT+HuASVc8f38LejspYCeT3 jsUo/y26VsoY7Bs9XRINtlGOuneO9zFdR5l9NN4rW0QTdhBmDDkGbjPKoZQP58Quf+R6 s54wIqKDqqOQw6LKnN0hGsUtUO6onElpwCmrmg9vNBRGSkAyjtHiiu2gvP7TeD+7V5Ry rcminDem9Z/4gQ7vWhj07yZNQjnhcGNQ0QiXg7CoPuCVMC0o6t7hDBhGfHPlQ1D+2QHy uOXQPD4J+4ToaAaOxsyE5uNCBt07C/Y0By4NejQ82AvcYtiOWXXnt4Zt6QZyt1tc2r1P cHBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698778087; x=1699382887; 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=T4SYutzdU2lYd0Ydt06asj331E5VhblLHsx51CrMqmA=; b=Lg5kXGYKO8sR9MUnmTFwb7sW8r0p/9Eb3Ax2sJ8SggbAJ21WuB7nTdTX65GxasumYA taALDcupRKykTAd8t+Qac9lDq3nar0+bFkmQECD3qM1ZP5TrCNxyHKlfM7hS37PumjNZ /dNfNnbOY7atrevNTGbY0gl+DxD4owqp2ranb9O4bE0NOf5Qx5lbsMCdJyg8dqFbz1Io 3LT/Sf277Ae+5VZw0ojiOXUdLvt5GOwlSKKvy787Kr8gcTDogj4Hmb9OoKGEA2dsLHTz f6bS5MGNR0gh/y/lTqdxXnLmn1t9mjBxJeVZxhl7ccnyubr9D8Ind+2Tm5tocKP/PY67 8Qjg== X-Gm-Message-State: AOJu0YxRFW6WcyxOxGFcWp3nujhUwXMXFEAAHrFx6jGkdNTqdkf4oN9J OqAa2evlSvBbVOR6drsrzQm/FIL4NsGUhfCRSDRj5A== X-Received: by 2002:a50:c04f:0:b0:542:d737:dc7e with SMTP id u15-20020a50c04f000000b00542d737dc7emr201265edd.0.1698778086580; Tue, 31 Oct 2023 11:48:06 -0700 (PDT) MIME-Version: 1.0 References: <20231031092921.2885109-1-dapeng1.mi@linux.intel.com> <20231031092921.2885109-5-dapeng1.mi@linux.intel.com> In-Reply-To: <20231031092921.2885109-5-dapeng1.mi@linux.intel.com> From: Jim Mattson Date: Tue, 31 Oct 2023 11:47:54 -0700 Message-ID: Subject: Re: [kvm-unit-tests Patch v2 4/5] x86: pmu: Support validation for Intel PMU fixed counter 3 To: Dapeng Mi Cc: Sean Christopherson , Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhenyu Wang , Zhang Xiong , Mingwei Zhang , Like Xu , Dapeng Mi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 11:48:16 -0700 (PDT) On Tue, Oct 31, 2023 at 2:22=E2=80=AFAM Dapeng Mi wrote: > > Intel CPUs, like Sapphire Rapids, introduces a new fixed counter > (fixed counter 3) to counter/sample topdown.slots event, but current > code still doesn't cover this new fixed counter. > > So this patch adds code to validate this new fixed counter can count > slots event correctly. I'm not convinced that this actually validates anything. Suppose, for example, that KVM used fixed counter 1 when the guest asked for fixed counter 3. Wouldn't this test still pass? > Signed-off-by: Dapeng Mi > --- > x86/pmu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/x86/pmu.c b/x86/pmu.c > index 6bd8f6d53f55..404dc7b62ac2 100644 > --- a/x86/pmu.c > +++ b/x86/pmu.c > @@ -47,6 +47,7 @@ struct pmu_event { > {"fixed 1", MSR_CORE_PERF_FIXED_CTR0, 10*N, 10.2*N}, > {"fixed 2", MSR_CORE_PERF_FIXED_CTR0 + 1, 1*N, 500*N}, > {"fixed 3", MSR_CORE_PERF_FIXED_CTR0 + 2, 0.1*N, 300*N}, > + {"fixed 4", MSR_CORE_PERF_FIXED_CTR0 + 3, 1*N, 5000*N}, > }; > > char *buf; > -- > 2.34.1 >