Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1722855rda; Tue, 24 Oct 2023 00:52:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHz9YtH58jIq52wv93Ot/u2Vvut6B7UEFRHjXpGzOgu6amJmAfs+wtqJ6Ik7oNuSVxxtfPS X-Received: by 2002:a17:90a:1943:b0:27d:63f1:2d24 with SMTP id 3-20020a17090a194300b0027d63f12d24mr16410337pjh.0.1698133920187; Tue, 24 Oct 2023 00:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698133920; cv=none; d=google.com; s=arc-20160816; b=PFDXftS/AHHmdhHxaTAmBoYQojJcYuK1cqcWANinH9Cy4KH6zaLvD/KyCQT50ixRFB uF18uNsoa/uYEho8IB/uaro35Z5jUCBQi764fH9+TRNZ9pUxB5XDvoAvsGtpbcAQUExz VlK9YaIMQxuSSjbQuMcNdrCPTkuUiZ9jCi05z7F4homAgVgMJvzFFgGizlA0tBQGd2zK rLu/lGrc1/iy7c+RbWfs3X653QmgLpSZMe2r1hoZx+VBfxN8nBR2BL/PcDTfOaCFBNKI pushFysqRrzSmAOdnK8omZa1ooKL6yG/QRllpWebLS164eclPwaNeTdpYZGHQwEFiSRj oj7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=L81E/Emnscmi2jwx8JYVPLtMoKsgpsZcHXwc/ho8Vf0=; fh=E3ilibYCxplRFz20OpOkjMj1lMKBPGRzcx1abGX98y8=; b=pJmgbvlI+v5sztKFgHXG+AEAnte7QOGR3JEKoAZ0pLCEVOFYbWJPkkL3+cGPUeiRhN B+MjblWhCitmGaGj+SXxawJL75J9+0WRGRMtIghe7ClJX492f73BQWTks0Ns+11dUexM Ds7E1hG3Qmg5jsUkGpbm6JosMSzDrkghYJkqxhuy39v638X4bQKJg7M4KZ8kDn7h2E/B QI+zWHnPNdrqIy+ndb67pIz0r65tMq67N2oOMG8lfCoTowXgdzHvaGJa4QJYTpweUGfU MtoLv5A1Yn3xtnn70L5LGJiBzNUlT3OuZOxXI9OXJRhxK66WdWrafXq5Q0P4Dq7oVjry JqMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kISNShtq; 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 a2-20020a17090a854200b0026d0f7c6b17si10694809pjw.30.2023.10.24.00.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 00:52:00 -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=kISNShtq; 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 63C3F804C21C; Tue, 24 Oct 2023 00:51:57 -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 S233787AbjJXHvT (ORCPT + 99 others); Tue, 24 Oct 2023 03:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233802AbjJXHvK (ORCPT ); Tue, 24 Oct 2023 03:51:10 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ACB210C0; Tue, 24 Oct 2023 00:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698133866; x=1729669866; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+AbwY0EJ42oSmqGLiVvQ29v7o8KNMXXfoBc4PPnmCiI=; b=kISNShtqH1NKYVqoeMA/X3Nys0ayQ5vRgzaKmt+ISwAL4KyMaHguRu/s pIcciA8HuQekBNSTwwFeixR0BA1yTXix9x219snIskl5E8NmsQ76ezyWc fRkGggtQP+Xp0Ihd2ObUZKzfiQj2Jv1fBs1iZq40O3JqHGTTYH+fe453H GZZWCJtnSKodehBrlcKgUapz2xP4ZaOT/0UjbSzHVANN0lyL34l2soTnX teNDfP65ePPrZJFVh0mzDrSe/Q2+VFYRHE/4+sAzgpM2NeIjYgXRUYFtG JYN22qVssrtM6izjsA6VkhSZI9QbN/YZ0qu6dHWoqbkVN+HE7vjA8nC9v g==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="367235211" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="367235211" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 00:51:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="1089766298" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="1089766298" Received: from dmi-pnp-i7.sh.intel.com ([10.239.159.155]) by fmsmga005.fm.intel.com with ESMTP; 24 Oct 2023 00:51:02 -0700 From: Dapeng Mi To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhenyu Wang , Zhang Xiong , Jim Mattson , Mingwei Zhang , Like Xu , Dapeng Mi , Dapeng Mi Subject: [kvm-unit-tests Patch 3/5] x86: pmu: Enlarge cnt array length to 64 in check_counters_many() Date: Tue, 24 Oct 2023 15:57:46 +0800 Message-Id: <20231024075748.1675382-4-dapeng1.mi@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231024075748.1675382-1-dapeng1.mi@linux.intel.com> References: <20231024075748.1675382-1-dapeng1.mi@linux.intel.com> MIME-Version: 1.0 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]); Tue, 24 Oct 2023 00:51:57 -0700 (PDT) Considering there are already 8 GP counters and 4 fixed counters on latest Intel CPUs, like Sapphire Rapids. The original cnt array length 10 is definitely not enough to cover all supported PMU counters on these new CPUs and it would cause PMU counter validation failures. It's probably more and more GP and fixed counters are introduced in the future and then directly extends the cnt array length to 64. 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 7443fdab5c8a..1bebf493d4a4 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -254,7 +254,7 @@ static void check_fixed_counters(void) static void check_counters_many(void) { - pmu_counter_t cnt[10]; + pmu_counter_t cnt[64]; int i, n; for (i = 0, n = 0; n < pmu.nr_gp_counters; i++) { -- 2.34.1