]> Git Repo - linux.git/commitdiff
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Tue, 15 Mar 2016 16:32:27 +0000 (09:32 -0700)
committerLinus Torvalds <[email protected]>
Tue, 15 Mar 2016 16:32:27 +0000 (09:32 -0700)
Pull x86 asm updates from Ingo Molnar:
 "This is another big update. Main changes are:

   - lots of x86 system call (and other traps/exceptions) entry code
     enhancements.  In particular the complex parts of the 64-bit entry
     code have been migrated to C code as well, and a number of dusty
     corners have been refreshed.  (Andy Lutomirski)

   - vDSO special mapping robustification and general cleanups (Andy
     Lutomirski)

   - cpufeature refactoring, cleanups and speedups (Borislav Petkov)

   - lots of other changes ..."

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (64 commits)
  x86/cpufeature: Enable new AVX-512 features
  x86/entry/traps: Show unhandled signal for i386 in do_trap()
  x86/entry: Call enter_from_user_mode() with IRQs off
  x86/entry/32: Change INT80 to be an interrupt gate
  x86/entry: Improve system call entry comments
  x86/entry: Remove TIF_SINGLESTEP entry work
  x86/entry/32: Add and check a stack canary for the SYSENTER stack
  x86/entry/32: Simplify and fix up the SYSENTER stack #DB/NMI fixup
  x86/entry: Only allocate space for tss_struct::SYSENTER_stack if needed
  x86/entry: Vastly simplify SYSENTER TF (single-step) handling
  x86/entry/traps: Clear DR6 early in do_debug() and improve the comment
  x86/entry/traps: Clear TIF_BLOCKSTEP on all debug exceptions
  x86/entry/32: Restore FLAGS on SYSEXIT
  x86/entry/32: Filter NT and speed up AC filtering in SYSENTER
  x86/entry/compat: In SYSENTER, sink AC clearing below the existing FLAGS test
  selftests/x86: In syscall_nt, test NT|TF as well
  x86/asm-offsets: Remove PARAVIRT_enabled
  x86/entry/32: Introduce and use X86_BUG_ESPFIX instead of paravirt_enabled
  uprobes: __create_xol_area() must nullify xol_mapping.fault
  x86/cpufeature: Create a new synthetic cpu capability for machine check recovery
  ...

21 files changed:
1  2 
Documentation/kernel-parameters.txt
arch/x86/Kconfig.debug
arch/x86/entry/vdso/vdso2c.h
arch/x86/include/asm/mce.h
arch/x86/include/asm/processor.h
arch/x86/kernel/cpu/Makefile
arch/x86/kernel/cpu/centaur.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/cyrix.c
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/cpu/mtrr/main.c
arch/x86/kernel/cpu/transmeta.c
arch/x86/kernel/e820.c
arch/x86/kernel/ftrace.c
arch/x86/kernel/process.c
arch/x86/kernel/traps.c
arch/x86/kernel/vmlinux.lds.S
arch/x86/lib/memcpy_64.S
include/linux/mm.h

index 8ae47a7b4923b87ed4f5d7ea722f60fbc88f8cba,0d27a9adabf849f0f95645cbcb361e9f8e789762..084775f7b052de0f9998ffa7bfa2e48080f1aec1
@@@ -666,7 -666,7 +666,7 @@@ bytes respectively. Such letter suffixe
  
        clearcpuid=BITNUM [X86]
                        Disable CPUID feature X for the kernel. See
-                       arch/x86/include/asm/cpufeature.h for the valid bit
+                       arch/x86/include/asm/cpufeatures.h for the valid bit
                        numbers. Note the Linux specific bits are not necessarily
                        stable over kernel options, but the vendor specific
                        ones should be.
  
        ro              [KNL] Mount root device read-only on boot
  
 +      rodata=         [KNL]
 +              on      Mark read-only kernel memory as read-only (default).
 +              off     Leave read-only kernel memory writable for debugging.
 +
        root=           [KNL] Root filesystem
                        See name_to_dev_t comment in init/do_mounts.c.
  
  
        sched_debug     [KNL] Enables verbose scheduler debug messages.
  
 +      schedstats=     [KNL,X86] Enable or disable scheduled statistics.
 +                      Allowed values are enable and disable. This feature
 +                      incurs a small amount of overhead in the scheduler
 +                      but is useful for debugging and performance tuning.
 +
        skew_tick=      [KNL] Offset the periodic timer tick per cpu to mitigate
                        xtime_lock contention on larger systems, and/or RCU lock
                        contention on all systems with CONFIG_MAXSMP set.
diff --combined arch/x86/Kconfig.debug
index 7816b7b276f463b49b957dcbd40d9f38ba6c91e9,68a2d1f0a6832bdbfafd9ed4122f370252f5e4d1..67eec55093a5dc97634aea899c4be86ff9f18f00
@@@ -74,16 -74,28 +74,16 @@@ config EFI_PGT_DUM
          issues with the mapping of the EFI runtime regions into that
          table.
  
 -config DEBUG_RODATA
 -      bool "Write protect kernel read-only data structures"
 -      default y
 -      depends on DEBUG_KERNEL
 -      ---help---
 -        Mark the kernel read-only data as write-protected in the pagetables,
 -        in order to catch accidental (and incorrect) writes to such const
 -        data. This is recommended so that we can catch kernel bugs sooner.
 -        If in doubt, say "Y".
 -
  config DEBUG_RODATA_TEST
 -      bool "Testcase for the DEBUG_RODATA feature"
 -      depends on DEBUG_RODATA
 +      bool "Testcase for the marking rodata read-only"
        default y
        ---help---
 -        This option enables a testcase for the DEBUG_RODATA
 -        feature as well as for the change_page_attr() infrastructure.
 +        This option enables a testcase for the setting rodata read-only
 +        as well as for the change_page_attr() infrastructure.
          If in doubt, say "N"
  
  config DEBUG_WX
        bool "Warn on W+X mappings at boot"
 -      depends on DEBUG_RODATA
        select X86_PTDUMP_CORE
        ---help---
          Generate a warning if any W+X mappings are found at boot.
@@@ -338,16 -350,6 +338,6 @@@ config DEBUG_IMR_SELFTES
  
          If unsure say N here.
  
- config X86_DEBUG_STATIC_CPU_HAS
-       bool "Debug alternatives"
-       depends on DEBUG_KERNEL
-       ---help---
-         This option causes additional code to be generated which
-         fails if static_cpu_has() is used before alternatives have
-         run.
-         If unsure, say N.
  config X86_DEBUG_FPU
        bool "Debug the x86 FPU code"
        depends on DEBUG_KERNEL
