Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 20 Jan 2014 20:07:54 +0000 (12:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 20 Jan 2014 20:07:54 +0000 (12:07 -0800)
Pull x86 microcode loader updates from Ingo Molnar:
 "There are two main changes in this tree:

   - AMD microcode early loading fixes
   - some microcode loader source files reorganization"

* 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, microcode: Move to a proper location
  x86, microcode, AMD: Fix early ucode loading
  x86, microcode: Share native MSR accessing variants
  x86, ramdisk: Export relocated ramdisk VA

1  2 
arch/x86/Kconfig
arch/x86/kernel/Makefile
arch/x86/kernel/cpu/Makefile
arch/x86/kernel/setup.c

diff --combined arch/x86/Kconfig
@@@ -125,7 -125,6 +125,7 @@@ config X8
        select RTC_LIB
        select HAVE_DEBUG_STACKOVERFLOW
        select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
 +      select HAVE_CC_STACKPROTECTOR
  
  config INSTRUCTION_DECODER
        def_bool y
@@@ -439,26 -438,42 +439,26 @@@ config X86_INTEL_C
          This option compiles in support for the CE4100 SOC for settop
          boxes and media devices.
  
 -config X86_WANT_INTEL_MID
 +config X86_INTEL_MID
        bool "Intel MID platform support"
        depends on X86_32
        depends on X86_EXTENDED_PLATFORM
 -      ---help---
 -        Select to build a kernel capable of supporting Intel MID platform
 -        systems which do not have the PCI legacy interfaces (Moorestown,
 -        Medfield). If you are building for a PC class system say N here.
 -
 -if X86_WANT_INTEL_MID
 -
 -config X86_INTEL_MID
 -      bool
 -
 -config X86_MDFLD
 -       bool "Medfield MID platform"
        depends on PCI
        depends on PCI_GOANY
        depends on X86_IO_APIC
 -      select X86_INTEL_MID
        select SFI
 +      select I2C
        select DW_APB_TIMER
        select APB_TIMER
 -      select I2C
 -      select SPI
        select INTEL_SCU_IPC
 -      select X86_PLATFORM_DEVICES
        select MFD_INTEL_MSIC
        ---help---
 -        Medfield is Intel's Low Power Intel Architecture (LPIA) based Moblin
 -        Internet Device(MID) platform. 
 -        Unlike standard x86 PCs, Medfield does not have many legacy devices
 -        nor standard legacy replacement devices/features. e.g. Medfield does
 -        not contain i8259, i8254, HPET, legacy BIOS, most of the io ports.
 +        Select to build a kernel capable of supporting Intel MID (Mobile
 +        Internet Device) platform systems which do not have the PCI legacy
 +        interfaces. If you are building for a PC class system say N here.
  
 -endif
 +        Intel MID platforms are based on an Intel processor and chipset which
 +        consume less power than most of the x86 derivatives.
  
  config X86_INTEL_LPSS
        bool "Intel Low Power Subsystem Support"
@@@ -1065,10 -1080,6 +1065,6 @@@ config MICROCODE_OLD_INTERFAC
        def_bool y
        depends on MICROCODE
  
- config MICROCODE_INTEL_LIB
-       def_bool y
-       depends on MICROCODE_INTEL
  config MICROCODE_INTEL_EARLY
        def_bool n
  
@@@ -1602,6 -1613,22 +1598,6 @@@ config SECCOM
  
          If unsure, say Y. Only embedded should say N here.
  
 -config CC_STACKPROTECTOR
 -      bool "Enable -fstack-protector buffer overflow detection"
 -      ---help---
 -        This option turns on the -fstack-protector GCC feature. This
 -        feature puts, at the beginning of functions, a canary value on
 -        the stack just before the return address, and validates
 -        the value just before actually returning.  Stack based buffer
 -        overflows (that need to overwrite this return address) now also
 -        overwrite the canary, which gets detected and the attack is then
 -        neutralized via a kernel panic.
 -
 -        This feature requires gcc version 4.2 or above, or a distribution
 -        gcc with the feature backported. Older versions are automatically
 -        detected and for those versions, this configuration option is
 -        ignored. (and a warning is printed during bootup)
 -
  source kernel/Kconfig.hz
  
  config KEXEC
diff --combined arch/x86/kernel/Makefile
@@@ -29,7 -29,6 +29,7 @@@ obj-$(CONFIG_X86_64)  += sys_x86_64.o x8
  obj-y                 += syscall_$(BITS).o
  obj-$(CONFIG_X86_64)  += vsyscall_64.o
  obj-$(CONFIG_X86_64)  += vsyscall_emu_64.o
 +obj-$(CONFIG_SYSFS)   += ksysfs.o
  obj-y                 += bootflag.o e820.o
  obj-y                 += pci-dma.o quirks.o topology.o kdebugfs.o
  obj-y                 += alternative.o i8253.o pci-nommu.o hw_breakpoint.o
@@@ -92,15 -91,6 +92,6 @@@ obj-$(CONFIG_PARAVIRT_CLOCK) += pvclock
  
  obj-$(CONFIG_PCSPKR_PLATFORM) += pcspeaker.o
  
- obj-$(CONFIG_MICROCODE_EARLY)         += microcode_core_early.o
- obj-$(CONFIG_MICROCODE_INTEL_EARLY)   += microcode_intel_early.o
- obj-$(CONFIG_MICROCODE_INTEL_LIB)     += microcode_intel_lib.o
- microcode-y                           := microcode_core.o
- microcode-$(CONFIG_MICROCODE_INTEL)   += microcode_intel.o
- microcode-$(CONFIG_MICROCODE_AMD)     += microcode_amd.o
- obj-$(CONFIG_MICROCODE_AMD_EARLY)     += microcode_amd_early.o
- obj-$(CONFIG_MICROCODE)                       += microcode.o
  obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
  
  obj-$(CONFIG_SWIOTLB)                 += pci-swiotlb.o
@@@ -36,12 -36,13 +36,13 @@@ obj-$(CONFIG_CPU_SUP_AMD)          += perf_even
  endif
  obj-$(CONFIG_CPU_SUP_INTEL)           += perf_event_p6.o perf_event_knc.o perf_event_p4.o
  obj-$(CONFIG_CPU_SUP_INTEL)           += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o
 -obj-$(CONFIG_CPU_SUP_INTEL)           += perf_event_intel_uncore.o
 +obj-$(CONFIG_CPU_SUP_INTEL)           += perf_event_intel_uncore.o perf_event_intel_rapl.o
  endif
  
  
  obj-$(CONFIG_X86_MCE)                 += mcheck/
  obj-$(CONFIG_MTRR)                    += mtrr/
+ obj-$(CONFIG_MICROCODE)                       += microcode/
  
  obj-$(CONFIG_X86_LOCAL_APIC)          += perfctr-watchdog.o perf_event_amd_ibs.o
  
diff --combined arch/x86/kernel/setup.c
@@@ -295,6 -295,8 +295,8 @@@ static void __init reserve_brk(void
        _brk_start = 0;
  }
  
+ u64 relocated_ramdisk;
  #ifdef CONFIG_BLK_DEV_INITRD
  
  static u64 __init get_ramdisk_image(void)
@@@ -321,25 -323,24 +323,24 @@@ static void __init relocate_initrd(void
        u64 ramdisk_image = get_ramdisk_image();
        u64 ramdisk_size  = get_ramdisk_size();
        u64 area_size     = PAGE_ALIGN(ramdisk_size);
-       u64 ramdisk_here;
        unsigned long slop, clen, mapaddr;
        char *p, *q;
  
        /* We need to move the initrd down into directly mapped mem */
-       ramdisk_here = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
-                                                area_size, PAGE_SIZE);
+       relocated_ramdisk = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
+                                                  area_size, PAGE_SIZE);
  
