From patchwork Fri Sep 1 07:40:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Xiong Y" X-Patchwork-Id: 13372161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 463C4CA0FE1 for ; Fri, 1 Sep 2023 07:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236598AbjIAHlf (ORCPT ); Fri, 1 Sep 2023 03:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235352AbjIAHlc (ORCPT ); Fri, 1 Sep 2023 03:41:32 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67BBF1704 for ; Fri, 1 Sep 2023 00:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693554079; x=1725090079; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mJ+VCLzexJ/2B2CEmWr7sq64bxbH0rgU5WEt7AUTy3Q=; b=niWu+eFRm9SDhPWRSram/sGSoiXUd8gGdw9Sl/TlW/wTXjEJMRPyGv1X AQJ/hl1hsuspYcmJkptHr0p+tGD5/pLv/3MJqLItfx9NAx4tedKU6qzvZ Xm9A8/V5tU40qdPQySJOb8shO+nL/O/aIVF0ecXh0n1UNLnlfTBBxkS2C Zr/VFNbLIk6RMwHdUk9V3ZhNP+sn/wMN5T+en6M/QKx3L5RWH0MB7c+Vn COm0FOOc/YsJYGfXWpL7/peAnbeDkYBLxzKzvexDbWcFx7XU8792ERNkD 0gHNubE4Zrnjqgq35giA1OvAl06EfvTcB/YQqQ27/wloEUk/bJQiheysX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="378886133" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="378886133" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 00:41:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10819"; a="733448052" X-IronPort-AV: E=Sophos;i="6.02,219,1688454000"; d="scan'208";a="733448052" Received: from wangdere-mobl2.ccr.corp.intel.com (HELO xiongzha-desk1.ccr.corp.intel.com) ([10.255.29.239]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2023 00:41:16 -0700 From: Xiong Zhang To: kvm@vger.kernel.org Cc: seanjc@google.com, like.xu.linux@gmail.com, zhiyuan.lv@intel.com, zhenyu.z.wang@intel.com, kan.liang@intel.com, dapeng1.mi@linux.intel.com, Xiong Zhang Subject: [kvm-unit-tests 1/6] x86: pmu: remove duplicate code Date: Fri, 1 Sep 2023 15:40:47 +0800 Message-Id: <20230901074052.640296-2-xiong.y.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230901074052.640296-1-xiong.y.zhang@intel.com> References: <20230901074052.640296-1-xiong.y.zhang@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Xiong Zhang --- lib/x86/pmu.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/x86/pmu.c b/lib/x86/pmu.c index 0f2afd6..d06e945 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;