Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790AbeADSSN (ORCPT + 1 other); Thu, 4 Jan 2018 13:18:13 -0500 Received: from mga06.intel.com ([134.134.136.31]:8415 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbeADSSI (ORCPT ); Thu, 4 Jan 2018 13:18: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,315,1511856000"; d="scan'208";a="21447000" 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 , linux-kernel@vger.kernel.org Subject: [PATCH 7/7] x86/microcode: Recheck IBRS features on microcode reload Date: Thu, 4 Jan 2018 09:56:48 -0800 Message-Id: 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: On new microcode write, check whether IBRS is present by rescanning scattered CPU features. Signed-off-by: Tim Chen --- arch/x86/kernel/cpu/microcode/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index c4fa4a8..44b9355 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -40,6 +40,7 @@ #include #include #include +#include #define DRIVER_VERSION "2.2" @@ -444,6 +445,11 @@ static ssize_t microcode_write(struct file *file, const char __user *buf, if (ret > 0) perf_check_microcode(); + /* check spec_ctrl capabilities */ + mutex_lock(&spec_ctrl_mutex); + init_scattered_cpuid_features(&boot_cpu_data); + mutex_unlock(&spec_ctrl_mutex); + mutex_unlock(µcode_mutex); put_online_cpus(); -- 2.9.4