Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp114994rdb; Tue, 31 Oct 2023 02:22:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0hmQt95Ih6rRKY1d8j/d8gWb5jsjV5ZxIABEirW3mFp/2moovIE0BtrRCkla82EKcm639 X-Received: by 2002:a17:90b:23d7:b0:280:29cd:4802 with SMTP id md23-20020a17090b23d700b0028029cd4802mr6491650pjb.3.1698744148836; Tue, 31 Oct 2023 02:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698744148; cv=none; d=google.com; s=arc-20160816; b=VJdk8iQ+pEG6iytPDpMiGBLqC4AVk0P6SNIoXThxQBph/5MbUw8AQGWRgC1vjRS5jH lIVW8VCJjX3Ce99grT7o8Y1ZBhDKilPTfomyTjtoxe4BaEW9rpuNsucN7leJtMDSZci+ iu9uolJlnLikswGcttG3jCPuGAtA7WuM0rOHme1aye+3wmMPW0IRviJfGToaKdXxinD2 rRbLtpLTGRlIUTjTOpgZH/URpL+UWUzONpLpOPNTgnF+ZjQxzbokU5KNdrRqUQfdPshc N24nJ9o8zhQplhJi0rbPPXFqaGyu3BYV11sJ5D1tjcUwptHnZH5+o4JCn952X9QR/j8p YaVg== 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=LBGI7qUY1GSsCPPZFubYI35avsIyXBhNEW3q/colzXo=; fh=E3ilibYCxplRFz20OpOkjMj1lMKBPGRzcx1abGX98y8=; b=SqCtceAZ/FfGHfCSHfqFL+SLo/TEuWqjGk4a/NMCfsL0AegUn4Y7p9FifmFvQmSNBv KWEHbKhr/U6uDHjxoCCdlnaWtlZv7w2/8ZYsHQ3QMB43IrbscYgc0HgYE1gtemlUl8ME AUF7I6/k38oSMZptdQOZmlc7K3+ngBH1NcMcTzDMuLxt4Fl2XFK06V2GBEeVovXSoVK9 K3UDuigDiM0hsk7Vu9imPzi2ei79mxpXmoZnWM1iR1h/vBBEupiXZ2HcYcIguQ+85daT xFLz002o0UWqoGqPfv9eIas/SdzXUFiurgZWdfkpIgSR+jJAcv6NXXWuUXJTpdhqU+0V A1Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="iWx4M9u/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id pc3-20020a17090b3b8300b002806bdcaa5esi722525pjb.110.2023.10.31.02.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 02:22:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="iWx4M9u/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 4BD1C80A8024; Tue, 31 Oct 2023 02:22:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343866AbjJaJWB (ORCPT + 99 others); Tue, 31 Oct 2023 05:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343853AbjJaJV6 (ORCPT ); Tue, 31 Oct 2023 05:21:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA494F5; Tue, 31 Oct 2023 02:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698744115; x=1730280115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UFdm8PB2RMdMC4FZjkejhXgoSvo9XB2tTzL2mbbsxug=; b=iWx4M9u/9A9OWr3wBgyb7kE2Du0NZCDOL0eH9IQaQpiwvTtQuXt6m36Q CSWkZWhJtmKfyZBybPIV/3riyz0IXZQqxL7fE1VnAgjX9lNEjpsra0w7u pKzGtHjCTjfKySWSs6wimh5WkeJ61bydumltAL4YKhs91cUwlpLrvVsBI 05APr/LxjkdaJ5DexTyrCFVKkbiZNDLHCWW9QhuhfsDxD3QQVOy9ko8N8 AJGlKmPFWxAHCu3fIMsKHBTvtFiG89ygXTZXDanuycdJo+VIhXrQOgjju 7N58szOrVQf+rz3GRBj7VV+CgbRCDFvtRUSE7yXvfjAp68WZOelLyj9u1 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="385435973" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="385435973" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 02:21:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="877445527" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="877445527" Received: from dmi-pnp-i7.sh.intel.com ([10.239.159.155]) by fmsmga002.fm.intel.com with ESMTP; 31 Oct 2023 02:21:53 -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 v2 3/5] x86: pmu: Enlarge cnt array length to 64 in check_counters_many() Date: Tue, 31 Oct 2023 17:29:19 +0800 Message-Id: <20231031092921.2885109-4-dapeng1.mi@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231031092921.2885109-1-dapeng1.mi@linux.intel.com> References: <20231031092921.2885109-1-dapeng1.mi@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 31 Oct 2023 02:22:26 -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 1df5794b7ef8..6bd8f6d53f55 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -259,7 +259,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