From nobody Fri Dec 19 20:35:49 2025 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 4BD97C433EF for ; Wed, 16 Feb 2022 10:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232892AbiBPK1M (ORCPT ); Wed, 16 Feb 2022 05:27:12 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232844AbiBPK1D (ORCPT ); Wed, 16 Feb 2022 05:27:03 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27909206995; Wed, 16 Feb 2022 02:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645007212; x=1676543212; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ua7eKMjMgbuMUSWoTvt/pD+pRNzX252qQBMst8H9K0Q=; b=hobkwhKTofj16e8qfnLlf3GJudJUOVEfMqdky7qUwF+1lMXHeSEtw+P8 KJmU+/fM+mq8qhU53b3VxtwxxPrXCf5b0ycUyzX3xaDfrmN++DFc2UAqS kPkJcbipHmty2CTCr/7+gRYccZxdm2jEx76uTPucREMQu2qHvEHQgi/+p Nf4LTgV9URpLmuY0LcPkkJnNzScrr6kxHPdano1GDTAPP4hDkCm03s0w2 Ak4hh6Pq1F1kZHex7KONUKg+EskNBvl+uDlabO+h52d8GTEFSG3IZ+NMh M1h/KZanzgZwZk3nNP9GZw8RDTKokN/RL5hD8NO7IugGaz2VfU0hW2XTZ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="250312473" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="250312473" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 02:26:51 -0800 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="498708584" Received: from embargo.jf.intel.com ([10.165.9.183]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 02:26:50 -0800 From: Yang Weijiang To: pbonzini@redhat.com, jmattson@google.com, seanjc@google.com, like.xu.linux@gmail.com, vkuznets@redhat.com, wei.w.wang@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Like Xu , Peter Zijlstra , Kan Liang , Andi Kleen , Yang Weijiang Subject: [PATCH v9 05/17] perf/x86/lbr: Simplify the exposure check for the LBR_INFO registers Date: Tue, 15 Feb 2022 16:25:32 -0500 Message-Id: <20220215212544.51666-6-weijiang.yang@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220215212544.51666-1-weijiang.yang@intel.com> References: <20220215212544.51666-1-weijiang.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Like Xu The x86_pmu.lbr_info is 0 unless explicitly initialized, so there's no point checking x86_pmu.intel_cap.lbr_format. Cc: Peter Zijlstra Reviewed-by: Kan Liang Reviewed-by: Andi Kleen Signed-off-by: Like Xu Signed-off-by: Yang Weijiang --- arch/x86/events/intel/lbr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index 669c2be14784..4ab358ca7290 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -1874,12 +1874,10 @@ void __init intel_pmu_arch_lbr_init(void) */ int x86_perf_get_lbr(struct x86_pmu_lbr *lbr) { - int lbr_fmt =3D x86_pmu.intel_cap.lbr_format; - lbr->nr =3D x86_pmu.lbr_nr; lbr->from =3D x86_pmu.lbr_from; lbr->to =3D x86_pmu.lbr_to; - lbr->info =3D (lbr_fmt =3D=3D LBR_FORMAT_INFO) ? x86_pmu.lbr_info : 0; + lbr->info =3D x86_pmu.lbr_info; =20 return 0; } --=20 2.27.0