From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.15 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796104904; b=JaXjl9nVzMiPQO402L1HoiuATZzDoMQZBZQhqyzrRQwJL0ughWWd5k/h+SX6frcMOnsb jt8tnsKG13p0AgX2mVKrvrC/QryPOyLvxM9RLefBc3SQJtCdxvQY1idYeCKFGhJKjM8sd WNr3DQt94mTmtyLg4roGqNK5sdkjTBv0PMiya30jo8XiafCI8z2pm1I04Ttg/2Nl9ZVA9 XA0sIQ1TDGax1u9Glp5hMdRqr5kUPYtYzexrzhWu8UaVwzROaD0C4Z3PSwt6ymroRmZ8A ZqLklpj+t+gAwzwHxE7lwMPtRcjPn+pisqUbPL4qkIdoJ3X8kOmB/D8rC2Bot4XehiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796104904; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=nkvhMIiQVQ19D9ffOhLKpyauWwVUhuAOGTXK5D1HvLs=; b=thDAg5a4P/AJtu26NKh4yly+JINemNj4IGNAz4ptls3UH8WDFViRfSx2E9Y12JGb804K HxWxOY75SYnSqoWMVXnKgMuj/8PrEo8prvQG1RgKpZ4IpuJGV3U1ic6B6zXFfF69j8hDG aC3t3Pyhq+uCov+qTPO612CTbFjVxniioFC5xD3K7NPj8VcyUOpBL50fyv2s66zyp14Ng BFI5CLoQzeP7tlHzER7q5zdwrb1iDWT8tTT5sbgFwvLNFFEZwh7gWldagwnhEcQWP4tmV 4JqPvc3Ig4eMXvezNFSeGckhThIDCM+D5mwBEv+ZPEETh7I2Pdnhlu/IBU1Pkj/rn9Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b="f/UOQDnO"; arc=none smtp.remote-ip=198.175.65.15 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63DF4606A31A; Tue, 1 Dec 2026 06:01:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 63DF4606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=f/UOQDnO DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796104904; x=1827640904; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=nkvhMIiQVQ19D9ffOhLKpyauWwVUhuAOGTXK5D1HvLs=; b=f/UOQDnOfpoDpoly9pk70vc18T/J+k1dyfkFYd3wbqZmLuxg5/1+UJA/ uhK3PfQ/Wp7ZNmSK+WHiBVIMMGUJum+84Rs2zU0iisYUWNikxVCD0TFa5 9NgqE9yK3cG4JTieggpKrb5GX6HnMlZuwRM7gnhNUWifEvGU8MFMO0YQM eZP01w9/aRo0fETwhuXXDgWyZo6CzNHEsCHxLzDNERYW5by0htGpUNetW lInFkWjymHVl2ePoDVx7/tXoDunK6ntiDmBFk4HHYIsqG1RauCRQmkRVg 8aWJ0lRkmElPTfaMTWaD6biBPq1qDl9hEq07VGPeZnjLIqhYI/zqO+V7R A==; X-CSE-ConnectionGUID: a5VMWWqQTsWxKysa/h3Z1g== X-CSE-MsgGUID: c47nccsQSUqiOD90kud4iw== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4952605" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4952605" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 22:01:43 -0800 X-CSE-ConnectionGUID: 0frXXt0KSoKuwO6Lzrh2Gw== X-CSE-MsgGUID: RXHGfMYKTZyP5kA7dQYKjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13139846" Received: from unknown (HELO [10.238.2.182]) ([10.238.2.182]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 22:01:40 -0800 Message-ID: <90cdfc0a-3428-41b6-94f8-ac35a0e25da5@linux.intel.com> Date: Tue, 1 Dec 2026 14:01:37 +0800 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 03/18] perf/x86/intel: Track common hybrid capabilities To: Zide Chen , Sean Christopherson , Paolo Bonzini , Peter Zijlstra Cc: kvm@vger.kernel.org, Jim Mattson , Yosry Ahmed , Andi Kleen , Stephane Eranian , linux-kernel@vger.kernel.org, Mingwei Zhang , Das Sandipan , Shukla Manali , Xudong Hao References: <20261124213901.120572-1-zide.chen@intel.com> <20261124213901.120572-4-zide.chen@intel.com> Content-Language: en-US From: "Mi, Dapeng" In-Reply-To: <20261124213901.120572-4-zide.chen@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reviewed-by: Dapeng Mi On 11/25/2026 5:38 AM, Zide Chen wrote: > Now that intel_update_pmu_caps() updates intel_cap on hybrid_pmu[], > the assignment in intel_pmu_init_hybrid() is obsolete and can be > dropped. Additionally, ADL P-cores report perf_metrics correctly, so > hardcoding perf_metrics for P-cores is not required. > > Intersect capabilities across all online PMU types. This clears all > potentially inflated asymmetric features (such as rdpmc_metrics_clear) > from x86_pmu.intel_cap when the BSP is a P-core. > > For erratum RPL018, set perf_metrics in the base x86_pmu.intel_cap > on all-P-core systems to keep x86_pmu consistent and allow consumers > like KVM to detect Topdown support. > > Opportunistically fix a typo in the comment. > > Fixes: f83d2f91d259 ("perf/x86/intel: Add Alder Lake Hybrid support") > Signed-off-by: Zide Chen > Cc: Peter Zijlstra > --- > v10: new patch. > --- > arch/x86/events/intel/core.c | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c > index dbd84d82f36d..44bede63f0c6 100644 > --- a/arch/x86/events/intel/core.c > +++ b/arch/x86/events/intel/core.c > @@ -6280,11 +6280,23 @@ static void intel_update_pmu_caps(struct pmu *pmu) > > /* > * Restore perf_metrics on platforms with broken > - * perf_capablities. > + * perf_capabilities. > */ > if (intel_pmu_broken_perf_cap() && > - hybrid_pmu(pmu)->pmu_type == hybrid_big) > + hybrid_pmu(pmu)->pmu_type == hybrid_big) { > hybrid(pmu, intel_cap).perf_metrics = 1; > + if (!cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) > + x86_pmu.intel_cap.perf_metrics = 1; > + } > + > + /* > + * For hybrid, x86_pmu.intel_cap tracks common capabilities > + * across all online PMU types. A bitwise AND is safe because > + * multi-bit PEBS/LBR format fields are identical across core > + * types when supported, or zero if unsupported on a core. > + */ > + x86_pmu.intel_cap.capabilities &= > + hybrid(pmu, intel_cap).capabilities; > } > } > > @@ -7746,14 +7758,10 @@ static __always_inline int intel_pmu_init_hybrid(enum hybrid_pmu_type pmus) > __EVENT_CONSTRAINT(0, pmu->cntr_mask64, > 0, x86_pmu_num_counters(&pmu->pmu), 0, 0); > > - pmu->intel_cap.capabilities = x86_pmu.intel_cap.capabilities; > - if (pmu->pmu_type & hybrid_small_tiny) { > - pmu->intel_cap.perf_metrics = 0; > + if (pmu->pmu_type & hybrid_small_tiny) > pmu->mid_ack = true; > - } else if (pmu->pmu_type & hybrid_big) { > - pmu->intel_cap.perf_metrics = 1; > + else if (pmu->pmu_type & hybrid_big) > pmu->late_ack = true; > - } > } > > return 0;