From aea080f1933268594716c3d2bccace56c166b79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Sat, 6 Dec 2014 14:18:18 +0000 Subject: [PATCH] Use correct microcode resume fix --- PKGBUILD | 11 ++----- fix_CPU0_microcode_on_resume.patch | 47 +++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 67bc662..83cec25 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ pkgbase=linux # Build stock -ARCH kernel #pkgbase=linux-custom # Build kernel with a different name _srcname=linux-3.17 pkgver=3.17.4 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64') url="http://www.kernel.org/" license=('GPL2') @@ -26,7 +26,7 @@ sha256sums=('f5153ec93c5fcd41b247950e6a9bcbc63fa87beafd112c133a622439a0f76251' '66fc95823d3c99167532f37c07e9582d305961103997fcc61cfc7f6a86b34130' 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99' - '43668fe46147fe93f41b919db673574427ce5a8c376cd28ddddcbf3a00326491') + '4eb64c2520e9bcdff47d757946011b4bf9896186d285361f18364c7ff9b2c699') _kernelname=${pkgbase#linux} @@ -296,10 +296,3 @@ for _p in ${pkgname[@]}; do done # vim:set ts=8 sts=2 sw=2 et: -sha256sums=('f5153ec93c5fcd41b247950e6a9bcbc63fa87beafd112c133a622439a0f76251' - 'eeef37397a15245bd143569908be40622a87dc7673965e623e811ea3f68b8434' - 'ea9de72fe335055f6e8eebd1d85cad150a47a81004bb27d78f18f2591fd3bbd5' - '66fc95823d3c99167532f37c07e9582d305961103997fcc61cfc7f6a86b34130' - 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' - '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99' - '43668fe46147fe93f41b919db673574427ce5a8c376cd28ddddcbf3a00326491') diff --git a/fix_CPU0_microcode_on_resume.patch b/fix_CPU0_microcode_on_resume.patch index 56f8094..1f10c3a 100644 --- a/fix_CPU0_microcode_on_resume.patch +++ b/fix_CPU0_microcode_on_resume.patch @@ -1,21 +1,46 @@ +From fb86b97300d930b57471068720c52bfa8622eab7 Mon Sep 17 00:00:00 2001 +From: Borislav Petkov +Date: Tue, 18 Nov 2014 10:46:57 +0100 +Subject: [PATCH] x86, microcode: Update BSPs microcode on resume + +In the situation when we apply early microcode but do *not* apply late +microcode, we fail to update the BSP's microcode on resume because we +haven't initialized the uci->mc microcode pointer. So, in order to +alleviate that, we go and dig out the stashed microcode patch during +early boot. It is basically the same thing that is done on the APs early +during boot so do that too here. + +Tested-by: alex.schnaidt@gmail.com +Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=88001 +Cc: Henrique de Moraes Holschuh +Cc: Fenghua Yu +Cc: # v3.9 +Signed-off-by: Borislav Petkov +Link: http://lkml.kernel.org/r/20141118094657.GA6635@pd.tnic +Signed-off-by: Thomas Gleixner +--- + arch/x86/kernel/cpu/microcode/core.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c -index dd9d6190b08d..181e42bd85d3 100644 +index dd9d619..2ce9051 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c -@@ -85,6 +85,7 @@ - #include - - #include -+#include - #include - #include - #include -@@ -465,6 +466,8 @@ static void mc_bp_resume(void) +@@ -465,6 +465,14 @@ static void mc_bp_resume(void) if (uci->valid && uci->mc) microcode_ops->apply_microcode(cpu); + else if (!uci->mc) -+ load_ucode_intel_ap(); ++ /* ++ * We might resume and not have applied late microcode but still ++ * have a newer patch stashed from the early loader. We don't ++ * have it in uci->mc so we have to load it the same way we're ++ * applying patches early on the APs. ++ */ ++ load_ucode_ap(); } static struct syscore_ops mc_syscore_ops = { +-- +2.1.3 +