From patchwork Tue Oct 31 09:29:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mi, Dapeng" X-Patchwork-Id: 160035 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp108919vqg; Tue, 31 Oct 2023 02:22:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEH/LyhTjs0qBm1ZWPx4fs6CG9hgYRZJRQ2hqcJcnyj5/Rbuh945+JtJdp13PbU8kNL4iQj X-Received: by 2002:a05:6e02:1b82:b0:357:503e:4681 with SMTP id h2-20020a056e021b8200b00357503e4681mr16258253ili.24.1698744148306; 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=czb78FTMflF4fHAh+db/6p2EBR26gKDqmX+SnQ8YjPRYrTwTM7XMbEzvBXvL2iBDos Lan/mC+97hBpXTDEYkyHr/W3LQxACKRPpMnbSnhru6FmV6EnBQVC/nRT+kKfmpTbHa4w FWOWPLFMza9SIL/tCB1k78znCAhH97P5SVgfNp32hHpzBjhJPEU26XzNy0qi6C7X+KHQ T9BuZHSkAs/ckrVKEwqQMYgMdgEhNPFkpHUzVJ8dRvPo6MfQp+9ojPqpqVmmGEoQi01N 26ttChEUMAOwR7k6mVL3+BBLK2ASG70Skc2jJiuABWrsMzGzNavP8CcmNspCwctCDCo1 2+kg== 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:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id c5-20020a6566c5000000b0055793097dbesi770738pgw.469.2023.10.31.02.22.23 (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:3 as permitted sender) client-ip=2620:137:e000::3:3; 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:3 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 lipwig.vger.email (Postfix) with ESMTP id 671D9803513C; Tue, 31 Oct 2023 02:22:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343867AbjJaJWB (ORCPT + 34 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 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 02:22:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781262344226242335 X-GMAIL-MSGID: 1781262344226242335 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++) {