Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2528236rda; Wed, 25 Oct 2023 05:36:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQ0cUqELl4dRvzzesLSiXjy7wfdWXMcrnJobCY5cRxDfkNwEuGFJS1DZNzv0ijKuxbrJ9L X-Received: by 2002:a05:6870:7e0e:b0:1ea:2506:3e90 with SMTP id wx14-20020a0568707e0e00b001ea25063e90mr19546693oab.35.1698237389335; Wed, 25 Oct 2023 05:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698237389; cv=none; d=google.com; s=arc-20160816; b=mSnWkkzrFajkroMmz7i4K+K02U17lfjUI66xtSVeXwBapcgkMUwO1HbOKeY93s4zvD IDdzxRPUVisaWNqqe3TVDNZtwXWCkR3cfSwXHRtXOzsWcJ4uf7yZakAqAErTmRd2ogn+ pbaMDOexMDo2x+kZrdnwbHclZtYx9ByWWsQ4xeQZkzjdAk9s5LSiVFbjd4C6NVqh6xVR QgieOwmBEaRRlhnnrLWyWlGl9mtoVKcR3dWgJoobVvv4i0FdS3cLXMk/sQrv40xBqoCh HPPcnrVsNgI0wIcagB5/xWOS9y2BwH/nxdiM52YnJlhRVHofvh/ieC9BjS7vu0VE6L2u +row== 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=LGOk0CnKeZPsdii6KIyKL0bEMGOZJembVuo8Q1dzylc=; fh=uHS0/9G41/xc7SfwaImOsh2CmuncZhRxHxVdkkWVxmc=; b=SkS3OHawyjLI9mfl2RJ6kUtVzTLTT+UzMNLMlrOe6+rn9NBpHAPC4kmkPNTPOiLAUq ADAInPWWEuKA0wlu8PxOwrMfTY2oMCH4g1/1C7ANcpbipToXIyjf4tA6w7kJlEM/Z98m rCCPGWcxXYzwhv9f5w1pf3SrE3H3ULi103FvHRRjnrJVbSeE9mgb3cx3hVT+PC+qOv6T fqCfx5WnjQNm+++f2b40FrxW9mKrKkorCyn7Peqm1vT/MEXBu5v9LefJ5T2BUp5DwwqY rgeB+3cnSdgRJLu246f6TCTkUdZojutslnlcTnN1NIal8gGZzmlXGe19ajWJLx0ocC/y 2X2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YBoQjRLw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id f4-20020a0dc304000000b005a80f099489si11306623ywd.486.2023.10.25.05.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 05:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YBoQjRLw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 507378022B10; Wed, 25 Oct 2023 05:36:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344058AbjJYMgJ (ORCPT + 99 others); Wed, 25 Oct 2023 08:36:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344021AbjJYMgH (ORCPT ); Wed, 25 Oct 2023 08:36:07 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56481CE for ; Wed, 25 Oct 2023 05:36:02 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-53eeb28e8e5so9925a12.1 for ; Wed, 25 Oct 2023 05:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698237361; x=1698842161; 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=LGOk0CnKeZPsdii6KIyKL0bEMGOZJembVuo8Q1dzylc=; b=YBoQjRLw9+oHFDgYKkjzpB+K08IZRJAZ62luCZ2odV/Y8L9LLaQs/qMAi2CQFfzmMF 9zZfzIBkhFKDI/Mev26IL+S0yohinfDqzvYPsqrY/jvpi4fhfoT1XMLb7IFmB6DZYVOm IolLVixIXL9YlT4JUpz/eQpl7MhysL/hVGf039lE9CyMaWU82KgIyncI81xR1n9PRAyd RFbR3XqggLk8haLusZpMZ36QgXHAZV+VSso0J2H7h/fGNfCaNcWfDIlxoVZ+3u8N4kKP BMO8h4Uo/l4d8IV6iF4GPj9YthZhQG+cWy7wLRverZ0mYB2lSe1qvjq8iGReWS1KNDuc SOvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698237361; x=1698842161; 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=LGOk0CnKeZPsdii6KIyKL0bEMGOZJembVuo8Q1dzylc=; b=j2bNpxM/9v0XfpNr2ojYLWJ0DWIFPohO2eW3PWEtPC5imF9RjYXX7/H5gURq63NcwX gvTSeyJlepZDt4i0kU0k9WP22TD/trNbOd9lbLpia5HZRNFGD4yaCQk2fOuYUAZRu9g6 x01B9jatrGgzv6QBPZ2Ajto+Kd+tV9IffntVjTkHmjL190uaVgxXRvIVeRAf/UBm972p 8VzqVRhX75+1SSM8NW1lJ3t1hwFPcYgoG8kvTdssorlH4neloopP3Lesui789Qii2twk y8PsdRBJjN5rkc4WM3hE84iYLo35SwOtT0onEutJVjwcIKTycqB4JbTEPct/YSRahord HzOg== X-Gm-Message-State: AOJu0YxzWdUorWCwD5KSbX3f0f7xmsnwfurpxsBylwe4v2FXLR+bmBPg 9XGpXpubZjoVIzuw5Ic/LwztMItv458fCkDNqtQjGQ== X-Received: by 2002:aa7:da95:0:b0:540:e46d:1ee8 with SMTP id q21-20020aa7da95000000b00540e46d1ee8mr80496eds.4.1698237360568; Wed, 25 Oct 2023 05:36:00 -0700 (PDT) MIME-Version: 1.0 References: <20231024075748.1675382-1-dapeng1.mi@linux.intel.com> <20231024075748.1675382-3-dapeng1.mi@linux.intel.com> <6132ba52-fdf1-4680-9e4e-5ea2fcb63b3c@linux.intel.com> In-Reply-To: <6132ba52-fdf1-4680-9e4e-5ea2fcb63b3c@linux.intel.com> From: Jim Mattson Date: Wed, 25 Oct 2023 05:35:44 -0700 Message-ID: Subject: Re: [kvm-unit-tests Patch 2/5] x86: pmu: Change the minimum value of llc_misses event to 0 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,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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 25 Oct 2023 05:36:26 -0700 (PDT) On Wed, Oct 25, 2023 at 4:23=E2=80=AFAM Mi, Dapeng wrote: > > > On 10/24/2023 9:03 PM, Jim Mattson wrote: > > On Tue, Oct 24, 2023 at 12:51=E2=80=AFAM Dapeng Mi wrote: > >> Along with the CPU HW's upgrade and optimization, the count of LLC > >> misses event for running loop() helper could be 0 just like seen on > >> Sapphire Rapids. > >> > >> So modify the lower limit of possible count range for LLC misses > >> events to 0 to avoid LLC misses event test failure on Sapphire Rapids. > > I'm not convinced that these tests are really indicative of whether or > > not the PMU is working properly. If 0 is allowed for llc misses, for > > instance, doesn't this sub-test pass even when the PMU is disabled? > > > > Surely, we can do better. > > > Considering the testing workload is just a simple adding loop, it's > reasonable and possible that it gets a 0 result for LLC misses and > branch misses events. Yeah, I agree the 0 count makes the results not so > credible. If we want to avoid these 0 count values, we may have to > complicate the workload, such as adding flush cache instructions, or > something like that (I'm not sure if there are instructions which can > force branch misses). How's your idea about this? CLFLUSH is probably a good way to ensure cache misses. IBPB may be a good way to ensure branch mispredictions, or IBRS on parts without eIBRS. > > > > >> Signed-off-by: Dapeng Mi > >> --- > >> x86/pmu.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/x86/pmu.c b/x86/pmu.c > >> index 0def28695c70..7443fdab5c8a 100644 > >> --- a/x86/pmu.c > >> +++ b/x86/pmu.c > >> @@ -35,7 +35,7 @@ struct pmu_event { > >> {"instructions", 0x00c0, 10*N, 10.2*N}, > >> {"ref cycles", 0x013c, 1*N, 30*N}, > >> {"llc references", 0x4f2e, 1, 2*N}, > >> - {"llc misses", 0x412e, 1, 1*N}, > >> + {"llc misses", 0x412e, 0, 1*N}, > >> {"branches", 0x00c4, 1*N, 1.1*N}, > >> {"branch misses", 0x00c5, 0, 0.1*N}, > >> }, amd_gp_events[] =3D { > >> -- > >> 2.34.1 > >>