Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp155217rdh; Wed, 25 Oct 2023 20:32:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvkvL/5mIAxRY1zW6Ya4kpdEQ21SxyYq02ir2NVVQ8CGoWaLqwLAQbmd+ZzrEeVK1i6XtY X-Received: by 2002:a05:6102:2090:b0:45a:e247:ed7d with SMTP id h16-20020a056102209000b0045ae247ed7dmr2766044vsr.29.1698291173610; Wed, 25 Oct 2023 20:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698291173; cv=none; d=google.com; s=arc-20160816; b=cSs1kWCil+zGywPP1Pn2RBhDrsNJV/56sKVcuFm4j4F1mcdNAbJv50lxnJT1e7TTxJ M9i+r07qf8HsfCvo7wYWCmPTG8AgWWK/j9CEKetMu75zX36vKXw+VpCsxRsVXk60oLP0 mMkF8JcNeO/LBrwlHXCZcLorTpcM3w9kA4gjqH5JPBJIOYzgPG/F28PqkyYfFBycc/cJ iCHUONyrCmyi9CXa2zprMrdrVke/XABQMiEd2NNTtqjpUULzKhrp3kIoOvXpgUz2nkzD SecxqO0JwRSJIGcqvPW8hcsSzNEX0eKJ2gmJ/bE0fBsCb1iR0/+vbxupSeOght7xkvB9 WkEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5iOpADW87c+EEIRgKTDpes6aVRluctrRvJzUGQ83r2Y=; fh=cXP9d744UsOL9nn8OBbQ2P8ZC1168wsUYp8gGLCEL64=; b=zirW0prXhbcKJK+37TRL1j/wTYb+0nFbXt6Cha+uuaiEL5YQhCHC8Oibc8sCGcPbO3 Il4XUAFMiVsOYgsNFBMbLLXQxJnOSklDHEIuVW8a9AEO/y40r4gdr78kJ1mwYhOK+kFN 5bwoWmmPtfQ649/HaTuAGn6SPucylXbDGMjw6hl+vYuG979r4eTm++Ivyr8jXN8FiLay US3Na660dr+FyRCDHL6YXy9y8UajsqgZ3mPeK6j9n0nbCu7k/i9SYJvZdPwapksTHBk6 QTzvNV5Dd2u1swLtro0hwkxvQfactzJUshCRKNFwFBcuq0cpbAjtGUoMNnoFD/3TtqDi cjWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WtxMPDhV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id c9-20020a254e09000000b00d9ca3de8874si11218049ybb.133.2023.10.25.20.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 20:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WtxMPDhV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 9F7488250DCB; Wed, 25 Oct 2023 20:32:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232269AbjJZDcj (ORCPT + 99 others); Wed, 25 Oct 2023 23:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjJZDci (ORCPT ); Wed, 25 Oct 2023 23:32:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D3EA3; Wed, 25 Oct 2023 20:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698291156; x=1729827156; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=j0Fz8CzB06Dw8BJlqfX5Ul19OnFcKlSskxt2P3MS9M8=; b=WtxMPDhV5kM7LIgdkxP/zHJX1NuY8lnNkN2ZOsAEWYNS5HWbdt6wJBAL DO/bjR24ZPMDeoMqJBa/fClgPZul66L8S3hjoL5nwrDNKeWGnvKP3mPki FhtLPCzH2oLsX0QXnfBoncH9hYCp2lmemBvIBEwa9mAtrqXiIjE6RWZ7G vO/zogzHFgAW9iVPhf4oBimxd74l6jCNJ0/EU1TBZDnDy95i0JK6wuP1C ZuzldNyoB9S9OACT0AnlMi/DLHXUFjeC+SaD0Eu5k7X75oFbFrUYsHUYR LR/2Mx6hC5hPpvEbnss3NWbcpK+GW9ZGUGsSibvUv7hcotnZbDIFmCvZK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="366800559" X-IronPort-AV: E=Sophos;i="6.03,252,1694761200"; d="scan'208";a="366800559" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2023 20:32:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="759059876" X-IronPort-AV: E=Sophos;i="6.03,252,1694761200"; d="scan'208";a="759059876" Received: from dapengmi-mobl1.ccr.corp.intel.com (HELO [10.93.20.184]) ([10.93.20.184]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2023 20:32:33 -0700 Message-ID: <719318df-dc19-4f4c-88ff-5c69377f713c@linux.intel.com> Date: Thu, 26 Oct 2023 11:32:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [kvm-unit-tests Patch 0/5] Fix PMU test failures on Sapphire Rapids Content-Language: en-US To: Mingwei Zhang Cc: Sean Christopherson , Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhenyu Wang , Zhang Xiong , Jim Mattson , Like Xu , Dapeng Mi References: <20231024075748.1675382-1-dapeng1.mi@linux.intel.com> From: "Mi, Dapeng" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 25 Oct 2023 20:32:50 -0700 (PDT) On 10/26/2023 7:47 AM, Mingwei Zhang wrote: > On Tue, Oct 24, 2023, Dapeng Mi wrote: >> When running pmu test on Intel Sapphire Rapids, we found several >> failures are encountered, such as "llc misses" failure, "all counters" >> failure and "fixed counter 3" failure. > hmm, I have tested your series on a SPR machine. It looks like, all "llc > misses" already pass on my side. "all counters" always fail with/without > your patches. "fixed counter 3" never exists... I have "fixed > cntr-{0,1,2}" and "fixed-{0,1,2}" 1. "LLC misses" failure Yeah, the "LLC misses" failure is not always seen. I can see the "LLCĀ  misses" 2 ~3 times out of 10 runs of PMU standalone test and you could see the failure with higher possibility if you run the full kvm-unit-tests. I think whether you can see the "LLC misses" failure it really depends on current cache status on your system, how much cache memory are consumed by other programs. If there are lots of free cache lines on system when running the pmu test, you may have higher possibility to see the LLC misses failures just like what I see below. PASS: Intel: llc references-7 *FAIL*: Intel: llc misses-0 PASS: Intel: llc misses-1 PASS: Intel: llc misses-2 2. "all counters" failure Actually the "all counters" failure are not always seen, but it doesn't mean current code is correct. In current code, the length of "cnt[10]" array in check_counters_many() is defined as 10, but there are at least 11 counters supported (8 GP counters + 3 fixed counters) on SPR even though fixed counter 3 is not supported in current upstream code. Obviously there would be out of range memory access in check_counters_many(). > > You may want to double check the requirements of your series. Not just > under your setting without explainning those setting in detail. > > Maybe what I am missing is your topdown series? So, before your topdown > series checked in. I don't see value in this series. 3. "fixed counter 3" failure Yeah, I just realized I used the kernel which includes the vtopdown supporting patches after Jim's reminding. As the reply for Jim's comments says, the patches for support slots event are still valuable for current emulation framework and I would split them from the original vtopdown patchset and resend them as an independent patchset. Anyway, even though there is not slots event support in Kernel, it only impacts the patch 4/5, other patches are still valuable. > > Thanks. > -Mingwei >> Intel Sapphire Rapids introduces new fixed counter 3, total PMU counters >> including GP and fixed counters increase to 12 and also optimizes cache >> subsystem. All these changes make the original assumptions in pmu test >> unavailable any more on Sapphire Rapids. Patches 2-4 fixes these >> failures, patch 0 remove the duplicate code and patch 5 adds assert to >> ensure predefine fixed events are matched with HW fixed counters. >> >> Dapeng Mi (4): >> x86: pmu: Change the minimum value of llc_misses event to 0 >> x86: pmu: Enlarge cnt array length to 64 in check_counters_many() >> x86: pmu: Support validation for Intel PMU fixed counter 3 >> x86: pmu: Add asserts to warn inconsistent fixed events and counters >> >> Xiong Zhang (1): >> x86: pmu: Remove duplicate code in pmu_init() >> >> lib/x86/pmu.c | 5 ----- >> x86/pmu.c | 17 ++++++++++++----- >> 2 files changed, 12 insertions(+), 10 deletions(-) >> >> >> base-commit: bfe5d7d0e14c8199d134df84d6ae8487a9772c48 >> -- >> 2.34.1 >>