index 3f69326ed545719aedd9e11b1be0fdea104136bc,abe961c7c71c7464e9707afa01bfe14efc89ba5f..63a03bb91497e63d56e1ba329f9da7b80e751e1d
@@@ -140,7 -140,7 +140,7 @@@ static void BITSFUNC(go)(void *raw_addr
        fprintf(outfile, "#include <asm/vdso.h>\n");
        fprintf(outfile, "\n");
        fprintf(outfile,
 -              "static unsigned char raw_data[%lu] __page_aligned_data = {",
 +              "static unsigned char raw_data[%lu] __ro_after_init __aligned(PAGE_SIZE) = {",
                mapping_size);
        for (j = 0; j < stripped_len; j++) {
                if (j % 10 == 0)
        }
        fprintf(outfile, "\n};\n\n");
  
-       fprintf(outfile, "static struct page *pages[%lu];\n\n",
-               mapping_size / 4096);
        fprintf(outfile, "const struct vdso_image %s = {\n", name);
        fprintf(outfile, "\t.data = raw_data,\n");
        fprintf(outfile, "\t.size = %lu,\n", mapping_size);
-       fprintf(outfile, "\t.text_mapping = {\n");
-       fprintf(outfile, "\t\t.name = \"[vdso]\",\n");
-       fprintf(outfile, "\t\t.pages = pages,\n");
-       fprintf(outfile, "\t},\n");
        if (alt_sec) {
                fprintf(outfile, "\t.alt = %lu,\n",
                        (unsigned long)GET_LE(&alt_sec->sh_offset));
index cfff34172be07972d3e4681ef8d6455fb57bed2a,18d2ba9c8e44e398e2edd31c381150c515b63e37..92b6f651fa4fcc7e58d5764f317f9db8b0a5616b
  #define MCI_STATUS_AR  (1ULL<<55)  /* Action required */
  
  /* AMD-specific bits */
 -#define MCI_STATUS_DEFERRED   (1ULL<<44)  /* declare an uncorrected error */
 +#define MCI_STATUS_DEFERRED   (1ULL<<44)  /* uncorrected error, deferred exception */
  #define MCI_STATUS_POISON     (1ULL<<43)  /* access poisonous data */
 +#define MCI_STATUS_TCC                (1ULL<<55)  /* Task context corrupt */
 +
 +/*
 + * McaX field if set indicates a given bank supports MCA extensions:
 + *  - Deferred error interrupt type is specifiable by bank.
 + *  - MCx_MISC0[BlkPtr] field indicates presence of extended MISC registers,
 + *    But should not be used to determine MSR numbers.
 + *  - TCC bit is present in MCx_STATUS.
 + */
 +#define MCI_CONFIG_MCAX               0x1
 +#define MCI_IPID_MCATYPE      0xFFFF0000
 +#define MCI_IPID_HWID         0xFFF
  
  /*
   * Note that the full MCACOD field of IA32_MCi_STATUS MSR is
  #define MCE_LOG_LEN 32
  #define MCE_LOG_SIGNATURE     "MACHINECHECK"
  
 +/* AMD Scalable MCA */
 +#define MSR_AMD64_SMCA_MC0_MISC0      0xc0002003
 +#define MSR_AMD64_SMCA_MC0_CONFIG     0xc0002004
 +#define MSR_AMD64_SMCA_MC0_IPID               0xc0002005
 +#define MSR_AMD64_SMCA_MC0_MISC1      0xc000200a
 +#define MSR_AMD64_SMCA_MCx_MISC(x)    (MSR_AMD64_SMCA_MC0_MISC0 + 0x10*(x))
 +#define MSR_AMD64_SMCA_MCx_CONFIG(x)  (MSR_AMD64_SMCA_MC0_CONFIG + 0x10*(x))
 +#define MSR_AMD64_SMCA_MCx_IPID(x)    (MSR_AMD64_SMCA_MC0_IPID + 0x10*(x))
 +#define MSR_AMD64_SMCA_MCx_MISCy(x, y)        ((MSR_AMD64_SMCA_MC0_MISC1 + y) + (0x10*(x)))
 +
  /*
   * This structure contains all data related to the MCE log.  Also
   * carries a signature to make it easier to find from external
@@@ -135,6 -113,7 +135,7 @@@ struct mca_config 
        bool ignore_ce;
        bool disabled;
        bool ser;
+       bool recovery;
        bool bios_cmci_threshold;
        u8 banks;
        s8 bootlog;
@@@ -309,49 -288,4 +310,49 @@@ struct cper_sec_mem_err
  extern void apei_mce_report_mem_error(int corrected,
                                      struct cper_sec_mem_err *mem_err);
  
 +/*
 + * Enumerate new IP types and HWID values in AMD processors which support
 + * Scalable MCA.
 + */
 +#ifdef CONFIG_X86_MCE_AMD
 +enum amd_ip_types {
 +      SMCA_F17H_CORE = 0,     /* Core errors */
 +      SMCA_DF,                /* Data Fabric */
 +      SMCA_UMC,               /* Unified Memory Controller */
 +      SMCA_PB,                /* Parameter Block */
 +      SMCA_PSP,               /* Platform Security Processor */
 +      SMCA_SMU,               /* System Management Unit */
 +      N_AMD_IP_TYPES
 +};
 +
 +struct amd_hwid {
 +      const char *name;
 +      unsigned int hwid;
 +};
 +
 +extern struct amd_hwid amd_hwids[N_AMD_IP_TYPES];
 +
 +enum amd_core_mca_blocks {
 +      SMCA_LS = 0,    /* Load Store */
 +      SMCA_IF,        /* Instruction Fetch */
 +      SMCA_L2_CACHE,  /* L2 cache */
 +      SMCA_DE,        /* Decoder unit */
 +      RES,            /* Reserved */
 +      SMCA_EX,        /* Execution unit */
 +      SMCA_FP,        /* Floating Point */
 +      SMCA_L3_CACHE,  /* L3 cache */
 +      N_CORE_MCA_BLOCKS
 +};
 +
 +extern const char * const amd_core_mcablock_names[N_CORE_MCA_BLOCKS];
 +
 +enum amd_df_mca_blocks {
 +      SMCA_CS = 0,    /* Coherent Slave */
 +      SMCA_PIE,       /* Power management, Interrupts, etc */
 +      N_DF_BLOCKS
 +};
 +
 +extern const char * const amd_df_mcablock_names[N_DF_BLOCKS];
 +#endif
 +
  #endif /* _ASM_X86_MCE_H */
index 813384ef811a03273678f693ca60be23d8bfd216,50a6dc871cc08734ea3926a59f235ee3a1bf0b3f..983738ac014c6508f499b26650d44b6f5b3b1b2b
@@@ -13,7 -13,7 +13,7 @@@ struct vm86
  #include <asm/types.h>
  #include <uapi/asm/sigcontext.h>
  #include <asm/current.h>
- #include <asm/cpufeature.h>
+ #include <asm/cpufeatures.h>
  #include <asm/page.h>
  #include <asm/pgtable_types.h>
  #include <asm/percpu.h>
@@@ -24,7 -24,6 +24,6 @@@
  #include <asm/fpu/types.h>
  
  #include <linux/personality.h>
- #include <linux/cpumask.h>
  #include <linux/cache.h>
  #include <linux/threads.h>
  #include <linux/math64.h>
@@@ -129,8 -128,6 +128,8 @@@ struct cpuinfo_x86 
        u16                     booted_cores;
        /* Physical processor id: */
        u16                     phys_proc_id;
 +      /* Logical processor id: */
 +      u16                     logical_proc_id;
        /* Core id: */
        u16                     cpu_core_id;
        /* Compute unit id */
@@@ -300,10 -297,13 +299,13 @@@ struct tss_struct 
         */
        unsigned long           io_bitmap[IO_BITMAP_LONGS + 1];
  
+ #ifdef CONFIG_X86_32
        /*
-        * Space for the temporary SYSENTER stack:
+        * Space for the temporary SYSENTER stack.
         */
+       unsigned long           SYSENTER_stack_canary;
        unsigned long           SYSENTER_stack[64];
+ #endif
  
  } ____cacheline_aligned;
  
index 7a60424d63fa4853c37941725bfaa73372c81175,faa7b520412931d66ff61b69da6973b958420ea6..0d373d7affc8d48d1039f6c6d759a3b9cc191c38
@@@ -30,11 -30,33 +30,11 @@@ obj-$(CONFIG_CPU_SUP_CENTAUR)              += centa
  obj-$(CONFIG_CPU_SUP_TRANSMETA_32)    += transmeta.o
  obj-$(CONFIG_CPU_SUP_UMC_32)          += umc.o
  
 -obj-$(CONFIG_PERF_EVENTS)             += perf_event.o
 -
 -ifdef CONFIG_PERF_EVENTS
 -obj-$(CONFIG_CPU_SUP_AMD)             += perf_event_amd.o perf_event_amd_uncore.o
 -ifdef CONFIG_AMD_IOMMU
 -obj-$(CONFIG_CPU_SUP_AMD)             += perf_event_amd_iommu.o
 -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_rapl.o perf_event_intel_cqm.o
 -obj-$(CONFIG_CPU_SUP_INTEL)           += perf_event_intel_pt.o perf_event_intel_bts.o
 -obj-$(CONFIG_CPU_SUP_INTEL)           += perf_event_intel_cstate.o
 -
 -obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE)        += perf_event_intel_uncore.o \
 -                                         perf_event_intel_uncore_snb.o \
 -                                         perf_event_intel_uncore_snbep.o \
 -                                         perf_event_intel_uncore_nhmex.o
 -obj-$(CONFIG_CPU_SUP_INTEL)           += perf_event_msr.o
 -obj-$(CONFIG_CPU_SUP_AMD)             += perf_event_msr.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
 +obj-$(CONFIG_X86_LOCAL_APIC)          += perfctr-watchdog.o
  
  obj-$(CONFIG_HYPERVISOR_GUEST)                += vmware.o hypervisor.o mshyperv.o
  
@@@ -42,7 -64,7 +42,7 @@@ ifdef CONFIG_X86_FEATURE_NAME
  quiet_cmd_mkcapflags = MKCAP   $@
        cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $< $@
  
