Message ID | 20240103031409.2504051-2-dapeng1.mi@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-15116-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp4805906dyb; Tue, 2 Jan 2024 19:10:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxAre3gAEIJ7+xgmTm+IbSnmHsc+Oki0anhaGAZOYdYPYMjTz/R82kNjjVvgb7ylyvCBts X-Received: by 2002:a05:620a:8425:b0:781:7289:1410 with SMTP id pc37-20020a05620a842500b0078172891410mr10658839qkn.16.1704251420230; Tue, 02 Jan 2024 19:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704251420; cv=none; d=google.com; s=arc-20160816; b=LTbgHgsHKiv1d8BybSxUF6SZRca2b6j3h8EpGX0L8trqvHrC+K6Z9OFv1SBhAbVHi1 cYV0Aqj+amUPpywGdsLlH/DoXpi8sHR3N9ZEQvfcszh7cf8JuHvFfUwuIquXIf2T1BNa dL+3FXOfAlaXIoLwlR0bzeKxS7MHMA1njYZbK7phZQ7Wmo3qVegTE4SOIoMiBorXgryE MG/KtE9k+OFoeKw09zSY1S7lFH3B2IwMcBZM/cGbSkm2hU/qAcAlifgVQyp9MFPU2U7V FHfZhx/OEakW4jd1AQPvRYJKY3WDxb5JrWX3cNM4m6iasc3szlFCBMRIG8buJ5k4xlfu b4CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=B+0MshwLV/DpfjNdkFno6rBuEKezzJjEruxroCSkB6w=; fh=YsfTl7qN5yLiZ/GhYjuBdDgWBv8FNcMbD5266uBeHkY=; b=ur4azqGSKVjQAqSil1whnEXU1qqLN8dkh3g58y2rZX5xulitRlx78KUvJJ1l0tHw3e eCrFiQrLfPXR3JweuKP+koXNhnNUD8I5YumtJqP8AxnViSuW5SKV4NL6KpRm8Qo+65ZA zEQ4b/7AdVxvbgh9c2UOk1g1LJT9gWVGFe7Bx+yyWUMpdzgkSkVOKqfIgrp+ael3zwDg CNvz5P9aVKSdx6uSVNY1ePtJyfoooLL21D268Uk4jZm1eLhQRpwB8Ol4GJn4eqWmyQZ8 5/NE3EzKOkgvCnV9q1gBrrmt18uV+9Smlkm/LX2DKqxnww15mg0uAk0WiWmGjatB3AT7 CwKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V0IGfVSw; spf=pass (google.com: domain of linux-kernel+bounces-15116-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15116-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t5-20020ac85885000000b004281f2d2b96si5770162qta.202.2024.01.02.19.10.20 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 19:10:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15116-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V0IGfVSw; spf=pass (google.com: domain of linux-kernel+bounces-15116-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15116-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0B2EE1C2149E for <ouuuleilei@gmail.com>; Wed, 3 Jan 2024 03:10:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 142771805D; Wed, 3 Jan 2024 03:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="V0IGfVSw" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DE72179AA; Wed, 3 Jan 2024 03:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704251375; x=1735787375; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y4GdVfvr4r3TS2jPrXzPuftPnG1qKJX1nHclPM7uF4Y=; b=V0IGfVSwEe3nvtV02yFbK6g1F/UmV/sfTNBRDFisJc2SHdyGm90IpD5J eBwErT38LEpuUiH53lS5w+tDNTSvF/gPyfVEyf7MhMxm90DmfreZ/lEUK mUKkxeCk7bVsvr2DRyIZAkFCCFGuE5Sjonnq7qBp2Ab8hk0dGNHQQlekm tKKYtHVodc1WW/dyww+ZbkVmYE8cQQC22s9q9NAK1mcvyBuKpmt+/S/FY 5jKfZMqRbKZxT/frqRt/EHaTdxyK3Zh2OnYqOfxK9zgJivPys3nEMGQuJ 09xhev3Zx2+qbkskzeVsqumRjjbfydgHWPpbNY9138+6pip3dM5fai9PN w==; X-IronPort-AV: E=McAfee;i="6600,9927,10941"; a="10343118" X-IronPort-AV: E=Sophos;i="6.04,326,1695711600"; d="scan'208";a="10343118" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jan 2024 19:09:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10941"; a="729665910" X-IronPort-AV: E=Sophos;i="6.04,326,1695711600"; d="scan'208";a="729665910" Received: from dmi-pnp-i7.sh.intel.com ([10.239.159.155]) by orsmga003.jf.intel.com with ESMTP; 02 Jan 2024 19:09:30 -0800 From: Dapeng Mi <dapeng1.mi@linux.intel.com> To: Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com>, Jim Mattson <jmattson@google.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhenyu Wang <zhenyuw@linux.intel.com>, Zhang Xiong <xiong.y.zhang@intel.com>, Mingwei Zhang <mizhang@google.com>, Like Xu <like.xu.linux@gmail.com>, Jinrong Liang <cloudliang@tencent.com>, Dapeng Mi <dapeng1.mi@intel.com>, Dapeng Mi <dapeng1.mi@linux.intel.com> Subject: [kvm-unit-tests Patch v3 01/11] x86: pmu: Remove duplicate code in pmu_init() Date: Wed, 3 Jan 2024 11:13:59 +0800 Message-Id: <20240103031409.2504051-2-dapeng1.mi@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240103031409.2504051-1-dapeng1.mi@linux.intel.com> References: <20240103031409.2504051-1-dapeng1.mi@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787037137231845618 X-GMAIL-MSGID: 1787037137231845618 |
Series |
pmu test bugs fix and improvements
|
|
Commit Message
Mi, Dapeng
Jan. 3, 2024, 3:13 a.m. UTC
From: Xiong Zhang <xiong.y.zhang@intel.com> There are totally same code in pmu_init() helper, remove the duplicate code. Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com> --- 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;