Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753814AbeAFCdf (ORCPT + 1 other); Fri, 5 Jan 2018 21:33:35 -0500 Received: from mga03.intel.com ([134.134.136.65]:10718 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753686AbeAFCdI (ORCPT ); Fri, 5 Jan 2018 21:33:08 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,320,1511856000"; d="scan'208";a="190375403" From: Tim Chen To: Thomas Gleixner , Andy Lutomirski , Linus Torvalds , Greg KH Cc: Tim Chen , Dave Hansen , Andrea Arcangeli , Andi Kleen , Arjan Van De Ven , David Woodhouse , linux-kernel@vger.kernel.org Subject: [PATCH v2 7/8] x86: Do not use dynamic IBRS if retpoline is enabled Date: Fri, 5 Jan 2018 18:12:22 -0800 Message-Id: <84de4201a7cad16a456432ad3c2d203a649721e1.1515204614.git.tim.c.chen@linux.intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Don't use dynamic IBRS that toggle IBRS on entry/exit to kernel code if retpoline is used. Signed-off-by: Tim Chen --- arch/x86/kernel/cpu/spec_ctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/spec_ctrl.c b/arch/x86/kernel/cpu/spec_ctrl.c index 28107a2..076c470 100644 --- a/arch/x86/kernel/cpu/spec_ctrl.c +++ b/arch/x86/kernel/cpu/spec_ctrl.c @@ -26,10 +26,12 @@ DEFINE_MUTEX(spec_ctrl_mutex); static inline void set_ibrs_feature(void) { +#if !defined(RETPOLINE) if (!ibrs_admin_disabled) { dynamic_ibrs = 1; ibrs_enabled = IBRS_ENABLED; } +#endif } void scan_spec_ctrl_feature(struct cpuinfo_x86 *c) -- 2.9.4