Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp114894rdb; Tue, 31 Oct 2023 02:22:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZe3WPpuGOy7sELnnxiabXXoncLQ1H2s9iwBZDt1/JpgcZNVNv72BHUx6QtRS8cgVG/np+ X-Received: by 2002:a05:6359:2e01:b0:169:92d:64c5 with SMTP id ro1-20020a0563592e0100b00169092d64c5mr9135730rwb.32.1698744132722; Tue, 31 Oct 2023 02:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698744132; cv=none; d=google.com; s=arc-20160816; b=Q/FpsLDP22suKdHGg2uMx5EZ+BiKMkBENlF5ZkmqaROCK7chyvOktYs2ZNnDb3mbfy hDM88XTQoX7776X+QEfQIHn6jBN1iKVpZ6Zxx4SgpJlbTrekbyZ4HwhR05FclbHX+0Ty wX8Woju+uGepoP7s9b/bkKA8LPCSu0NkXBDAtsnsBoq0wU3uH0LgyO+7PIeqJt2XEXHi m6HQzlfDhDDzgQOf2+Cp9PAMukB3yIKmFXtIyxJq5TRKII7QqFwmHGeVag5GAcZj2pQA xbgnboNOgfd5tyXVnE9p/fW0SH9Dd6X8HPr4t0ctG83CsDu2qqJnENaQUA4aCRKv14W5 CZsA== 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=B+0MshwLV/DpfjNdkFno6rBuEKezzJjEruxroCSkB6w=; fh=E3ilibYCxplRFz20OpOkjMj1lMKBPGRzcx1abGX98y8=; b=pOBzR4fOsWKbpkffyfXOfmxfnMlUSVxc//l7LWBN+PT2EjXzYFWNrWCfO+LjPCUVOc CvigTqxykAMBMIH/IWAnHj0r3DluU4zegWYCZg0+DkkmRidvGAJDaC6I/F4q7fFf3yKZ 34YAhBKShi8j+NARiUYGTqTwp+3VdNHsEDMsFP6dciSKl88X23eDCedc6XvSIKQ5y7oh axy//l2oZ3eH/buLqiqnVI0RiqAd7E4Jn7r2MNtORfQoa7CeYZ+bm1SW+0W5hvEk52j9 5KAFVKo7C6PQdv2pe+cjYTcECARbtf6TMhJj4uKWQ/m3wtLgksvb/BvJVmXbSZgKrR9u 4eVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=B8h1ZqJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h69-20020a636c48000000b005b403446f1dsi760903pgc.129.2023.10.31.02.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 02:22:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=B8h1ZqJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 68FE2803E5B6; Tue, 31 Oct 2023 02:22:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343851AbjJaJVy (ORCPT + 99 others); Tue, 31 Oct 2023 05:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343834AbjJaJVw (ORCPT ); Tue, 31 Oct 2023 05:21:52 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FD9CDA; Tue, 31 Oct 2023 02:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698744110; x=1730280110; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y4GdVfvr4r3TS2jPrXzPuftPnG1qKJX1nHclPM7uF4Y=; b=B8h1ZqJ5LJ0kXzUMbyieDxzE9uMPKbngWyyUyqaj7szBaKtFugZH9mWO GemQSRSQ+SeK+sIunqhrZdDfZboNE+D8NWuY1cMzyFu0AWA3P++XJ3Vem 53rVh1A8d0fo57ASxEFGTg8G/+5X6MRfH+jWsQr9TsdiFuu7EznvyuSUb IyWwjruBB615rYVFCWqk+DIXDrayEqYIT3K1GJJOMrlSVfDQ3fh/MHgXZ loOY7HHRT3qZCAFeFd7ZKSHqjY/aTqd3u/QaUH9Aea67ZtA7NZ2J1aDkU MG78U9iNpoHej9IT3hzbuHdu2qOWO+0zY7YeGj+H6fHQAJGps3+q7wpTm g==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="385435956" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="385435956" 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:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="877445519" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="877445519" Received: from dmi-pnp-i7.sh.intel.com ([10.239.159.155]) by fmsmga002.fm.intel.com with ESMTP; 31 Oct 2023 02:21:47 -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 1/5] x86: pmu: Remove duplicate code in pmu_init() Date: Tue, 31 Oct 2023 17:29:17 +0800 Message-Id: <20231031092921.2885109-2-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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 31 Oct 2023 02:22:06 -0700 (PDT) From: Xiong Zhang There are totally same code in pmu_init() helper, remove the duplicate code. Signed-off-by: Xiong Zhang Signed-off-by: Dapeng Mi --- lib/x86/pmu.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/x86/pmu.c b/lib/x86/pmu.c index 0f2afd650bc9..d06e94553024 100644 --- a/lib/x86/pmu.c +++ b/lib/x86/pmu.c @@ -16,11 +16,6 @@ void pmu_init(void) pmu.fixed_counter_width = (cpuid_10.d >> 5) & 0xff; } - if (pmu.version > 1) { - pmu.nr_fixed_counters = cpuid_10.d & 0x1f; - pmu.fixed_counter_width = (cpuid_10.d >> 5) & 0xff; - } - pmu.nr_gp_counters = (cpuid_10.a >> 8) & 0xff; pmu.gp_counter_width = (cpuid_10.a >> 16) & 0xff; pmu.gp_counter_mask_length = (cpuid_10.a >> 24) & 0xff; -- 2.34.1