Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4288594pxb; Mon, 8 Feb 2021 12:31:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/bsvmCMqkgJK1AEMh59Ubw2s0FmD5OIC1jnW+kDNCV5gEfN2iM7USysObEOMOvnRAW0r5 X-Received: by 2002:a50:ee10:: with SMTP id g16mr18978488eds.62.1612816310616; Mon, 08 Feb 2021 12:31:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612816310; cv=none; d=google.com; s=arc-20160816; b=SXPbAPlq0JiqGFZ5bIhVVRYsjlzouW9GkZ75ko7IpqvGQgWwln14hBXQzSGgQVZIpP +/AWQ1eHkhnw7A3kWWgmVHvqMwl/2JieRQpkb8kl3yNb1N2VaCKvZBur3svwuNysGFmD Q6jLNmsiHc9d64/N1HcFQ7/eEf6MTe9DtYYGRr69Gsoca/cBnIZ0jYTq3BvpCHbYlTK2 77vbV6X8hlhhYX3/RLqcmH6i41/+BW44cyP5UTsKhpeWylZeUJUp3zWRV1xAsKhWWRst QhERB0GtCpfKEatrpQP6DatEOMRuhMJRvt7tbsRrxF4rH/+UUhp4aB21VDE/59KiATdw bB7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=9VET5Yf5VC46ZoDZLbpLCU+oeN1hLzyQ7c4zyph0REw=; b=VvR64Ow+ofEJhI0u9xFzqNZv7fcvlt0LvmZddEcFdp5jirV32SfBMN0ic3dBUtVqwL Cx5XR+JBQZpLxExzrEhiJEQ+HqNTV4l/8DlgxlSw4rHKq09N4xVrg9GXYGh3fPlDJUtl 4w1oZxThQfEn4k50hqNTAImFSec8ggV+uXJ+VX9XC+UQj0bUrLVSqVbDWxeqbxwca65N Veg5+ocs4kKYXL8ECQqKpEsJwKoqIYx752V/B41H7/RFo6cBkFCsvtkqgoVX+0JhOZXS RqpkxYPihmAo+B1k1iyu8xtXwHbnRTMAdQgPJQm8HHTZwj++wMf3tNZ42BXFzjqFjkzE vDiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si3879235edy.96.2021.02.08.12.31.26; Mon, 08 Feb 2021 12:31:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235421AbhBHUav (ORCPT + 99 others); Mon, 8 Feb 2021 15:30:51 -0500 Received: from mga14.intel.com ([192.55.52.115]:18686 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236061AbhBHTLJ (ORCPT ); Mon, 8 Feb 2021 14:11:09 -0500 IronPort-SDR: PA1J/V2TjN9umTntqm0Xxcp9fk6mnnDlw+4XmRyUotg/3T33tgq91aWcavdZxwgpWKCXmzKCou AonBsatv0q6g== X-IronPort-AV: E=McAfee;i="6000,8403,9889"; a="180987078" X-IronPort-AV: E=Sophos;i="5.81,163,1610438400"; d="scan'208";a="180987078" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 11:10:20 -0800 IronPort-SDR: QFiE6hhQ7xqTdMWFzftnB/WnnPXpSOfw5ZYyI/Z7AKEUaPm8ftugDgT834NB23DeXZQZR8wN4v oYVe7pKiTvBQ== X-IronPort-AV: E=Sophos;i="5.81,163,1610438400"; d="scan'208";a="358881823" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.146]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 11:10:19 -0800 Date: Mon, 8 Feb 2021 11:10:18 -0800 From: "Luck, Tony" To: "Liang, Kan" Cc: Borislav Petkov , peterz@infradead.org, acme@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, namhyung@kernel.org, jolsa@redhat.com, ak@linux.intel.com, yao.jin@linux.intel.com, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, Ricardo Neri , Andy Lutomirski , Dave Hansen , "Rafael J. Wysocki" , "Ravi V. Shankar" , Sean Christopherson , Srinivas Pandruvada , Len Brown Subject: Re: [PATCH 02/49] x86/cpu: Describe hybrid CPUs in cpuinfo_x86 Message-ID: <20210208191018.GA86425@agluck-desk2.amr.corp.intel.com> References: <1612797946-18784-1-git-send-email-kan.liang@linux.intel.com> <1612797946-18784-3-git-send-email-kan.liang@linux.intel.com> <20210208175640.GD18227@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 02:04:24PM -0500, Liang, Kan wrote: > On 2/8/2021 12:56 PM, Borislav Petkov wrote: > > I think it's good enough for perf, but I'm not sure whether other codes need > the CPU type information. > > Ricardo, do you know? > > Maybe we should implement a generic function as below for this? > (Not test. Just use as an example.) > > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > index a66c1fd..679f5fe 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -2056,3 +2056,11 @@ void arch_smt_update(void) > /* Check whether IPI broadcasting can be enabled */ > apic_smt_update(); > } > + > +u32 x86_read_hybrid_type(void) > +{ > + if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) > + return cpuid_eax(0x0000001a); > + > + return 0; > +} Machine check logging will want to include this in "struct mce". But ok to pick it up with a function like you describe above. -Tony