1. 17 11月, 2020 1 次提交
    • C
      x86/microcode/intel: Check patch signature before saving microcode for early loading · 1a371e67
      Chen Yu 提交于
      Currently, scan_microcode() leverages microcode_matches() to check
      if the microcode matches the CPU by comparing the family and model.
      However, the processor stepping and flags of the microcode signature
      should also be considered when saving a microcode patch for early
      update.
      
      Use find_matching_signature() in scan_microcode() and get rid of the
      now-unused microcode_matches() which is a good cleanup in itself.
      
      Complete the verification of the patch being saved for early loading in
      save_microcode_patch() directly. This needs to be done there too because
      save_mc_for_early() will call save_microcode_patch() too.
      
      The second reason why this needs to be done is because the loader still
      tries to support, at least hypothetically, mixed-steppings systems and
      thus adds all patches to the cache that belong to the same CPU model
      albeit with different steppings.
      
      For example:
      
        microcode: CPU: sig=0x906ec, pf=0x2, rev=0xd6
        microcode: mc_saved[0]: sig=0x906e9, pf=0x2a, rev=0xd6, total size=0x19400, date = 2020-04-23
        microcode: mc_saved[1]: sig=0x906ea, pf=0x22, rev=0xd6, total size=0x19000, date = 2020-04-27
        microcode: mc_saved[2]: sig=0x906eb, pf=0x2, rev=0xd6, total size=0x19400, date = 2020-04-23
        microcode: mc_saved[3]: sig=0x906ec, pf=0x22, rev=0xd6, total size=0x19000, date = 2020-04-27
        microcode: mc_saved[4]: sig=0x906ed, pf=0x22, rev=0xd6, total size=0x19400, date = 2020-04-23
      
      The patch which is being saved for early loading, however, can only be
      the one which fits the CPU this runs on so do the signature verification
      before saving.
      
       [ bp: Do signature verification in save_microcode_patch()
             and rewrite commit message. ]
      
      Fixes: ec400dde ("x86/microcode_intel_early.c: Early update ucode on Intel's CPU")
      Signed-off-by: NChen Yu <yu.c.chen@intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: stable@vger.kernel.org
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=208535
      Link: https://lkml.kernel.org/r/20201113015923.13960-1-yu.c.chen@intel.com
      1a371e67
  2. 01 10月, 2019 1 次提交
  3. 31 5月, 2019 1 次提交
  4. 11 4月, 2019 1 次提交
  5. 02 9月, 2018 2 次提交
  6. 22 6月, 2018 1 次提交
  7. 24 4月, 2018 1 次提交
  8. 17 3月, 2018 1 次提交
  9. 08 3月, 2018 3 次提交
  10. 17 2月, 2018 1 次提交
  11. 15 2月, 2018 2 次提交
  12. 24 1月, 2018 1 次提交
  13. 06 1月, 2018 1 次提交
  14. 23 12月, 2017 1 次提交
    • P
      x86/microcode: Dont abuse the TLB-flush interface · 23cb7d46
      Peter Zijlstra 提交于
      Commit:
      
        ec400dde ("x86/microcode_intel_early.c: Early update ucode on Intel's CPU")
      
      ... grubbed into tlbflush internals without coherent explanation.
      
      Since it says its a precaution and the SDM doesn't mention anything like
      this, take it out back.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Laight <David.Laight@aculab.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Eduardo Valentin <eduval@amazon.com>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: aliguori@amazon.com
      Cc: daniel.gruss@iaik.tugraz.at
      Cc: fenghua.yu@intel.com
      Cc: hughd@google.com
      Cc: keescook@google.com
      Cc: linux-mm@kvack.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      23cb7d46
  15. 18 10月, 2017 1 次提交
  16. 29 8月, 2017 1 次提交
  17. 26 6月, 2017 1 次提交
  18. 20 6月, 2017 1 次提交
  19. 08 6月, 2017 1 次提交
  20. 13 5月, 2017 1 次提交
  21. 23 1月, 2017 1 次提交
  22. 10 1月, 2017 4 次提交
  23. 19 12月, 2016 1 次提交
  24. 25 10月, 2016 3 次提交
    • B
      x86/microcode: Rework microcode loading · 06b8534c
      Borislav Petkov 提交于
      Yeah, I know, I know, this is a huuge patch and reviewing it is hard.
      
      Sorry but this is the only way I could think of in which I can rewrite
      the microcode patches loading procedure without breaking (knowingly) the
      driver.
      
      So maybe this patch is easier to review if one looks at the files after
      the patch has been applied instead at the diff. Because then it becomes
      pretty obvious:
      
      * The BSP-loading path - load_ucode_bsp() is working independently from
        the AP path now and it doesn't save any pointers or patches anymore -
        it solely parses the builtin or initrd microcode and applies the patch.
        That's it.
      
      This fixes the CONFIG_RANDOMIZE_MEMORY offset fun more solidly.
      
      * The AP-loading path - load_ucode_ap() then goes and scans
        builtin/initrd *again* for the microcode patches but it caches them this
        time so that we don't have to do that scan on each AP but only once.
      
      This simplifies the code considerably.
      
      Then, when we save the microcode from the initrd/builtin, we go and
      add the relevant patches to our own cache. The AMD side did do that
      and now the Intel side does it too. So no more pointer copying and
      blabla, we save the microcode patches ourselves and are independent from
      initrd/builtin.
      
      This whole conversion gives us other benefits like unifying the
      initrd parsing into a single function: find_microcode_in_initrd() is
      used by both.
      
      The diffstat speaks for itself: 456 insertions(+), 695 deletions(-)
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20161025095522.11964-12-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      06b8534c
    • B
      x86/microcode/intel: Remove intel_lib.c · 8027923a
      Borislav Petkov 提交于
      Its functions are used in intel.c only now, so get rid of it. Make
      functions static.
      
      No functionality change.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20161025095522.11964-11-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      8027923a
    • B
      x86/microcode/intel: Simplify generic_load_microcode() · f61337d9
      Borislav Petkov 提交于
      Make it return the ucode_state directly instead of assigning to a state
      variable and jumping to an out: label.
      
      No functionality change.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20161025095522.11964-4-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      f61337d9
  25. 27 7月, 2016 2 次提交
  26. 14 6月, 2016 1 次提交
    • A
      x86/microcode/intel: Do not issue microcode updates messages on each CPU · 354542d0
      Andi Kleen 提交于
      On large systems the microcode driver is very noisy, because it prints a
      line for each CPU. The lines are redundant because usually all CPUs are
      updated to the same microcode revision.
      
      All other subsystems have been patched previously to not print a line
      for each CPU. Only the microcode driver is left.
      
      Only print an microcode revision update when something changed. This
      results in typically only a single line being printed.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: elliott@hpe.com
      Cc: hmh@hmh.eng.br
      Link: http://lkml.kernel.org/r/20160609134141.5981-1-andi@firstfloor.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      354542d0
  27. 08 6月, 2016 4 次提交