Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp646265rdb; Tue, 31 Oct 2023 19:48:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHj8xpzq22WBphMoUOdYHzUrWe2m7vnNkDBJQSXhxW4RFZKqOdVjBFHMWsUYauWPZkUU09 X-Received: by 2002:a17:90a:7786:b0:27d:7ebe:2e8 with SMTP id v6-20020a17090a778600b0027d7ebe02e8mr13946195pjk.9.1698806897264; Tue, 31 Oct 2023 19:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698806897; cv=none; d=google.com; s=arc-20160816; b=djzg5CG95j9Pe/+rKalWukJPyzjowhL+oLyX7FWQ0CNpucqS23bE27u320yzls25X3 tpVpXnIYN95UeuTjYhFT0CQn/tdV3Kh1ukV/O67fuGgvNoWTKg/zmpIi7vmPZyGPYTQE 05M9uVd59OywUErnPIOAFodTpuqXQ0stYTRE0BdoExmpzwgi/Gz4gvuV800FEYRvo7Tf s0dhbGhAsdmJbSBaXaCnfrw1It+gmdeS+DsvCDr7hzrBzid2VB0/HuT74QkRgjc5y973 dS0Uain7tKJN6JL+79cP7SiWJ1PrmB3tjiJjVnjv5tmiPIRu9VAzPpXVvWTTQ3J0qK3G 7NzQ== 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=GBisgJ9QGTELvVjJu1jW4LEFa5KH3eLa6pgyaizlfpI=; fh=uHS0/9G41/xc7SfwaImOsh2CmuncZhRxHxVdkkWVxmc=; b=ZLSzobTLn288wpJPZ17F1IGwr9azAm/WEn7Rp87h8dJuH12IiS+EW6zy/1/07O5nPa miG60PR1GoD+gvDjlyouwI50SPPcizmrNj2W9SfuPbjcyDjqQ3Sek5b5N5IRLxK+whlT 8pC5zBPre+hU8Sz+aFE3i3J2cBqAX4VOjG9pm5wi/IolSZEVTB9rLzyUQXS2SCraWzPL 7ihb/eM8ZmWd1V+1Mr2Z0DVJsgcu3/71NxdaxQNBJyxFpbOnBoZ+qYH6fGYBlp5s0P54 kRCGa+1QadLcofYrBT+7TnijngbODDQiY7NIQcHLww5tseMZLR2JyX/k5t3eoDykvCab T+nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=I7dELkTH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id j14-20020a17090a2a8e00b0027ffa51a805si1991090pjd.38.2023.10.31.19.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 19:48:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=I7dELkTH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id E234080234C4; Tue, 31 Oct 2023 19:48:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345164AbjKACsL (ORCPT + 99 others); Tue, 31 Oct 2023 22:48:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345105AbjKACsK (ORCPT ); Tue, 31 Oct 2023 22:48:10 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A19F7C2 for ; Tue, 31 Oct 2023 19:48:07 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-51e24210395so7195a12.0 for ; Tue, 31 Oct 2023 19:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698806886; x=1699411686; 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=GBisgJ9QGTELvVjJu1jW4LEFa5KH3eLa6pgyaizlfpI=; b=I7dELkTHRZI6Ft2T6W/D0rvxDBBGekrzgAHyQr2b0yQmEw9fYhi1HeYBrok/rA61pV VP7+4CIdQFgUDuq0XE/Uw8wftwB8EWY6VTpcKfFV52zHP3w6t0J05lZ9Hw16Zo8II4Zs i/8nmO4EzIErXPSICrecy5r+fO15tKrS2eWUk5cZ77FvetPRHHzFL6U7vwc5GWJqvavS DP416C2DDAruw9c+jTZmvlDPpPfSVZb568uEyOKcmsiK0+eK8IQ07CBurRvBhFqckaBp RPt9IdoQyTL1ild93s2Gf3q026CAXUnFO2g++jARNw3rdFiXqBoFOjqBL3Ez734FW2oZ FsxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698806886; x=1699411686; 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=GBisgJ9QGTELvVjJu1jW4LEFa5KH3eLa6pgyaizlfpI=; b=IJp4qqn8hVW7KP2QnK3y+Aj8KWsQzF9nL6/vo0251ps0sGSO1k3mqDDuAT03fLURh3 rorDaaVYtCZ0RgrHYeGDfGjC5870QkuM3tMF3E0Bro6xxp6mtDBAfrQ1pw968b9NKLjV EdnRsfEempSqSsJoY2HGz+D6e8EO+iDtPVB1DHzX1Bwgjz6qznMJAqOylzIZiS1bJYTd EnJ11slB16RQQvHQYvCsR9To8krrW+W7HWCduEViAhAgBkHiMtr29YR/iaSlTwwb6YPv 9olfcVCAxIUQLYEcifbU8RiE+Ou93XEhHa9HaWBFoZkWEd7joPqN1ibxUA+6LVFKGk34 H7kQ== X-Gm-Message-State: AOJu0YxK/9lsN9WarvRhMiZEH9MCd5CniAi4rPrbRG8izilUYd3iI0NU mq81BYUiR/sNJ7uga61BbLih803MKmOf4YdXoRmbrQ== X-Received: by 2002:aa7:c718:0:b0:543:7345:6283 with SMTP id i24-20020aa7c718000000b0054373456283mr181280edq.3.1698806885966; Tue, 31 Oct 2023 19:48:05 -0700 (PDT) MIME-Version: 1.0 References: <20231031092921.2885109-1-dapeng1.mi@linux.intel.com> <20231031092921.2885109-5-dapeng1.mi@linux.intel.com> <28796dd3-ac4e-4a38-b9e1-f79533b2a798@linux.intel.com> In-Reply-To: <28796dd3-ac4e-4a38-b9e1-f79533b2a798@linux.intel.com> From: Jim Mattson Date: Tue, 31 Oct 2023 19:47:50 -0700 Message-ID: Subject: Re: [kvm-unit-tests Patch v2 4/5] x86: pmu: Support validation for Intel PMU fixed counter 3 To: "Mi, Dapeng" 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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 31 Oct 2023 19:48:15 -0700 (PDT) On Tue, Oct 31, 2023 at 7:33=E2=80=AFPM Mi, Dapeng wrote: > > > On 11/1/2023 2:47 AM, Jim Mattson wrote: > > 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? > > > Per my understanding, as long as the KVM returns a valid count in the > reasonable count range, we can think KVM works correctly. We don't need > to entangle on how KVM really uses the HW, it could be impossible and > unnecessary. Now, I see how the Pentium FDIV bug escaped notice. Hey, the numbers are in a reasonable range. What's everyone upset about? > Yeah, currently the predefined valid count range may be some kind of > loose since I want to cover as much as hardwares and avoid to cause > regression. Especially after introducing the random jump and clflush > instructions, the cycles and slots become much more hard to predict. > Maybe we can have a comparable restricted count range in the initial > change, and we can loosen the restriction then if we encounter a failure > on some specific hardware. do you think it's better? Thanks. I think the test is essentially useless, and should probably just be deleted, so that it doesn't give a false sense of confidence.