Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1516047imm; Sun, 27 May 2018 08:50:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpWSW+dio+x2epxTDG9YBEQe2Fp/nxGH9wFSDQmRxkcLoBX76KzvQ2jn6QwB+YV2JZBj2gK X-Received: by 2002:a65:6645:: with SMTP id z5-v6mr8028576pgv.43.1527436233212; Sun, 27 May 2018 08:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527436233; cv=none; d=google.com; s=arc-20160816; b=LRld6AGMeyXhJdS5WcBfWRZvzbC+mYPVF9NKVMQTjoXYWjT5j92vu/vDjPzBTpAUXS 5uzf8rJwQjagz0XXzTUECZHSwX3WdAXW3Xr47y7Ha+8sWhSReQbnccoaFbhwpPJ9X3Ys dSu0gDls+c8VXnttj6XUrG0ytEg1jh3EWQ1kqh9nPjmWTwAQN5cdnqq07rCGMURt7c2g NX8hIKrd4O4UMlCSZos5QPORimFEQ3EOJloI1y9xegNtr4K2iWCGKGavmCkXdgVet5KA KB/43WGDFyVmcW9sSUGGZwMN0wZQl9QFG1TQdNkTdk1BpWhL8XGzTeWhPUh8wZOILOY4 tq2Q== 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:arc-authentication-results; bh=1OfVExu31C74wUwCESBLTKrRZGG6xdY9+IPa9gslUII=; b=dHCGCx73P2E1ddIemoLnD1e+SBR7qIvKQSdkdhdIP1nW28TU/YmhccYGi1FJ0XSRzB u/s0CGoWWvUgJbWvWUXeixlyEW/Lo+m+PU+SkSdeWeCZX8bAWi7veoBCQtz5qM+a26cv pqCzToq0fM19FPrao3W+owchrqVjve/hw5pt/ISSwpAHOizV0Qy6hF01Yi1NMuMB9x5d BSbA4nE2KC43+CGjYPkcUSDNyWsA7yhbaWMm6XMIZPxec8mH16oKOGa+keg8A7cm9a4D C6BJ2yc6hRwDsfhS4+6BTIWCF9j2z2YkT2ebuO3v1sysoAIAcpQvAmMjV8bDFH1gz8E+ PfJg== 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 d17-v6si26635940pll.590.2018.05.27.08.50.18; Sun, 27 May 2018 08:50:33 -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 S1032874AbeE0PtR (ORCPT + 99 others); Sun, 27 May 2018 11:49:17 -0400 Received: from mga02.intel.com ([134.134.136.20]:28381 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032791AbeE0PqT (ORCPT ); Sun, 27 May 2018 11:46:19 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2018 08:46:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,448,1520924400"; d="scan'208";a="227741092" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga005.jf.intel.com with ESMTP; 27 May 2018 08:46:14 -0700 From: Fenghua Yu To: "Thomas Gleixner" , "Ingo Molnar" , "H. Peter Anvin" Cc: "Ashok Raj" , "Dave Hansen" , "Rafael Wysocki" , "Tony Luck" , "Alan Cox" , "Ravi V Shankar" , "Arjan van de Ven" , "linux-kernel" , "x86" , Fenghua Yu Subject: [RFC PATCH 09/16] x86/split_lock: Add CONFIG to control #AC for split lock at boot time Date: Sun, 27 May 2018 08:45:58 -0700 Message-Id: <1527435965-202085-10-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1527435965-202085-1-git-send-email-fenghua.yu@intel.com> References: <1527435965-202085-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 User wants to specify how to set up #AC for split lock at boot time. CONFIG_SPLIT_LOCK_AC_ENABLE_DEFAULT is added to control split lock setting at boot time. Default value is 2: Don't explicitly enable or disable #AC for split lock. Inherit setting of #AC for split lock from firmware. Value 0 to explicitly disable split lock at boot time. Value 1 to explicitly enable split lock at boot time. Signed-off-by: Fenghua Yu --- arch/x86/Kconfig | 14 ++++++++++++++ arch/x86/kernel/cpu/test_ctl.c | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 043cde9a9b08..1d0dcd6fa69a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -461,6 +461,20 @@ config SPLIT_LOCK_AC Say N if unsure. +config SPLIT_LOCK_AC_ENABLE_DEFAULT + int "#AC for split lock enable value (0-2) at boot time" + range 0 2 + default "2" + depends on SPLIT_LOCK_AC + help + Set #AC for split lock enable default value at boot time + 0: Explicitly disable #AC for split lock at boot time. + 1: Explicitly enable #AC for split lock at boot time. + 2: Don't explicitly enable or disable #AC for split lock. + Inherit setting of #AC for split lock from firmware. + + Leave this to the default value of 2 if you are unsure. + if X86_32 config X86_BIGSMP bool "Support for big SMP systems with more than 8 CPUs" diff --git a/arch/x86/kernel/cpu/test_ctl.c b/arch/x86/kernel/cpu/test_ctl.c index 82440740b2b9..a2f84fcd4da1 100644 --- a/arch/x86/kernel/cpu/test_ctl.c +++ b/arch/x86/kernel/cpu/test_ctl.c @@ -21,6 +21,7 @@ #define DISABLE_SPLIT_LOCK_AC 0 #define ENABLE_SPLIT_LOCK_AC 1 +#define INHERIT_SPLIT_LOCK_AC_FIRMWARE 2 /* After disabling #AC for split lock in handler, re-enable it 1 msec later. */ #define reenable_split_lock_delay msecs_to_jiffies(1) @@ -71,6 +72,17 @@ void detect_split_lock_ac(void) split_lock_ac_firmware = ENABLE_SPLIT_LOCK_AC; else split_lock_ac_firmware = DISABLE_SPLIT_LOCK_AC; + + /* + * By default configuration, kernel inherits firmware split lock + * setting. Kernel can be configured to explicitly enable or disable + * #AC for split lock to override firmware setting. + */ + if (CONFIG_SPLIT_LOCK_AC_ENABLE_DEFAULT == + INHERIT_SPLIT_LOCK_AC_FIRMWARE) + split_lock_ac_kernel = split_lock_ac_firmware; + else + split_lock_ac_kernel = CONFIG_SPLIT_LOCK_AC_ENABLE_DEFAULT; } static void _setup_split_lock(int split_lock_ac_val) -- 2.5.0