Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Mar 2016 17:39:22 +0000 (10:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Mar 2016 17:39:22 +0000 (10:39 -0700)
Pull x86 microcode updates from Ingo Molnar:
 "The biggest change in this cycle was the separation of the microcode
  loading mechanism from the initrd code plus the support of built-in
  microcode images.

  There were also lots cleanups and general restructuring (by Borislav
  Petkov)"

* 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
  x86/microcode/intel: Drop orig_sum from ext signature checksum
  x86/microcode/intel: Improve microcode sanity-checking error messages
  x86/microcode/intel: Merge two consecutive if-statements
  x86/microcode/intel: Get rid of DWSIZE
  x86/microcode/intel: Change checksum variables to u32
  x86/microcode: Use kmemdup() rather than duplicating its implementation
  x86/microcode: Remove unnecessary paravirt_enabled check
  x86/microcode: Document builtin microcode loading method
  x86/microcode/AMD: Issue microcode updated message later
  x86/microcode/intel: Cleanup get_matching_model_microcode()
  x86/microcode/intel: Remove unused arg of get_matching_model_microcode()
  x86/microcode/intel: Rename mc_saved_in_initrd
  x86/microcode/intel: Use *wrmsrl variants
  x86/microcode/intel: Cleanup apply_microcode_intel()
  x86/microcode/intel: Move the BUG_ON up and turn it into WARN_ON
  x86/microcode/intel: Rename mc_intel variable to mc
  x86/microcode/intel: Rename mc_saved_count to num_saved
  x86/microcode/intel: Rename local variables of type struct mc_saved_data
  x86/microcode/AMD: Drop redundant printk prefix
  x86/microcode: Issue update message only once
  ...

1  2 
arch/x86/Kconfig
arch/x86/kernel/cpu/microcode/amd.c

diff --combined arch/x86/Kconfig
index b1051057e5b014b6a2b11b5c2cdbef866633e0c0,405b1858134b005af48526947fa24621764ce573..8f2e6659281b7b0c4567a893b73df403d83f37b3
@@@ -303,9 -303,6 +303,9 @@@ config ARCH_SUPPORTS_UPROBE
  config FIX_EARLYCON_MEM
        def_bool y
  
 +config DEBUG_RODATA
 +      def_bool y
 +
  config PGTABLE_LEVELS
        int
        default 4 if X86_64
@@@ -478,7 -475,6 +478,7 @@@ config X86_U
        depends on X86_64
        depends on X86_EXTENDED_PLATFORM
        depends on NUMA
 +      depends on EFI
        depends on X86_X2APIC
        depends on PCI
        ---help---
@@@ -781,8 -777,8 +781,8 @@@ config HPET_TIME
          HPET is the next generation timer replacing legacy 8254s.
          The HPET provides a stable time base on SMP
          systems, unlike the TSC, but it is more expensive to access,
 -        as it is off-chip.  You can find the HPET spec at
 -        <http://www.intel.com/hardwaredesign/hpetspec_1.pdf>.
 +        as it is off-chip.  The interface used is documented
 +        in the HPET spec, revision 1.
  
          You can safely choose Y here.  However, HPET will only be
          activated if the platform and the BIOS support this feature.
@@@ -1163,22 -1159,23 +1163,23 @@@ config MICROCOD
        bool "CPU microcode loading support"
        default y
        depends on CPU_SUP_AMD || CPU_SUP_INTEL
-       depends on BLK_DEV_INITRD
        select FW_LOADER
        ---help---
          If you say Y here, you will be able to update the microcode on
-         certain Intel and AMD processors. The Intel support is for the
-         IA32 family, e.g. Pentium Pro, Pentium II, Pentium III, Pentium 4,
-         Xeon etc. The AMD support is for families 0x10 and later. You will
-         obviously need the actual microcode binary data itself which is not
-         shipped with the Linux kernel.
-         This option selects the general module only, you need to select
-         at least one vendor specific module as well.
-         To compile this driver as a module, choose M here: the module
-         will be called microcode.
+         Intel and AMD processors. The Intel support is for the IA32 family,
+         e.g. Pentium Pro, Pentium II, Pentium III, Pentium 4, Xeon etc. The
+         AMD support is for families 0x10 and later. You will obviously need
+         the actual microcode binary data itself which is not shipped with
+         the Linux kernel.
+         The preferred method to load microcode from a detached initrd is described
+         in Documentation/x86/early-microcode.txt. For that you need to enable
+         CONFIG_BLK_DEV_INITRD in order for the loader to be able to scan the
+         initrd for microcode blobs.
+         In addition, you can build-in the microcode into the kernel. For that you
+         need to enable FIRMWARE_IN_KERNEL and add the vendor-supplied microcode
+         to the CONFIG_EXTRA_FIRMWARE config option.
  
  config MICROCODE_INTEL
        bool "Intel microcode loading support"
index 75d3aab5f7b243623ca311c4c23bf07ef2e26ca4,e397fc160b05470f48bf8d693988f4c06b2799ec..8581963894c791e718f67fe37b9b1b4cee3391d6
@@@ -431,10 -431,6 +431,6 @@@ int __init save_microcode_in_initrd_amd
        else
                container = cont_va;
  
-       if (ucode_new_rev)
-               pr_info("microcode: updated early to new patch_level=0x%08x\n",
-                       ucode_new_rev);
        eax   = cpuid_eax(0x00000001);
        eax   = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
  
@@@ -469,8 -465,7 +465,7 @@@ void reload_ucode_amd(void
        if (mc && rev < mc->hdr.patch_id) {
                if (!__apply_microcode_amd(mc)) {
                        ucode_new_rev = mc->hdr.patch_id;
-                       pr_info("microcode: reload patch_level=0x%08x\n",
-                               ucode_new_rev);
+                       pr_info("reload patch_level=0x%08x\n", ucode_new_rev);
                }
        }
  }
@@@ -793,15 -788,13 +788,13 @@@ static int verify_and_add_patch(u8 fami
                return -EINVAL;
        }
  
-       patch->data = kzalloc(patch_size, GFP_KERNEL);
+       patch->data = kmemdup(fw + SECTION_HDR_SIZE, patch_size, GFP_KERNEL);
        if (!patch->data) {
                pr_err("Patch data allocation failure.\n");
                kfree(patch);
                return -EINVAL;
        }
  
-       /* All looks ok, copy patch... */
-       memcpy(patch->data, fw + SECTION_HDR_SIZE, patch_size);
        INIT_LIST_HEAD(&patch->plist);
        patch->patch_id  = mc_hdr->patch_id;
        patch->equiv_cpu = proc_id;
@@@ -953,10 -946,14 +946,14 @@@ struct microcode_ops * __init init_amd_
        struct cpuinfo_x86 *c = &boot_cpu_data;
  
        if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
 -              pr_warning("AMD CPU family 0x%x not supported\n", c->x86);
 +              pr_warn("AMD CPU family 0x%x not supported\n", c->x86);
                return NULL;
        }
  
+       if (ucode_new_rev)
+               pr_info_once("microcode updated early to new patch_level=0x%08x\n",
+                            ucode_new_rev);
        return &microcode_amd_ops;
  }
  
This page took 0.03254 seconds and 5 git commands to generate.