- cpufeature = $(src)/../../include/asm/cpufeature.h
+ cpufeature = $(src)/../../include/asm/cpufeatures.h
  
  targets += capflags.c
  $(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE
index ce197bb7c1294f0f1138c78d1514c78e0d92b910,6608c03c212675bd13b895021afdfd761b6cff7e..1661d8ec92805191cd4581c365db68ea5acfdf02
@@@ -1,7 -1,7 +1,7 @@@
  #include <linux/bitops.h>
  #include <linux/kernel.h>
  
- #include <asm/processor.h>
+ #include <asm/cpufeature.h>
  #include <asm/e820.h>
  #include <asm/mtrr.h>
  #include <asm/msr.h>
@@@ -29,7 -29,7 +29,7 @@@ static void init_c3(struct cpuinfo_x86 
                        rdmsr(MSR_VIA_FCR, lo, hi);
                        lo |= ACE_FCR;          /* enable ACE unit */
                        wrmsr(MSR_VIA_FCR, lo, hi);
 -                      printk(KERN_INFO "CPU: Enabled ACE h/w crypto\n");
 +                      pr_info("CPU: Enabled ACE h/w crypto\n");
                }
  
                /* enable RNG unit, if present and disabled */
@@@ -37,7 -37,7 +37,7 @@@
                        rdmsr(MSR_VIA_RNG, lo, hi);
                        lo |= RNG_ENABLE;       /* enable RNG unit */
                        wrmsr(MSR_VIA_RNG, lo, hi);
 -                      printk(KERN_INFO "CPU: Enabled h/w RNG\n");
 +                      pr_info("CPU: Enabled h/w RNG\n");
                }
  
                /* store Centaur Extended Feature Flags as
@@@ -130,7 -130,7 +130,7 @@@ static void init_centaur(struct cpuinfo
                        name = "C6";
                        fcr_set = ECX8|DSMC|EDCTLB|EMMX|ERETSTK;
                        fcr_clr = DPDC;
 -                      printk(KERN_NOTICE "Disabling bugged TSC.\n");
 +                      pr_notice("Disabling bugged TSC.\n");
                        clear_cpu_cap(c, X86_FEATURE_TSC);
                        break;
                case 8:
                newlo = (lo|fcr_set) & (~fcr_clr);
  
                if (newlo != lo) {
 -                      printk(KERN_INFO "Centaur FCR was 0x%X now 0x%X\n",
 +                      pr_info("Centaur FCR was 0x%X now 0x%X\n",
                                lo, newlo);
                        wrmsr(MSR_IDT_FCR1, newlo, hi);
                } else {
 -                      printk(KERN_INFO "Centaur FCR is 0x%X\n", lo);
 +                      pr_info("Centaur FCR is 0x%X\n", lo);
                }
                /* Emulate MTRRs using Centaur's MCR. */
                set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR);
index 81cf716f6f97f2438b386c7e3eb3ca073e16d0c8,d8337f34b5f40b304ad76a0682369d8a91f59ecc..4e8d25d395eeca383248d0ed76cc0fe28d0134d2
@@@ -228,7 -228,7 +228,7 @@@ static void squash_the_stupid_serial_nu
        lo |= 0x200000;
        wrmsr(MSR_IA32_BBL_CR_CTL, lo, hi);
  
 -      printk(KERN_NOTICE "CPU serial number disabled.\n");
 +      pr_notice("CPU serial number disabled.\n");
        clear_cpu_cap(c, X86_FEATURE_PN);
  
        /* Disabling the serial number may affect the cpuid level */
@@@ -329,8 -329,9 +329,8 @@@ static void filter_cpuid_features(struc
                if (!warn)
                        continue;
  
 -              printk(KERN_WARNING
 -                     "CPU: CPU feature " X86_CAP_FMT " disabled, no CPUID level 0x%x\n",
 -                              x86_cap_flag(df->feature), df->level);
 +              pr_warn("CPU: CPU feature " X86_CAP_FMT " disabled, no CPUID level 0x%x\n",
 +                      x86_cap_flag(df->feature), df->level);
        }
  }
  
@@@ -509,7 -510,7 +509,7 @@@ void detect_ht(struct cpuinfo_x86 *c
        smp_num_siblings = (ebx & 0xff0000) >> 16;
  
        if (smp_num_siblings == 1) {
 -              printk_once(KERN_INFO "CPU0: Hyper-Threading is disabled\n");
 +              pr_info_once("CPU0: Hyper-Threading is disabled\n");
                goto out;
        }
  
  
  out:
        if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {
 -              printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
 -                     c->phys_proc_id);
 -              printk(KERN_INFO  "CPU: Processor Core ID: %d\n",
 -                     c->cpu_core_id);
 +              pr_info("CPU: Physical Processor ID: %d\n",
 +                      c->phys_proc_id);
 +              pr_info("CPU: Processor Core ID: %d\n",
 +                      c->cpu_core_id);
                printed = 1;
        }
  #endif
@@@ -558,8 -559,9 +558,8 @@@ static void get_cpu_vendor(struct cpuin
                }
        }
  
 -      printk_once(KERN_ERR
 -                      "CPU: vendor_id '%s' unknown, using generic init.\n" \
 -                      "CPU: Your system may be unstable.\n", v);
 +      pr_err_once("CPU: vendor_id '%s' unknown, using generic init.\n" \
 +                  "CPU: Your system may be unstable.\n", v);
  
        c->x86_vendor = X86_VENDOR_UNKNOWN;
        this_cpu = &default_cpu;
@@@ -758,7 -760,7 +758,7 @@@ void __init early_cpu_init(void
        int count = 0;
  
  #ifdef CONFIG_PROCESSOR_SELECT
 -      printk(KERN_INFO "KERNEL supported cpus:\n");
 +      pr_info("KERNEL supported cpus:\n");
  #endif
  
        for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) {
                        for (j = 0; j < 2; j++) {
                                if (!cpudev->c_ident[j])
                                        continue;
 -                              printk(KERN_INFO "  %s %s\n", cpudev->c_vendor,
 +                              pr_info("  %s %s\n", cpudev->c_vendor,
                                        cpudev->c_ident[j]);
                        }
                }
@@@ -800,6 -802,31 +800,31 @@@ static void detect_nopl(struct cpuinfo_
        clear_cpu_cap(c, X86_FEATURE_NOPL);
  #else
        set_cpu_cap(c, X86_FEATURE_NOPL);
+ #endif
+       /*
+        * ESPFIX is a strange bug.  All real CPUs have it.  Paravirt
+        * systems that run Linux at CPL > 0 may or may not have the
+        * issue, but, even if they have the issue, there's absolutely
+        * nothing we can do about it because we can't use the real IRET
+        * instruction.
+        *
+        * NB: For the time being, only 32-bit kernels support
+        * X86_BUG_ESPFIX as such.  64-bit kernels directly choose
+        * whether to apply espfix using paravirt hooks.  If any
+        * non-paravirt system ever shows up that does *not* have the
+        * ESPFIX issue, we can change this.
+        */
+ #ifdef CONFIG_X86_32
+ #ifdef CONFIG_PARAVIRT
+       do {
+               extern void native_iret(void);
+               if (pv_cpu_ops.iret == native_iret)
+                       set_cpu_bug(c, X86_BUG_ESPFIX);
+       } while (0);
+ #else
+       set_cpu_bug(c, X86_BUG_ESPFIX);
+ #endif
  #endif
  }
  
@@@ -975,8 -1002,6 +1000,8 @@@ static void identify_cpu(struct cpuinfo
  #ifdef CONFIG_NUMA
        numa_add_cpu(smp_processor_id());
  #endif
 +      /* The boot/hotplug time assigment got cleared, restore it */
 +      c->logical_proc_id = topology_phys_to_logical_pkg(c->phys_proc_id);
  }
  
  /*
@@@ -1061,7 -1086,7 +1086,7 @@@ static void __print_cpu_msr(void
                for (index = index_min; index < index_max; index++) {
                        if (rdmsrl_safe(index, &val))
                                continue;
 -                      printk(KERN_INFO " MSR%08x: %016llx\n", index, val);
 +                      pr_info(" MSR%08x: %016llx\n", index, val);
                }
        }
  }
@@@ -1100,19 -1125,19 +1125,19 @@@ void print_cpu_info(struct cpuinfo_x86 
        }
  
        if (vendor && !strstr(c->x86_model_id, vendor))
 -              printk(KERN_CONT "%s ", vendor);
 +              pr_cont("%s ", vendor);
  
        if (c->x86_model_id[0])
 -              printk(KERN_CONT "%s", c->x86_model_id);
 +              pr_cont("%s", c->x86_model_id);
        else
 -              printk(KERN_CONT "%d86", c->x86);
 +              pr_cont("%d86", c->x86);
  
 -      printk(KERN_CONT " (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
 +      pr_cont(" (family: 0x%x, model: 0x%x", c->x86, c->x86_model);
  
        if (c->x86_mask || c->cpuid_level >= 0)
 -              printk(KERN_CONT ", stepping: 0x%x)\n", c->x86_mask);
 +              pr_cont(", stepping: 0x%x)\n", c->x86_mask);
        else
 -              printk(KERN_CONT ")\n");
 +              pr_cont(")\n");
  
        print_cpu_msr(c);
  }
@@@ -1438,7 -1463,7 +1463,7 @@@ void cpu_init(void
  
        show_ucode_info_early();
  
 -      printk(KERN_INFO "Initializing CPU#%d\n", cpu);
 +      pr_info("Initializing CPU#%d\n", cpu);
  
        if (cpu_feature_enabled(X86_FEATURE_VME) ||
            cpu_has_tsc ||
  }
  #endif
  
- #ifdef CONFIG_X86_DEBUG_STATIC_CPU_HAS
- void warn_pre_alternatives(void)
- {
-       WARN(1, "You're using static_cpu_has before alternatives have run!\n");
- }
- EXPORT_SYMBOL_GPL(warn_pre_alternatives);
- #endif
- inline bool __static_cpu_has_safe(u16 bit)
- {
-       return boot_cpu_has(bit);
- }
- EXPORT_SYMBOL_GPL(__static_cpu_has_safe);
  static void bsp_resume(void)
  {
        if (this_cpu->c_bsp_resume)
index 187bb583d0dfbccd6bf3e8c58a4973a0bff9ddd7,15e47c1cd41265443ad1e521baba45081239f39c..6adef9cac23ee99c96924e2789abeb2d1ad123f3
@@@ -8,6 -8,7 +8,7 @@@
  #include <linux/timer.h>
  #include <asm/pci-direct.h>
  #include <asm/tsc.h>
+ #include <asm/cpufeature.h>
  
  #include "cpu.h"
  
@@@ -103,7 -104,7 +104,7 @@@ static void check_cx686_slop(struct cpu
                local_irq_restore(flags);
  
                if (ccr5 & 2) { /* possible wrong calibration done */
 -                      printk(KERN_INFO "Recalibrating delay loop with SLOP bit reset\n");
 +                      pr_info("Recalibrating delay loop with SLOP bit reset\n");
                        calibrate_delay();
                        c->loops_per_jiffy = loops_per_jiffy;
                }
