Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp564283yba; Wed, 3 Apr 2019 14:32:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGE7oiRS2Ti+CDt0cYO0SGVBXx0juBNfRntQui0AlZkytNDUPlQR4aX+4zGNNA99MBKeEn X-Received: by 2002:a17:902:8a8a:: with SMTP id p10mr2427335plo.8.1554327145598; Wed, 03 Apr 2019 14:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554327145; cv=none; d=google.com; s=arc-20160816; b=qmsbL0tZdf3mvDdyndV9ejSpwt+W3xAy1ygzouYDLseuRuyptOez9jXZzynf34YwRb usNtJs8QGSKnlScmpX1C8sJXgDuVSGnS/ww1Vjg/RvXXjYIzNAFbWmbq562rRs1cplUR 2FdaoXXTjagVxkVcBLYzAnxfyTfql+0GuMWcz6ry2dVHBBfbFLrqHyBVxQvd3ucqv0wB wXscip4H39WmSBT700EXPlUHVf+v79WXLG3o5TNlVs9cHpDPal8kBHDhnIUO2E7vgsrL +dVUz3+RWc/MA0N8AYIXM/8wYQSTVufJ3tRPxfCnD44gr5B4jtRbdiZua6nEpXM5AYlz De1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=DDmyM8BYwx2VMXVboPpocDzLNmkUBsSuNGwDiAwgtRA=; b=YMpqkPKfuBCzFXDLhBKIM2e7CKxeo36oQknMwlTAaobqcZIzq7Smi4uOqrBC0VhG0L 1ileRrzu8uFdFsUUixwtoABNxxnPr+yXF7vZjuahuWkamnBnT2ogjfOouYxOI1T49SWN 7GAKgZbfWhdYibzXncI5lQ8po0mlxntllIOu+uEOE2xVMg1+BBfZ68WLfDHjCO+krwso aNixdqTi9tKPU2hxE3MR6DZnsB3QDm0YEziTkWeoo8YGK0af1BAwA9K35pes3luCRfcr fkDnMMpfgvy1GB60grc0bNzhZlURtIVkwI6oHiiAGw3K3XVDiamDDUEG/7hMtZHGuY8S s2Cw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d14si14988798pgb.26.2019.04.03.14.32.10; Wed, 03 Apr 2019 14:32:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728359AbfDCVbG (ORCPT + 99 others); Wed, 3 Apr 2019 17:31:06 -0400 Received: from mga05.intel.com ([192.55.52.43]:37312 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726772AbfDCVaV (ORCPT ); Wed, 3 Apr 2019 17:30:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2019 14:30:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,306,1549958400"; d="scan'208";a="334754243" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by fmsmga005.fm.intel.com with ESMTP; 03 Apr 2019 14:30:11 -0700 From: Fenghua Yu To: "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "H Peter Anvin" , "Dave Hansen" , "Paolo Bonzini" , "Ashok Raj" , "Peter Zijlstra" , "Kalle Valo" , "Xiaoyao Li " , "Michael Chan" , "Ravi V Shankar" Cc: "linux-kernel" , "x86" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kvm@vger.kernel.org, Fenghua Yu Subject: [PATCH v6 08/20] x86/split_lock: Enumerate split lock detection on Icelake mobile processor Date: Wed, 3 Apr 2019 14:21:54 -0700 Message-Id: <1554326526-172295-9-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1554326526-172295-1-git-send-email-fenghua.yu@intel.com> References: <1554326526-172295-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Icelake mobile processor can detect split lock operations although the processor doesn't have MSR_IA32_CORE_CAPABILITY and split lock detection bit in the MSR. Set split lock detection feature bit X86_FEATURE_SPLIT_LOCK_DETECT on the processor based on its family/model/stepping. A few other processors may also have the feature but don't have MSR_IA32_CORE_CAPABILITY. The feature will be enumerated on those processors once their family/model/stepping information is released. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/intel.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index ad3f72d106fc..7f6943af35dc 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -1038,8 +1038,18 @@ void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c) { u64 ia32_core_cap = 0; - if (!cpu_has(c, X86_FEATURE_CORE_CAPABILITY)) + if (!cpu_has(c, X86_FEATURE_CORE_CAPABILITY)) { + /* + * The following processors have split lock detection feature. + * But since they don't have MSR_IA32_CORE_CAPABILITY, the + * feature cannot be enumerated by the MSR. So enumerate the + * feature by family/model/stepping. + */ + if (c->x86 == 6 && c->x86_model == INTEL_FAM6_ICELAKE_MOBILE) + set_split_lock_detect(); + return; + } /* * If MSR_IA32_CORE_CAPABILITY exists, enumerate features that are -- 2.19.1