From patchwork Tue Oct 24 07:57:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mi, Dapeng" X-Patchwork-Id: 157267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1780338vqx; Tue, 24 Oct 2023 00:51:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsWfiTGlYfAIiTWguyL5/5TjeFijjfIrYzEWvmmKmeQpMQhlprwRzm99ry/QwCYQXaSiAO X-Received: by 2002:a17:90a:c70c:b0:267:f9c4:c0a8 with SMTP id o12-20020a17090ac70c00b00267f9c4c0a8mr8527387pjt.4.1698133899355; Tue, 24 Oct 2023 00:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698133899; cv=none; d=google.com; s=arc-20160816; b=JW0cux/T6GrxtHyfhtUWGFE2ocNU9YF/vmx/WTQJxVaIogs9blMBQRJma2/QOFR3c4 lY/Ve35JSX5xzCPooAbXEPGaYLB2h9wg2mcXfUJMlZFI+kaBnTAosE61+cgD14JCLwTm YXgGKr4GKMQdnUxZjx3ifK/RoNmOLQq7iO6+zJwHyGHvsmHjpKXfkDRY8j5hxyXlG99z xm8G+9O9TT1nsQgVHIl61J/vqfOPXq9JaLQ2A9WytzRD9CsKM8gHzkGJNY/LzwgUrNgK xLTyXe1IGvAilouCXbRuAOdW17/ADEb3s5Z2PC1uVqNsIA9/YJ2vuVupclFSMmWjOSbG FmgQ== 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=TYnYj8oLVQWVejMFovvJzEi9pKvEtCfU220LSRIAuJs/STU+FfvUQeJ5WQX9aTecV2 Bpl2xGm8mJ2dcIx0Dl5wbwncDT6jYpi5GeWI+40w3PwAtIeV7R9KbrjPdGTAZdDw77hj M9gEw6zPph+0oimJ1/kQ6APrjz8BpbkNkXvMIRDAqZKUZctTtVoBgEBNch4l/OoXAzhe xFKV2n5WDbnIJDdtPpx3fMqXq/m6hJjGfCcRlW3XZp51me2eJhV5Sy7czWqAZ9OLH+5r M9tVsD3ps5xgwnVhgJCqmDFeV4hEFy0RsJJN4KgDt+PE8tQMbidC0roRLrROntoqZ78Y rfXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C+a8I5hz; 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 r61-20020a17090a43c300b0027782fd462esi10678522pjg.5.2023.10.24.00.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 00:51:39 -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=C+a8I5hz; 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 234FA808A91B; Tue, 24 Oct 2023 00:51: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 S233773AbjJXHvB (ORCPT + 26 others); Tue, 24 Oct 2023 03:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233760AbjJXHu6 (ORCPT ); Tue, 24 Oct 2023 03:50:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA350118; Tue, 24 Oct 2023 00:50: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=1698133855; x=1729669855; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y4GdVfvr4r3TS2jPrXzPuftPnG1qKJX1nHclPM7uF4Y=; b=C+a8I5hz/snaRZa6cNTUVVPd8RqNlA21RTBnyZ4r5JoxGk6D9FQ+H1pC 9QBV1KzH99JJlG4Gvv3JDr4dluluyBiBrX3+P6aP1zEIQBFKEYRj1bDiW 78HQMluccYeEuXdDtvObNp4oFyMIr2VGnUAUtbubNRs1KWgoMiBebB3VO p3JPhSCg7WgTTygVF8ibt+4DUNLIvqCDJxS9v+MGLF+7FhTOnTUPHGGNz Sp6pea13iKpaDMWQ+xjt34PQWot6sMh2CWmiWD3mLZoVpqArCDgjyS7KJ QE+PDxHUpetyeEcYOpBv53mZlv+16OErFU6eX8gvLcqpZlLxpa1Gqu1wI w==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="367235184" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="367235184" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 00:50:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="1089766233" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="1089766233" Received: from dmi-pnp-i7.sh.intel.com ([10.239.159.155]) by fmsmga005.fm.intel.com with ESMTP; 24 Oct 2023 00:50:52 -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 1/5] x86: pmu: Remove duplicate code in pmu_init() Date: Tue, 24 Oct 2023 15:57:44 +0800 Message-Id: <20231024075748.1675382-2-dapeng1.mi@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231024075748.1675382-1-dapeng1.mi@linux.intel.com> References: <20231024075748.1675382-1-dapeng1.mi@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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, 24 Oct 2023 00:51:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780622451569910051 X-GMAIL-MSGID: 1780622451569910051 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;