@@@ -115,7 -116,7 +116,7 @@@ static void set_cx86_reorder(void
  {
        u8 ccr3;
  
 -      printk(KERN_INFO "Enable Memory access reorder on Cyrix/NSC processor.\n");
 +      pr_info("Enable Memory access reorder on Cyrix/NSC processor.\n");
        ccr3 = getCx86(CX86_CCR3);
        setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
  
  
  static void set_cx86_memwb(void)
  {
 -      printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
 +      pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
  
        /* CCR2 bit 2: unlock NW bit */
        setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
@@@ -268,7 -269,7 +269,7 @@@ static void init_cyrix(struct cpuinfo_x
                 *  VSA1 we work around however.
                 */
  
 -              printk(KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n");
 +              pr_info("Working around Cyrix MediaGX virtual DMA bugs.\n");
                isa_dma_bridge_buggy = 2;
  
                /* We do this before the PCI layer is running. However we
@@@ -426,7 -427,7 +427,7 @@@ static void cyrix_identify(struct cpuin
                if (dir0 == 5 || dir0 == 3) {
                        unsigned char ccr3;
                        unsigned long flags;
 -                      printk(KERN_INFO "Enabling CPUID on Cyrix processor.\n");
 +                      pr_info("Enabling CPUID on Cyrix processor.\n");
                        local_irq_save(flags);
                        ccr3 = getCx86(CX86_CCR3);
                        /* enable MAPEN  */
index 38766c2b5b003984bcc63e459e7cfb820c907473,9299e3bdfad6bacf4a8d8341567e79682b67f241..1f7fdb91a818bc10d4b975a070d6b2c1a947b15b
@@@ -8,7 -8,7 +8,7 @@@
  #include <linux/module.h>
  #include <linux/uaccess.h>
  
- #include <asm/processor.h>
+ #include <asm/cpufeature.h>
  #include <asm/pgtable.h>
  #include <asm/msr.h>
  #include <asm/bugs.h>
@@@ -61,7 -61,7 +61,7 @@@ static void early_init_intel(struct cpu
         */
        if (c->x86 == 6 && c->x86_model == 0x1c && c->x86_mask <= 2 &&
            c->microcode < 0x20e) {
 -              printk(KERN_WARNING "Atom PSE erratum detected, BIOS microcode update recommended\n");
 +              pr_warn("Atom PSE erratum detected, BIOS microcode update recommended\n");
                clear_cpu_cap(c, X86_FEATURE_PSE);
        }
  
        if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
                rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
                if (!(misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING)) {
 -                      printk(KERN_INFO "Disabled fast string operations\n");
 +                      pr_info("Disabled fast string operations\n");
                        setup_clear_cpu_cap(X86_FEATURE_REP_GOOD);
                        setup_clear_cpu_cap(X86_FEATURE_ERMS);
                }
                pr_info("Disabling PGE capability bit\n");
                setup_clear_cpu_cap(X86_FEATURE_PGE);
        }
 +
 +      if (c->cpuid_level >= 0x00000001) {
 +              u32 eax, ebx, ecx, edx;
 +
 +              cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
 +              /*
 +               * If HTT (EDX[28]) is set EBX[16:23] contain the number of
 +               * apicids which are reserved per package. Store the resulting
 +               * shift value for the package management code.
 +               */
 +              if (edx & (1U << 28))
 +                      c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
 +      }
  }
  
  #ifdef CONFIG_X86_32
@@@ -189,7 -176,7 +189,7 @@@ int ppro_with_ram_bug(void
            boot_cpu_data.x86 == 6 &&
            boot_cpu_data.x86_model == 1 &&
            boot_cpu_data.x86_mask < 8) {
 -              printk(KERN_INFO "Pentium Pro with Errata#50 detected. Taking evasive action.\n");
 +              pr_info("Pentium Pro with Errata#50 detected. Taking evasive action.\n");
                return 1;
        }
        return 0;
@@@ -238,7 -225,7 +238,7 @@@ static void intel_workarounds(struct cp
  
                set_cpu_bug(c, X86_BUG_F00F);
                if (!f00f_workaround_enabled) {
 -                      printk(KERN_NOTICE "Intel Pentium with F0 0F bug - workaround enabled.\n");
 +                      pr_notice("Intel Pentium with F0 0F bug - workaround enabled.\n");
                        f00f_workaround_enabled = 1;
                }
        }
         * Forcefully enable PAE if kernel parameter "forcepae" is present.
         */
        if (forcepae) {
 -              printk(KERN_WARNING "PAE forced!\n");
 +              pr_warn("PAE forced!\n");
                set_cpu_cap(c, X86_FEATURE_PAE);
                add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_NOW_UNRELIABLE);
        }
index 6ed779efff2662bbeaa5f063a7d1c8ff2fd16e2f,341449c49f34317674a2edac0a60132ed43bd716..de6626c18e427b771ea902451ae77ab52e233915
@@@ -14,7 -14,7 +14,7 @@@
  #include <linux/sysfs.h>
  #include <linux/pci.h>
  
- #include <asm/processor.h>
+ #include <asm/cpufeature.h>
  #include <asm/amd_nb.h>
  #include <asm/smp.h>
  
@@@ -444,7 -444,7 +444,7 @@@ static ssize_t store_cache_disable(stru
        err = amd_set_l3_disable_slot(nb, cpu, slot, val);
        if (err) {
                if (err == -EEXIST)
 -                      pr_warning("L3 slot %d in use/index already disabled!\n",
 +                      pr_warn("L3 slot %d in use/index already disabled!\n",
                                   slot);
                return err;
        }
index 524f2a8492d7209656ed70dbd3cbac3cb97976ae,b5b187c8cc072a68ebf28e80c4e2bdc5caaaedd3..f0c921b03e4245e1f7a4b16687c0d9e7600b4256
@@@ -961,20 -961,6 +961,20 @@@ static void mce_clear_state(unsigned lo
        }
  }
  
 +static int do_memory_failure(struct mce *m)
 +{
 +      int flags = MF_ACTION_REQUIRED;
 +      int ret;
 +
 +      pr_err("Uncorrected hardware memory error in user-access at %llx", m->addr);
 +      if (!(m->mcgstatus & MCG_STATUS_RIPV))
 +              flags |= MF_MUST_KILL;
 +      ret = memory_failure(m->addr >> PAGE_SHIFT, MCE_VECTOR, flags);
 +      if (ret)
 +              pr_err("Memory error not recovered");
 +      return ret;
 +}
 +
  /*
   * The actual machine check handler. This only handles real
   * exceptions when something got corrupted coming in through int 18.
@@@ -1012,6 -998,8 +1012,6 @@@ void do_machine_check(struct pt_regs *r
        DECLARE_BITMAP(toclear, MAX_NR_BANKS);
        DECLARE_BITMAP(valid_banks, MAX_NR_BANKS);
        char *msg = "Unknown";
 -      u64 recover_paddr = ~0ull;
 -      int flags = MF_ACTION_REQUIRED;
        int lmce = 0;
  
        /* If this CPU is offline, just bail out. */
        }
  
        /*
 -       * At insane "tolerant" levels we take no action. Otherwise
 -       * we only die if we have no other choice. For less serious
 -       * issues we try to recover, or limit damage to the current
 -       * process.
 +       * If tolerant is at an insane level we drop requests to kill
 +       * processes and continue even when there is no way out.
         */
 -      if (cfg->tolerant < 3) {
 -              if (no_way_out)
 -                      mce_panic("Fatal machine check on current CPU", &m, msg);
 -              if (worst == MCE_AR_SEVERITY) {
 -                      recover_paddr = m.addr;
 -                      if (!(m.mcgstatus & MCG_STATUS_RIPV))
 -                              flags |= MF_MUST_KILL;
 -              } else if (kill_it) {
 -                      force_sig(SIGBUS, current);
 -              }
 -      }
 +      if (cfg->tolerant == 3)
 +              kill_it = 0;
 +      else if (no_way_out)
 +              mce_panic("Fatal machine check on current CPU", &m, msg);
  
        if (worst > 0)
                mce_report_event(regs);
  out:
        sync_core();
  
 -      if (recover_paddr == ~0ull)
 -              goto done;
 +      if (worst != MCE_AR_SEVERITY && !kill_it)
 +              goto out_ist;
  
 -      pr_err("Uncorrected hardware memory error in user-access at %llx",
 -               recover_paddr);
 -      /*
 -       * We must call memory_failure() here even if the current process is
 -       * doomed. We still need to mark the page as poisoned and alert any
 -       * other users of the page.
 -       */
 -      ist_begin_non_atomic(regs);
 -      local_irq_enable();
 -      if (memory_failure(recover_paddr >> PAGE_SHIFT, MCE_VECTOR, flags) < 0) {
 -              pr_err("Memory error not recovered");
 -              force_sig(SIGBUS, current);
 +      /* Fault was in user mode and we need to take some action */
 +      if ((m.cs & 3) == 3) {
 +              ist_begin_non_atomic(regs);
 +              local_irq_enable();
 +
 +              if (kill_it || do_memory_failure(&m))
 +                      force_sig(SIGBUS, current);
 +              local_irq_disable();
 +              ist_end_non_atomic();
 +      } else {
 +              if (!fixup_exception(regs, X86_TRAP_MC))
 +                      mce_panic("Failed kernel mode recovery", &m, NULL);
        }
 -      local_irq_disable();
 -      ist_end_non_atomic();
 -done:
 +
 +out_ist:
        ist_exit(regs);
  }
  EXPORT_SYMBOL_GPL(do_machine_check);
@@@ -1578,6 -1576,17 +1578,17 @@@ static int __mcheck_cpu_apply_quirks(st
  
                if (c->x86 == 6 && c->x86_model == 45)
                        quirk_no_way_out = quirk_sandybridge_ifu;
+               /*
+                * MCG_CAP.MCG_SER_P is necessary but not sufficient to know
+                * whether this processor will actually generate recoverable
+                * machine checks. Check to see if this is an E7 model Xeon.
+                * We can't do a model number check because E5 and E7 use the
+                * same model number. E5 doesn't support recovery, E7 does.
+                */
+               if (mca_cfg.recovery || (mca_cfg.ser &&
+                       !strncmp(c->x86_model_id,
+                                "Intel(R) Xeon(R) CPU E7-", 24)))
+                       set_cpu_cap(c, X86_FEATURE_MCE_RECOVERY);
        }
        if (cfg->monarch_timeout < 0)
                cfg->monarch_timeout = 0;
@@@ -1619,10 -1628,10 +1630,10 @@@ static void __mcheck_cpu_init_vendor(st
        case X86_VENDOR_AMD: {
                u32 ebx = cpuid_ebx(0x80000007);
  
 -              mce_amd_feature_init(c);
                mce_flags.overflow_recov = !!(ebx & BIT(0));
                mce_flags.succor         = !!(ebx & BIT(1));
                mce_flags.smca           = !!(ebx & BIT(3));
 +              mce_amd_feature_init(c);
  
                break;
                }
@@@ -2030,6 -2039,8 +2041,8 @@@ static int __init mcheck_enable(char *s
                cfg->bootlog = (str[0] == 'b');
        else if (!strcmp(str, "bios_cmci_threshold"))
                cfg->bios_cmci_threshold = true;
+       else if (!strcmp(str, "recovery"))
+               cfg->recovery = true;
        else if (isdigit(str[0])) {
                if (get_option(&str, &cfg->tolerant) == 2)
                        get_option(&str, &(cfg->monarch_timeout));
index ba80d68f683e72727d455cb36a3d0dc8493a5e25,74f1d90f9c298d7051cff46c24736b8b6cfda7fc..10f8d4796240709cea61c0e56522d75eeff8ffdd
@@@ -47,7 -47,7 +47,7 @@@
  #include <linux/smp.h>
  #include <linux/syscore_ops.h>
  
- #include <asm/processor.h>
+ #include <asm/cpufeature.h>
  #include <asm/e820.h>
  #include <asm/mtrr.h>
  #include <asm/msr.h>
@@@ -300,24 -300,24 +300,24 @@@ int mtrr_add_page(unsigned long base, u
                return error;
  
        if (type >= MTRR_NUM_TYPES) {
 -              pr_warning("mtrr: type: %u invalid\n", type);
 +              pr_warn("mtrr: type: %u invalid\n", type);
                return -EINVAL;
        }
  
        /* If the type is WC, check that this processor supports it */
        if ((type == MTRR_TYPE_WRCOMB) && !have_wrcomb()) {
 -              pr_warning("mtrr: your processor doesn't support write-combining\n");
 +              pr_warn("mtrr: your processor doesn't support write-combining\n");
                return -ENOSYS;
        }
  
        if (!size) {
 -              pr_warning("mtrr: zero sized request\n");
 +              pr_warn("mtrr: zero sized request\n");
                return -EINVAL;
        }
  
        if ((base | (base + size - 1)) >>
            (boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) {
 -              pr_warning("mtrr: base or size exceeds the MTRR width\n");
 +              pr_warn("mtrr: base or size exceeds the MTRR width\n");
                return -EINVAL;
        }
  
                                } else if (types_compatible(type, ltype))
                                        continue;
                        }
 -                      pr_warning("mtrr: 0x%lx000,0x%lx000 overlaps existing"
 +                      pr_warn("mtrr: 0x%lx000,0x%lx000 overlaps existing"
                                " 0x%lx000,0x%lx000\n", base, size, lbase,
                                lsize);
                        goto out;
                if (ltype != type) {
                        if (types_compatible(type, ltype))
                                continue;
 -                      pr_warning("mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n",
 +                      pr_warn("mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n",
                                base, size, mtrr_attrib_to_str(ltype),
                                mtrr_attrib_to_str(type));
                        goto out;
  static int mtrr_check(unsigned long base, unsigned long size)
  {
        if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) {
 -              pr_warning("mtrr: size and base must be multiples of 4 kiB\n");
 +              pr_warn("mtrr: size and base must be multiples of 4 kiB\n");
                pr_debug("mtrr: size: 0x%lx  base: 0x%lx\n", size, base);
                dump_stack();
                return -1;
@@@ -493,16 -493,16 +493,16 @@@ int mtrr_del_page(int reg, unsigned lon
                }
        }
        if (reg >= max) {
 -              pr_warning("mtrr: register: %d too big\n", reg);
 +              pr_warn("mtrr: register: %d too big\n", reg);
                goto out;
        }
        mtrr_if->get(reg, &lbase, &lsize, &ltype);
        if (lsize < 1) {
 -              pr_warning("mtrr: MTRR %d not used\n", reg);
 +              pr_warn("mtrr: MTRR %d not used\n", reg);
                goto out;
        }
        if (mtrr_usage_table[reg] < 1) {
 -              pr_warning("mtrr: reg: %d has count=0\n", reg);
 +              pr_warn("mtrr: reg: %d has count=0\n", reg);
                goto out;
        }
        if (--mtrr_usage_table[reg] < 1)
index e3b4d18411751c50b02967d372d21687d8854307,a19a663282b57e9a77891ee3d26d37fcd2ef3a23..34178564be2a70adbeaf3fd890cac32d97a51635
@@@ -1,6 -1,6 +1,6 @@@
  #include <linux/kernel.h>
  #include <linux/mm.h>
- #include <asm/processor.h>
+ #include <asm/cpufeature.h>
  #include <asm/msr.h>
  #include "cpu.h"
  
@@@ -33,7 -33,7 +33,7 @@@ static void init_transmeta(struct cpuin
        if (max >= 0x80860001) {
                cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
                if (cpu_rev != 0x02000000) {
 -                      printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
 +                      pr_info("CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
                                (cpu_rev >> 24) & 0xff,
                                (cpu_rev >> 16) & 0xff,
                                (cpu_rev >> 8) & 0xff,
        if (max >= 0x80860002) {
                cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);
                if (cpu_rev == 0x02000000) {
 -                      printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n",
 +                      pr_info("CPU: Processor revision %08X, %u MHz\n",
                                new_cpu_rev, cpu_freq);
                }
 -              printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
 +              pr_info("CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
                       (cms_rev1 >> 24) & 0xff,
                       (cms_rev1 >> 16) & 0xff,
                       (cms_rev1 >> 8) & 0xff,
@@@ -76,7 -76,7 +76,7 @@@
                      (void *)&cpu_info[56],
                      (void *)&cpu_info[60]);
                cpu_info[64] = '\0';
 -              printk(KERN_INFO "CPU: %s\n", cpu_info);
 +              pr_info("CPU: %s\n", cpu_info);
        }
  
        /* Unhide possibly hidden capability flags */
diff --combined arch/x86/kernel/e820.c
index 837365f1091228448c19a871686c974ac00278d8,b3c2a697820aab012118adf56ee0c67188188fe7..621b501f89351146b84b090b7160166bb9d5907e
@@@ -24,6 -24,7 +24,7 @@@
  #include <asm/e820.h>
  #include <asm/proto.h>
  #include <asm/setup.h>
+ #include <asm/cpufeature.h>
  
  /*
   * The e820 map is the map that gets modified e.g. with command line parameters
@@@ -925,41 -926,6 +926,41 @@@ static const char *e820_type_to_string(
        }
  }
  
 +static unsigned long e820_type_to_iomem_type(int e820_type)
 +{
 +      switch (e820_type) {
 +      case E820_RESERVED_KERN:
 +      case E820_RAM:
 +              return IORESOURCE_SYSTEM_RAM;
 +      case E820_ACPI:
 +      case E820_NVS:
 +      case E820_UNUSABLE:
 +      case E820_PRAM:
 +      case E820_PMEM:
 +      default:
 +              return IORESOURCE_MEM;
 +      }
 +}
 +
 +static unsigned long e820_type_to_iores_desc(int e820_type)
 +{
 +      switch (e820_type) {
 +      case E820_ACPI:
 +              return IORES_DESC_ACPI_TABLES;
 +      case E820_NVS:
 +              return IORES_DESC_ACPI_NV_STORAGE;
 +      case E820_PMEM:
 +              return IORES_DESC_PERSISTENT_MEMORY;
 +      case E820_PRAM:
 +              return IORES_DESC_PERSISTENT_MEMORY_LEGACY;
 +      case E820_RESERVED_KERN:
 +      case E820_RAM:
 +      case E820_UNUSABLE:
 +      default:
 +              return IORES_DESC_NONE;
 +      }
 +}
 +
  static bool do_mark_busy(u32 type, struct resource *res)
  {
        /* this is the legacy bios/dos rom-shadow + mmio region */
@@@ -1002,8 -968,7 +1003,8 @@@ void __init e820_reserve_resources(void
                res->start = e820.map[i].addr;
                res->end = end;
  
 -              res->flags = IORESOURCE_MEM;
 +              res->flags = e820_type_to_iomem_type(e820.map[i].type);
 +              res->desc = e820_type_to_iores_desc(e820.map[i].type);
  
                /*
                 * don't register the region that could be conflicted with
diff --combined arch/x86/kernel/ftrace.c
index 05c9e3f5b6d7b601286d62ef7f4fe1a754033255,04f9641e0cb6bd22f0c054c981402b0575a33ab5..702547ce33c9c7a33fd321fdb94367af5515dd8b
@@@ -81,9 -81,9 +81,9 @@@ within(unsigned long addr, unsigned lon
  static unsigned long text_ip_addr(unsigned long ip)
  {
        /*
 -       * On x86_64, kernel text mappings are mapped read-only with
 -       * CONFIG_DEBUG_RODATA. So we use the kernel identity mapping instead
 -       * of the kernel text mapping to modify the kernel text.
 +       * On x86_64, kernel text mappings are mapped read-only, so we use
 +       * the kernel identity mapping instead of the kernel text mapping
 +       * to modify the kernel text.
         *
         * For 32bit kernels, these mappings are same and we can use
         * kernel identity mapping to modify code.
@@@ -697,9 -697,8 +697,8 @@@ static inline void tramp_free(void *tra
  #endif
  
  /* Defined as markers to the end of the ftrace default trampolines */
- extern void ftrace_caller_end(void);
  extern void ftrace_regs_caller_end(void);
- extern void ftrace_return(void);
+ extern void ftrace_epilogue(void);
  extern void ftrace_caller_op_ptr(void);
  extern void ftrace_regs_caller_op_ptr(void);
  
@@@ -746,7 -745,7 +745,7 @@@ create_trampoline(struct ftrace_ops *op
                op_offset = (unsigned long)ftrace_regs_caller_op_ptr;
        } else {
                start_offset = (unsigned long)ftrace_caller;
-               end_offset = (unsigned long)ftrace_caller_end;
+               end_offset = (unsigned long)ftrace_epilogue;
                op_offset = (unsigned long)ftrace_caller_op_ptr;
        }
  
  
        /*
         * Allocate enough size to store the ftrace_caller code,
-        * the jmp to ftrace_return, as well as the address of
+        * the jmp to ftrace_epilogue, as well as the address of
         * the ftrace_ops this trampoline is used for.
         */
        trampoline = alloc_tramp(size + MCOUNT_INSN_SIZE + sizeof(void *));
  
        ip = (unsigned long)trampoline + size;
  
-       /* The trampoline ends with a jmp to ftrace_return */
-       jmp = ftrace_jmp_replace(ip, (unsigned long)ftrace_return);
+       /* The trampoline ends with a jmp to ftrace_epilogue */
+       jmp = ftrace_jmp_replace(ip, (unsigned long)ftrace_epilogue);
        memcpy(trampoline + size, jmp, MCOUNT_INSN_SIZE);
  
        /*
index 9decee2bfdbeedb795d3e1f423e606cdec5e49e0,ee9a9792caeb3c8a2f75ec56fdd7fb96828e2f4f..2915d54e9dd5f730558fba3ed2e7f3c9d4cd5a5b
@@@ -57,6 -57,9 +57,9 @@@ __visible DEFINE_PER_CPU_SHARED_ALIGNED
          */
        .io_bitmap              = { [0 ... IO_BITMAP_LONGS] = ~0 },
  #endif
+ #ifdef CONFIG_X86_32
+       .SYSENTER_stack_canary  = STACK_END_MAGIC,
+ #endif
  };
  EXPORT_PER_CPU_SYMBOL(cpu_tss);
  
@@@ -418,9 -421,9 +421,9 @@@ static void mwait_idle(void
        if (!current_set_polling_and_test()) {
                trace_cpu_idle_rcuidle(1, smp_processor_id());
                if (this_cpu_has(X86_BUG_CLFLUSH_MONITOR)) {
 -                      smp_mb(); /* quirk */
 +                      mb(); /* quirk */
                        clflush((void *)&current_thread_info()->flags);
 -                      smp_mb(); /* quirk */
 +                      mb(); /* quirk */
                }
  
                __monitor((void *)&current_thread_info()->flags, 0, 0);
diff --combined arch/x86/kernel/traps.c
index 211c11c7bba4aaacc99f6e36aae379c60d87c3d4,1baf08187ddf057fe8cbb57bb771d163ee565ee9..5c9ca2bb9fe95c249680f69e076a2320e1855aa1
@@@ -83,30 -83,16 +83,16 @@@ gate_desc idt_table[NR_VECTORS] __page_
  DECLARE_BITMAP(used_vectors, NR_VECTORS);
  EXPORT_SYMBOL_GPL(used_vectors);
  
- static inline void conditional_sti(struct pt_regs *regs)
+ static inline void cond_local_irq_enable(struct pt_regs *regs)
  {
        if (regs->flags & X86_EFLAGS_IF)
                local_irq_enable();
  }
  
- static inline void preempt_conditional_sti(struct pt_regs *regs)
- {
-       preempt_count_inc();
-       if (regs->flags & X86_EFLAGS_IF)
-               local_irq_enable();
- }
- static inline void conditional_cli(struct pt_regs *regs)
- {
-       if (regs->flags & X86_EFLAGS_IF)
-               local_irq_disable();
- }
- static inline void preempt_conditional_cli(struct pt_regs *regs)
+ static inline void cond_local_irq_disable(struct pt_regs *regs)
  {
        if (regs->flags & X86_EFLAGS_IF)
                local_irq_disable();
-       preempt_count_dec();
  }
  
  void ist_enter(struct pt_regs *regs)
@@@ -199,7 -185,7 +185,7 @@@ do_trap_no_signal(struct task_struct *t
        }
  
        if (!user_mode(regs)) {
 -              if (!fixup_exception(regs)) {
 +              if (!fixup_exception(regs, trapnr)) {
                        tsk->thread.error_code = error_code;
                        tsk->thread.trap_nr = trapnr;
                        die(str, regs, error_code);
@@@ -262,7 -248,6 +248,6 @@@ do_trap(int trapnr, int signr, char *st
        tsk->thread.error_code = error_code;
        tsk->thread.trap_nr = trapnr;
  
- #ifdef CONFIG_X86_64
        if (show_unhandled_signals && unhandled_signal(tsk, signr) &&
            printk_ratelimit()) {
                pr_info("%s[%d] trap %s ip:%lx sp:%lx error:%lx",
                print_vma_addr(" in ", regs->ip);
                pr_cont("\n");
        }
- #endif
  
        force_sig_info(signr, info ?: SEND_SIG_PRIV, tsk);
  }
@@@ -286,7 -270,7 +270,7 @@@ static void do_error_trap(struct pt_reg
  
        if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) !=
                        NOTIFY_STOP) {
-               conditional_sti(regs);
+               cond_local_irq_enable(regs);
                do_trap(trapnr, signr, str, regs, error_code,
                        fill_trap_info(regs, signr, trapnr, &info));
        }
@@@ -368,7 -352,7 +352,7 @@@ dotraplinkage void do_bounds(struct pt_
        if (notify_die(DIE_TRAP, "bounds", regs, error_code,
                        X86_TRAP_BR, SIGSEGV) == NOTIFY_STOP)
                return;
-       conditional_sti(regs);
+       cond_local_irq_enable(regs);
  
        if (!user_mode(regs))
                die("bounds", regs, error_code);
@@@ -443,7 -427,7 +427,7 @@@ do_general_protection(struct pt_regs *r
        struct task_struct *tsk;
  
        RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
-       conditional_sti(regs);
+       cond_local_irq_enable(regs);
  
        if (v8086_mode(regs)) {
                local_irq_enable();
  
        tsk = current;
        if (!user_mode(regs)) {
 -              if (fixup_exception(regs))
 +              if (fixup_exception(regs, X86_TRAP_GP))
                        return;
  
                tsk->thread.error_code = error_code;
@@@ -517,9 -501,11 +501,11 @@@ dotraplinkage void notrace do_int3(stru
         * as we may switch to the interrupt stack.
         */
        debug_stack_usage_inc();
-       preempt_conditional_sti(regs);
+       preempt_disable();
+       cond_local_irq_enable(regs);
        do_trap(X86_TRAP_BP, SIGTRAP, "int3", regs, error_code, NULL);
-       preempt_conditional_cli(regs);
+       cond_local_irq_disable(regs);
+       preempt_enable_no_resched();
        debug_stack_usage_dec();
  exit:
        ist_exit(regs);
@@@ -571,6 -557,29 +557,29 @@@ struct bad_iret_stack *fixup_bad_iret(s
  NOKPROBE_SYMBOL(fixup_bad_iret);
  #endif
  
+ static bool is_sysenter_singlestep(struct pt_regs *regs)
+ {
+       /*
+        * We don't try for precision here.  If we're anywhere in the region of
+        * code that can be single-stepped in the SYSENTER entry path, then
+        * assume that this is a useless single-step trap due to SYSENTER
+        * being invoked with TF set.  (We don't know in advance exactly
+        * which instructions will be hit because BTF could plausibly
+        * be set.)
+        */
+ #ifdef CONFIG_X86_32
+       return (regs->ip - (unsigned long)__begin_SYSENTER_singlestep_region) <
+               (unsigned long)__end_SYSENTER_singlestep_region -
+               (unsigned long)__begin_SYSENTER_singlestep_region;
+ #elif defined(CONFIG_IA32_EMULATION)
+       return (regs->ip - (unsigned long)entry_SYSENTER_compat) <
+               (unsigned long)__end_entry_SYSENTER_compat -
+               (unsigned long)entry_SYSENTER_compat;
+ #else
+       return false;
+ #endif
+ }
  /*
   * Our handling of the processor debug registers is non-trivial.
   * We do not clear them on entry and exit from the kernel. Therefore
@@@ -605,10 -614,41 +614,41 @@@ dotraplinkage void do_debug(struct pt_r
        ist_enter(regs);
  
        get_debugreg(dr6, 6);
+       /*
+        * The Intel SDM says:
+        *
+        *   Certain debug exceptions may clear bits 0-3. The remaining
+        *   contents of the DR6 register are never cleared by the
+        *   processor. To avoid confusion in identifying debug
+        *   exceptions, debug handlers should clear the register before
+        *   returning to the interrupted task.
+        *
+        * Keep it simple: clear DR6 immediately.
+        */
+       set_debugreg(0, 6);
  
        /* Filter out all the reserved bits which are preset to 1 */
        dr6 &= ~DR6_RESERVED;
  
+       /*
+        * The SDM says "The processor clears the BTF flag when it
+        * generates a debug exception."  Clear TIF_BLOCKSTEP to keep
+        * TIF_BLOCKSTEP in sync with the hardware BTF flag.
+        */
+       clear_tsk_thread_flag(tsk, TIF_BLOCKSTEP);
+       if (unlikely(!user_mode(regs) && (dr6 & DR_STEP) &&
+                    is_sysenter_singlestep(regs))) {
+               dr6 &= ~DR_STEP;
+               if (!dr6)
+                       goto exit;
+               /*
+                * else we might have gotten a single-step trap and hit a
+                * watchpoint at the same time, in which case we should fall
+                * through and handle the watchpoint.
+                */
+       }
        /*
         * If dr6 has no reason to give us about the origin of this trap,
         * then it's very likely the result of an icebp/int01 trap.
        if (!dr6 && user_mode(regs))
                user_icebp = 1;
  
-       /* Catch kmemcheck conditions first of all! */
+       /* Catch kmemcheck conditions! */
        if ((dr6 & DR_STEP) && kmemcheck_trap(regs))
                goto exit;
  
-       /* DR6 may or may not be cleared by the CPU */
-       set_debugreg(0, 6);
-       /*
-        * The processor cleared BTF, so don't mark that we need it set.
-        */
-       clear_tsk_thread_flag(tsk, TIF_BLOCKSTEP);
        /* Store the virtualized DR6 value */
        tsk->thread.debugreg6 = dr6;
  
        debug_stack_usage_inc();
  
        /* It's safe to allow irq's after DR6 has been saved */
-       preempt_conditional_sti(regs);
+       preempt_disable();
+       cond_local_irq_enable(regs);
  
        if (v8086_mode(regs)) {
                handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code,
                                        X86_TRAP_DB);
-               preempt_conditional_cli(regs);
+               cond_local_irq_disable(regs);
+               preempt_enable_no_resched();
                debug_stack_usage_dec();
                goto exit;
        }
  
-       /*
-        * Single-stepping through system calls: ignore any exceptions in
-        * kernel space, but re-enable TF when returning to user mode.
-        *
-        * We already checked v86 mode above, so we can check for kernel mode
-        * by just checking the CPL of CS.
-        */
-       if ((dr6 & DR_STEP) && !user_mode(regs)) {
+       if (WARN_ON_ONCE((dr6 & DR_STEP) && !user_mode(regs))) {
+               /*
+                * Historical junk that used to handle SYSENTER single-stepping.
+                * This should be unreachable now.  If we survive for a while
+                * without anyone hitting this warning, we'll turn this into
+                * an oops.
+                */
                tsk->thread.debugreg6 &= ~DR_STEP;
                set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
                regs->flags &= ~X86_EFLAGS_TF;
        si_code = get_si_code(tsk->thread.debugreg6);
        if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp)
                send_sigtrap(tsk, regs, error_code, si_code);
-       preempt_conditional_cli(regs);
+       cond_local_irq_disable(regs);
+       preempt_enable_no_resched();
        debug_stack_usage_dec();
  
  exit:
+ #if defined(CONFIG_X86_32)
+       /*
+        * This is the most likely code path that involves non-trivial use
+        * of the SYSENTER stack.  Check that we haven't overrun it.
+        */
+       WARN(this_cpu_read(cpu_tss.SYSENTER_stack_canary) != STACK_END_MAGIC,
+            "Overran or corrupted SYSENTER stack\n");
+ #endif
        ist_exit(regs);
  }
  NOKPROBE_SYMBOL(do_debug);
@@@ -696,10 -738,10 +738,10 @@@ static void math_error(struct pt_regs *
  
        if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, SIGFPE) == NOTIFY_STOP)
                return;
-       conditional_sti(regs);
+       cond_local_irq_enable(regs);
  
        if (!user_mode(regs)) {
 -              if (!fixup_exception(regs)) {
 +              if (!fixup_exception(regs, trapnr)) {
                        task->thread.error_code = error_code;
                        task->thread.trap_nr = trapnr;
                        die(str, regs, error_code);
@@@ -743,7 -785,7 +785,7 @@@ do_simd_coprocessor_error(struct pt_reg
  dotraplinkage void
  do_spurious_interrupt_bug(struct pt_regs *regs, long error_code)
  {
-       conditional_sti(regs);
+       cond_local_irq_enable(regs);
  }
  
  dotraplinkage void
@@@ -756,7 -798,7 +798,7 @@@ do_device_not_available(struct pt_regs 
        if (read_cr0() & X86_CR0_EM) {
                struct math_emu_info info = { };
  
-               conditional_sti(regs);
+               cond_local_irq_enable(regs);
  
                info.regs = regs;
                math_emulate(&info);
  #endif
        fpu__restore(&current->thread.fpu); /* interrupts still off */
  #ifdef CONFIG_X86_32
-       conditional_sti(regs);
+       cond_local_irq_enable(regs);
  #endif
  }
  NOKPROBE_SYMBOL(do_device_not_available);
@@@ -868,7 -910,7 +910,7 @@@ void __init trap_init(void
  #endif
  
  #ifdef CONFIG_X86_32
-       set_system_trap_gate(IA32_SYSCALL_VECTOR, entry_INT80_32);
+       set_system_intr_gate(IA32_SYSCALL_VECTOR, entry_INT80_32);
        set_bit(IA32_SYSCALL_VECTOR, used_vectors);
  #endif
  
index fe133b710befa9a7495178374076e465ec61668f,92dc211c11db236a94581158244e37bf12ef75ca..5af9958cbdb6be4293b62181ffe104f435caf830
@@@ -41,28 -41,29 +41,28 @@@ ENTRY(phys_startup_64
  jiffies_64 = jiffies;
  #endif
  
 -#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
 +#if defined(CONFIG_X86_64)
  /*
 - * On 64-bit, align RODATA to 2MB so that even with CONFIG_DEBUG_RODATA
 - * we retain large page mappings for boundaries spanning kernel text, rodata
 - * and data sections.
 + * On 64-bit, align RODATA to 2MB so we retain large page mappings for
 + * boundaries spanning kernel text, rodata and data sections.
   *
   * However, kernel identity mappings will have different RWX permissions
   * to the pages mapping to text and to the pages padding (which are freed) the
   * text section. Hence kernel identity mappings will be broken to smaller
   * pages. For 64-bit, kernel text and kernel identity mappings are different,
 - * so we can enable protection checks that come with CONFIG_DEBUG_RODATA,
 - * as well as retain 2MB large page mappings for kernel text.
 + * so we can enable protection checks as well as retain 2MB large page
 + * mappings for kernel text.
   */
 -#define X64_ALIGN_DEBUG_RODATA_BEGIN  . = ALIGN(HPAGE_SIZE);
 +#define X64_ALIGN_RODATA_BEGIN        . = ALIGN(HPAGE_SIZE);
  
 -#define X64_ALIGN_DEBUG_RODATA_END                            \
 +#define X64_ALIGN_RODATA_END                                  \
                . = ALIGN(HPAGE_SIZE);                          \
                __end_rodata_hpage_align = .;
  
  #else
  
 -#define X64_ALIGN_DEBUG_RODATA_BEGIN
 -#define X64_ALIGN_DEBUG_RODATA_END
 +#define X64_ALIGN_RODATA_BEGIN
 +#define X64_ALIGN_RODATA_END
  
  #endif
  
@@@ -111,11 -112,13 +111,11 @@@ SECTION
  
        EXCEPTION_TABLE(16) :text = 0x9090
  
 -#if defined(CONFIG_DEBUG_RODATA)
        /* .text should occupy whole number of pages */
        . = ALIGN(PAGE_SIZE);
 -#endif
 -      X64_ALIGN_DEBUG_RODATA_BEGIN
 +      X64_ALIGN_RODATA_BEGIN
        RO_DATA(PAGE_SIZE)
 -      X64_ALIGN_DEBUG_RODATA_END
 +      X64_ALIGN_RODATA_END
  
        /* Data */
        .data : AT(ADDR(.data) - LOAD_OFFSET) {
        :init
  #endif
  
+       /*
+        * Section for code used exclusively before alternatives are run. All
+        * references to such code must be patched out by alternatives, normally
+        * by using X86_FEATURE_ALWAYS CPU feature bit.
+        *
+        * See static_cpu_has() for an example.
+        */
+       .altinstr_aux : AT(ADDR(.altinstr_aux) - LOAD_OFFSET) {
+               *(.altinstr_aux)
+       }
        INIT_DATA_SECTION(16)
  
        .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
diff --combined arch/x86/lib/memcpy_64.S
index 7d37641ada5b9c6ccf80322ca7af5ffde33d190e,a0de849435ad69dda8b50e79c79a4bc9fc8d3d49..cbb8ee5830ff134f131533fd91ea8be35a853dba
@@@ -1,7 -1,7 +1,7 @@@
  /* Copyright 2002 Andi Kleen */
  
  #include <linux/linkage.h>
- #include <asm/cpufeature.h>
+ #include <asm/cpufeatures.h>
  #include <asm/alternative-asm.h>
  
  /*
@@@ -177,120 -177,3 +177,120 @@@ ENTRY(memcpy_orig
  .Lend:
        retq
  ENDPROC(memcpy_orig)
 +
 +#ifndef CONFIG_UML
 +/*
 + * memcpy_mcsafe - memory copy with machine check exception handling
 + * Note that we only catch machine checks when reading the source addresses.
 + * Writes to target are posted and don't generate machine checks.
 + */
 +ENTRY(memcpy_mcsafe)
 +      cmpl $8, %edx
 +      /* Less than 8 bytes? Go to byte copy loop */
 +      jb .L_no_whole_words
 +
 +      /* Check for bad alignment of source */
 +      testl $7, %esi
 +      /* Already aligned */
 +      jz .L_8byte_aligned
 +
 +      /* Copy one byte at a time until source is 8-byte aligned */
 +      movl %esi, %ecx
 +      andl $7, %ecx
 +      subl $8, %ecx
 +      negl %ecx
 +      subl %ecx, %edx
 +.L_copy_leading_bytes:
 +      movb (%rsi), %al
 +      movb %al, (%rdi)
 +      incq %rsi
 +      incq %rdi
 +      decl %ecx
 +      jnz .L_copy_leading_bytes
 +
 +.L_8byte_aligned:
 +      /* Figure out how many whole cache lines (64-bytes) to copy */
 +      movl %edx, %ecx
 +      andl $63, %edx
 +      shrl $6, %ecx
 +      jz .L_no_whole_cache_lines
 +
 +      /* Loop copying whole cache lines */
 +.L_cache_w0: movq (%rsi), %r8
 +.L_cache_w1: movq 1*8(%rsi), %r9
 +.L_cache_w2: movq 2*8(%rsi), %r10
 +.L_cache_w3: movq 3*8(%rsi), %r11
 +      movq %r8, (%rdi)
 +      movq %r9, 1*8(%rdi)
 +      movq %r10, 2*8(%rdi)
 +      movq %r11, 3*8(%rdi)
 +.L_cache_w4: movq 4*8(%rsi), %r8
 +.L_cache_w5: movq 5*8(%rsi), %r9
 +.L_cache_w6: movq 6*8(%rsi), %r10
 +.L_cache_w7: movq 7*8(%rsi), %r11
 +      movq %r8, 4*8(%rdi)
 +      movq %r9, 5*8(%rdi)
 +      movq %r10, 6*8(%rdi)
 +      movq %r11, 7*8(%rdi)
 +      leaq 64(%rsi), %rsi
 +      leaq 64(%rdi), %rdi
 +      decl %ecx
 +      jnz .L_cache_w0
 +
 +      /* Are there any trailing 8-byte words? */
 +.L_no_whole_cache_lines:
 +      movl %edx, %ecx
 +      andl $7, %edx
 +      shrl $3, %ecx
 +      jz .L_no_whole_words
 +
 +      /* Copy trailing words */
 +.L_copy_trailing_words:
 +      movq (%rsi), %r8
 +      mov %r8, (%rdi)
 +      leaq 8(%rsi), %rsi
 +      leaq 8(%rdi), %rdi
 +      decl %ecx
 +      jnz .L_copy_trailing_words
 +
 +      /* Any trailing bytes? */
 +.L_no_whole_words:
 +      andl %edx, %edx
 +      jz .L_done_memcpy_trap
 +
 +      /* Copy trailing bytes */
 +      movl %edx, %ecx
 +.L_copy_trailing_bytes:
 +      movb (%rsi), %al
 +      movb %al, (%rdi)
 +      incq %rsi
 +      incq %rdi
 +      decl %ecx
 +      jnz .L_copy_trailing_bytes
 +
 +      /* Copy successful. Return true */
 +.L_done_memcpy_trap:
 +      xorq %rax, %rax
 +      ret
 +ENDPROC(memcpy_mcsafe)
 +
 +      .section .fixup, "ax"
 +      /* Return false for any failure */
 +.L_memcpy_mcsafe_fail:
 +      mov     $1, %rax
 +      ret
 +
 +      .previous
 +
 +      _ASM_EXTABLE_FAULT(.L_copy_leading_bytes, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w0, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w1, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w3, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w4, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w5, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w6, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_cache_w7, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_copy_trailing_words, .L_memcpy_mcsafe_fail)
 +      _ASM_EXTABLE_FAULT(.L_copy_trailing_bytes, .L_memcpy_mcsafe_fail)
 +#endif
diff --combined include/linux/mm.h
index 2b6e22782699fc26b2f783c2519e0f4bf0c728d8,b1d4b8c7f7cdcddb4b2513f11bc4231c546baf25..3579d1e2fe3acd30bcf7733c356a8b018758391d
@@@ -387,8 -387,7 +387,8 @@@ enum 
        REGION_MIXED,
  };
  
 -int region_intersects(resource_size_t offset, size_t size, const char *type);
 +int region_intersects(resource_size_t offset, size_t size, unsigned long flags,
 +                    unsigned long desc);
  
  /* Support for virtually mapped pages */
  struct page *vmalloc_to_page(const void *addr);
@@@ -2139,6 -2138,8 +2139,8 @@@ int remap_pfn_range(struct vm_area_stru
  int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
  int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
                        unsigned long pfn);
+ int vm_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr,
+                       unsigned long pfn, pgprot_t pgprot);
  int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
                        pfn_t pfn);
  int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
This page took 0.230795 seconds and 4 git commands to generate.