-       if (!ramdisk_here)
+       if (!relocated_ramdisk)
                panic("Cannot find place for new RAMDISK of size %lld\n",
-                        ramdisk_size);
+                     ramdisk_size);
  
        /* Note: this includes all the mem currently occupied by
           the initrd, we rely on that fact to keep the data intact. */
-       memblock_reserve(ramdisk_here, area_size);
-       initrd_start = ramdisk_here + PAGE_OFFSET;
+       memblock_reserve(relocated_ramdisk, area_size);
+       initrd_start = relocated_ramdisk + PAGE_OFFSET;
        initrd_end   = initrd_start + ramdisk_size;
        printk(KERN_INFO "Allocated new RAMDISK: [mem %#010llx-%#010llx]\n",
-                        ramdisk_here, ramdisk_here + ramdisk_size - 1);
+              relocated_ramdisk, relocated_ramdisk + ramdisk_size - 1);
  
        q = (char *)initrd_start;
  
        printk(KERN_INFO "Move RAMDISK from [mem %#010llx-%#010llx] to"
                " [mem %#010llx-%#010llx]\n",
                ramdisk_image, ramdisk_image + ramdisk_size - 1,
-               ramdisk_here, ramdisk_here + ramdisk_size - 1);
+               relocated_ramdisk, relocated_ramdisk + ramdisk_size - 1);
  }
  
  static void __init early_reserve_initrd(void)
@@@ -447,9 -448,6 +448,9 @@@ static void __init parse_setup_data(voi
                case SETUP_DTB:
                        add_dtb(pa_data);
                        break;
 +              case SETUP_EFI:
 +                      parse_efi_setup(pa_data, data_len);
 +                      break;
                default:
                        break;
                }
@@@ -927,6 -925,8 +928,6 @@@ void __init setup_arch(char **cmdline_p
        iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
        setup_memory_map();
        parse_setup_data();
 -      /* update the e820_saved too */
 -      e820_reserve_setup_data();
  
        copy_edd();
  
                early_dump_pci_devices();
  #endif
  
 +      /* update the e820_saved too */
 +      e820_reserve_setup_data();
        finish_e820_parsing();
  
        if (efi_enabled(EFI_BOOT))