From patchwork Tue Oct 24 07:57:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mi, Dapeng" X-Patchwork-Id: 157268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1780402vqx; Tue, 24 Oct 2023 00:51:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhbaFCFUOfj5YHHDs2o96ygWQezL7DunLahXuNhIYmKYGEHaZ3VsbvK2ZUPE58Py+TFmYo X-Received: by 2002:a17:902:d506:b0:1c8:75d9:f7dc with SMTP id b6-20020a170902d50600b001c875d9f7dcmr18790508plg.28.1698133909213; Tue, 24 Oct 2023 00:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698133909; cv=none; d=google.com; s=arc-20160816; b=fREcI3VFgJLiqGlHjo5X47bM/REaCwf6mUZZtT6RtGg2Q9J6NyKFlmeTyp5YU6JVJs 25SgRI563wh10wqB7ho+9+uCbDexgVHi7BrJZCRc9h+NooyChaTe4Hg3zTw/WW+/dRps cbv1rHl578ZBEG6Ha7PBQrNlu6MGL43J/keHhSLUcI9HY1AZS1i4VulvgqPdgGYF3pJE dO9OEsMsFhMDMdA+dlUm3Dz3iCdApvNRPW6MKOXkynWOZ2efhpPYSaX8solF4Uv8uHkf LF+vfh7AsAlRW9aG922HOJaYJTZCDUZ7wf55mFGFEg9LLDxXBmBeDpLPhC9d/mavY3Ay k4tg== 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 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id oj16-20020a17090b4d9000b0027ce5a78453si8143313pjb.29.2023.10.24.00.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 00:51:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; 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 2620:137:e000::3:8 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 5B855804C6C1; Tue, 24 Oct 2023 00:51:46 -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 S233788AbjJXHvU (ORCPT + 26 others); Tue, 24 Oct 2023 03:51:20 -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 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:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780622461936845825 X-GMAIL-MSGID: 1780622461936845825 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++) {