diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 08:09:40 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 08:09:40 -0800 |
commit | ba4b60e85d6c5fc2242fd24e131a47fb922e5d89 (patch) | |
tree | 6be918ce3924d0677bc1029f7d1255fef48a8f85 /arch/x86/mm/fault.c | |
parent | 5dba4c56dfa660a85dc8e897990948cdec3734bf (diff) | |
parent | 6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff) | |
download | talos-obmc-linux-ba4b60e85d6c5fc2242fd24e131a47fb922e5d89.tar.gz talos-obmc-linux-ba4b60e85d6c5fc2242fd24e131a47fb922e5d89.zip |
Merge 3.14-rc3 into char-misc-next
We need the fixes here for future mei and other patches.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 9d591c895803..6dea040cc3a1 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -1001,6 +1001,12 @@ static int fault_in_kernel_space(unsigned long address) static inline bool smap_violation(int error_code, struct pt_regs *regs) { + if (!IS_ENABLED(CONFIG_X86_SMAP)) + return false; + + if (!static_cpu_has(X86_FEATURE_SMAP)) + return false; + if (error_code & PF_USER) return false; @@ -1087,11 +1093,9 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) if (unlikely(error_code & PF_RSVD)) pgtable_bad(regs, error_code, address); - if (static_cpu_has(X86_FEATURE_SMAP)) { - if (unlikely(smap_violation(error_code, regs))) { - bad_area_nosemaphore(regs, error_code, address); - return; - } + if (unlikely(smap_violation(error_code, regs))) { + bad_area_nosemaphore(regs, error_code, address); + return; } /* |