0290-x86-microcode-Extend-post-microcode-reload-to-suppor.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Tom Lendacky <[email protected]>
  3. Date: Wed, 20 Dec 2017 10:55:47 +0000
  4. Subject: [PATCH] x86/microcode: Extend post microcode reload to support IBPB
  5. feature
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. CVE-2017-5753
  10. CVE-2017-5715
  11. Add an IBPB feature check to the speculative control update check after
  12. a microcode reload.
  13. Signed-off-by: Tom Lendacky <[email protected]>
  14. Signed-off-by: Andy Whitcroft <[email protected]>
  15. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  16. (cherry picked from commit 099878acd3738271fb2ade01f4649b1ed2fb72d5)
  17. Signed-off-by: Fabian Grünbichler <[email protected]>
  18. ---
  19. arch/x86/kernel/cpu/microcode/core.c | 7 +++++++
  20. 1 file changed, 7 insertions(+)
  21. diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
  22. index 55086921d29e..638c08350d65 100644
  23. --- a/arch/x86/kernel/cpu/microcode/core.c
  24. +++ b/arch/x86/kernel/cpu/microcode/core.c
  25. @@ -546,6 +546,13 @@ static ssize_t reload_store(struct device *dev,
  26. if (ibpb_inuse)
  27. sysctl_ibpb_enabled = 1;
  28. mutex_unlock(&spec_ctrl_mutex);
  29. + } else if (boot_cpu_has(X86_FEATURE_IBPB)) {
  30. + printk_once(KERN_INFO "FEATURE IBPB Present\n");
  31. + mutex_lock(&spec_ctrl_mutex);
  32. + set_ibpb_supported();
  33. + if (ibpb_inuse)
  34. + sysctl_ibpb_enabled = 1;
  35. + mutex_unlock(&spec_ctrl_mutex);
  36. }
  37. mutex_unlock(&microcode_mutex);
  38. --
  39. 2.14.2