aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/events/intel/cstate.c4
-rw-r--r--arch/x86/events/intel/rapl.c3
-rw-r--r--arch/x86/events/intel/uncore_snbep.c4
-rw-r--r--arch/x86/events/msr.c8
-rw-r--r--arch/x86/include/asm/asm.h8
-rw-r--r--arch/x86/include/asm/thread_info.h11
-rw-r--r--arch/x86/include/asm/uaccess.h2
-rw-r--r--arch/x86/kernel/irq_32.c6
-rw-r--r--arch/x86/kernel/ksysfs.c2
-rw-r--r--arch/x86/kernel/traps.c2
-rw-r--r--arch/x86/mm/fault.c47
-rw-r--r--arch/x86/mm/mem_encrypt.c2
-rw-r--r--arch/x86/mm/tlb.c2
-rw-r--r--drivers/clocksource/numachip.c2
14 files changed, 56 insertions, 47 deletions
diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
index 4cf100ff2a37..72db0664a53d 100644
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -552,6 +552,7 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {
552 552
553 X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_MOBILE, snb_cstates), 553 X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_MOBILE, snb_cstates),
554 X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_DESKTOP, snb_cstates), 554 X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_DESKTOP, snb_cstates),
555 X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_X, snb_cstates),
555 556
556 X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_MOBILE, snb_cstates), 557 X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_MOBILE, snb_cstates),
557 X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_DESKTOP, snb_cstates), 558 X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_DESKTOP, snb_cstates),
@@ -560,6 +561,9 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {
560 X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNM, knl_cstates), 561 X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNM, knl_cstates),
561 562
562 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT, glm_cstates), 563 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT, glm_cstates),
564 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_DENVERTON, glm_cstates),
565
566 X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GEMINI_LAKE, glm_cstates),
563 { }, 567 { },
564}; 568};
565MODULE_DEVICE_TABLE(x86cpu, intel_cstates_match); 569MODULE_DEVICE_TABLE(x86cpu, intel_cstates_match);
diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index 8e2457cb6b4a..005908ee9333 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -775,6 +775,9 @@ static const struct x86_cpu_id rapl_cpu_match[] __initconst = {
775 X86_RAPL_MODEL_MATCH(INTEL_FAM6_KABYLAKE_DESKTOP, skl_rapl_init), 775 X86_RAPL_MODEL_MATCH(INTEL_FAM6_KABYLAKE_DESKTOP, skl_rapl_init),
776 776
777 X86_RAPL_MODEL_MATCH(INTEL_FAM6_ATOM_GOLDMONT, hsw_rapl_init), 777 X86_RAPL_MODEL_MATCH(INTEL_FAM6_ATOM_GOLDMONT, hsw_rapl_init),
778 X86_RAPL_MODEL_MATCH(INTEL_FAM6_ATOM_DENVERTON, hsw_rapl_init),
779
780 X86_RAPL_MODEL_MATCH(INTEL_FAM6_ATOM_GEMINI_LAKE, hsw_rapl_init),
778 {}, 781 {},
779}; 782};
780 783
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index db1fe377e6dd..a7196818416a 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3462,7 +3462,7 @@ static struct intel_uncore_ops skx_uncore_iio_ops = {
3462static struct intel_uncore_type skx_uncore_iio = { 3462static struct intel_uncore_type skx_uncore_iio = {
3463 .name = "iio", 3463 .name = "iio",
3464 .num_counters = 4, 3464 .num_counters = 4,
3465 .num_boxes = 5, 3465 .num_boxes = 6,
3466 .perf_ctr_bits = 48, 3466 .perf_ctr_bits = 48,
3467 .event_ctl = SKX_IIO0_MSR_PMON_CTL0, 3467 .event_ctl = SKX_IIO0_MSR_PMON_CTL0,
3468 .perf_ctr = SKX_IIO0_MSR_PMON_CTR0, 3468 .perf_ctr = SKX_IIO0_MSR_PMON_CTR0,
@@ -3492,7 +3492,7 @@ static const struct attribute_group skx_uncore_format_group = {
3492static struct intel_uncore_type skx_uncore_irp = { 3492static struct intel_uncore_type skx_uncore_irp = {
3493 .name = "irp", 3493 .name = "irp",
3494 .num_counters = 2, 3494 .num_counters = 2,
3495 .num_boxes = 5, 3495 .num_boxes = 6,
3496 .perf_ctr_bits = 48, 3496 .perf_ctr_bits = 48,
3497 .event_ctl = SKX_IRP0_MSR_PMON_CTL0, 3497 .event_ctl = SKX_IRP0_MSR_PMON_CTL0,
3498 .perf_ctr = SKX_IRP0_MSR_PMON_CTR0, 3498 .perf_ctr = SKX_IRP0_MSR_PMON_CTR0,
diff --git a/arch/x86/events/msr.c b/arch/x86/events/msr.c
index 4bb3ec69e8ea..06723671ae4e 100644
--- a/arch/x86/events/msr.c
+++ b/arch/x86/events/msr.c
@@ -63,6 +63,14 @@ static bool test_intel(int idx)
63 case INTEL_FAM6_ATOM_SILVERMONT1: 63 case INTEL_FAM6_ATOM_SILVERMONT1:
64 case INTEL_FAM6_ATOM_SILVERMONT2: 64 case INTEL_FAM6_ATOM_SILVERMONT2:
65 case INTEL_FAM6_ATOM_AIRMONT: 65 case INTEL_FAM6_ATOM_AIRMONT:
66
67 case INTEL_FAM6_ATOM_GOLDMONT:
68 case INTEL_FAM6_ATOM_DENVERTON:
69
70 case INTEL_FAM6_ATOM_GEMINI_LAKE:
71
72 case INTEL_FAM6_XEON_PHI_KNL:
73 case INTEL_FAM6_XEON_PHI_KNM:
66 if (idx == PERF_MSR_SMI) 74 if (idx == PERF_MSR_SMI)
67 return true; 75 return true;
68 break; 76 break;
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index c1eadbaf1115..b0dc91f4bedc 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -11,10 +11,12 @@
11# define __ASM_FORM_COMMA(x) " " #x "," 11# define __ASM_FORM_COMMA(x) " " #x ","
12#endif 12#endif
13 13
14#ifdef CONFIG_X86_32 14#ifndef __x86_64__
15/* 32 bit */
15# define __ASM_SEL(a,b) __ASM_FORM(a) 16# define __ASM_SEL(a,b) __ASM_FORM(a)
16# define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(a) 17# define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(a)
17#else 18#else
19/* 64 bit */
18# define __ASM_SEL(a,b) __ASM_FORM(b) 20# define __ASM_SEL(a,b) __ASM_FORM(b)
19# define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(b) 21# define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(b)
20#endif 22#endif
@@ -139,8 +141,8 @@
139 * gets set up by the containing function. If you forget to do this, objtool 141 * gets set up by the containing function. If you forget to do this, objtool
140 * may print a "call without frame pointer save/setup" warning. 142 * may print a "call without frame pointer save/setup" warning.
141 */ 143 */
142register unsigned int __asm_call_sp asm("esp"); 144register unsigned long current_stack_pointer asm(_ASM_SP);
143#define ASM_CALL_CONSTRAINT "+r" (__asm_call_sp) 145#define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer)
144#endif 146#endif
145 147
146#endif /* _ASM_X86_ASM_H */ 148#endif /* _ASM_X86_ASM_H */
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 5161da1a0fa0..89e7eeb5cec1 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -158,17 +158,6 @@ struct thread_info {
158 */ 158 */
159#ifndef __ASSEMBLY__ 159#ifndef __ASSEMBLY__
160 160
161static inline unsigned long current_stack_pointer(void)
162{
163 unsigned long sp;
164#ifdef CONFIG_X86_64
165 asm("mov %%rsp,%0" : "=g" (sp));
166#else
167 asm("mov %%esp,%0" : "=g" (sp));
168#endif
169 return sp;
170}
171
172/* 161/*
173 * Walks up the stack frames to make sure that the specified object is 162 * Walks up the stack frames to make sure that the specified object is
174 * entirely contained by a single stack frame. 163 * entirely contained by a single stack frame.
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 78e8fcc87d4c..4b892917edeb 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -337,7 +337,7 @@ do { \
337 _ASM_EXTABLE(1b, 4b) \ 337 _ASM_EXTABLE(1b, 4b) \
338 _ASM_EXTABLE(2b, 4b) \ 338 _ASM_EXTABLE(2b, 4b) \
339 : "=r" (retval), "=&A"(x) \ 339 : "=r" (retval), "=&A"(x) \
340 : "m" (__m(__ptr)), "m" __m(((u32 *)(__ptr)) + 1), \ 340 : "m" (__m(__ptr)), "m" __m(((u32 __user *)(__ptr)) + 1), \
341 "i" (errret), "0" (retval)); \ 341 "i" (errret), "0" (retval)); \
342}) 342})
343 343
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 1f38d9a4d9de..d4eb450144fd 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -64,7 +64,7 @@ static void call_on_stack(void *func, void *stack)
64 64
65static inline void *current_stack(void) 65static inline void *current_stack(void)
66{ 66{
67 return (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1)); 67 return (void *)(current_stack_pointer & ~(THREAD_SIZE - 1));
68} 68}
69 69
70static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc) 70static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc)
@@ -88,7 +88,7 @@ static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc)
88 88
89 /* Save the next esp at the bottom of the stack */ 89 /* Save the next esp at the bottom of the stack */
90 prev_esp = (u32 *)irqstk; 90 prev_esp = (u32 *)irqstk;
91 *prev_esp = current_stack_pointer(); 91 *prev_esp = current_stack_pointer;
92 92
93 if (unlikely(overflow)) 93 if (unlikely(overflow))
94 call_on_stack(print_stack_overflow, isp); 94 call_on_stack(print_stack_overflow, isp);
@@ -139,7 +139,7 @@ void do_softirq_own_stack(void)
139 139
140 /* Push the previous esp onto the stack */ 140 /* Push the previous esp onto the stack */
141 prev_esp = (u32 *)irqstk; 141 prev_esp = (u32 *)irqstk;
142 *prev_esp = current_stack_pointer(); 142 *prev_esp = current_stack_pointer;
143 143
144 call_on_stack(__do_softirq, isp); 144 call_on_stack(__do_softirq, isp);
145} 145}
diff --git a/arch/x86/kernel/ksysfs.c b/arch/x86/kernel/ksysfs.c
index 4b0592ca9e47..8c1cc08f514f 100644
--- a/arch/x86/kernel/ksysfs.c
+++ b/arch/x86/kernel/ksysfs.c
@@ -299,7 +299,7 @@ static int __init create_setup_data_nodes(struct kobject *parent)
299 return 0; 299 return 0;
300 300
301out_clean_nodes: 301out_clean_nodes:
302 for (j = i - 1; j > 0; j--) 302 for (j = i - 1; j >= 0; j--)
303 cleanup_setup_data_node(*(kobjp + j)); 303 cleanup_setup_data_node(*(kobjp + j));
304 kfree(kobjp); 304 kfree(kobjp);
305out_setup_data_kobj: 305out_setup_data_kobj:
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 34ea3651362e..67db4f43309e 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -142,7 +142,7 @@ void ist_begin_non_atomic(struct pt_regs *regs)
142 * from double_fault. 142 * from double_fault.
143 */ 143 */
144 BUG_ON((unsigned long)(current_top_of_stack() - 144 BUG_ON((unsigned long)(current_top_of_stack() -
145 current_stack_pointer()) >= THREAD_SIZE); 145 current_stack_pointer) >= THREAD_SIZE);
146 146
147 preempt_enable_no_resched(); 147 preempt_enable_no_resched();
148} 148}
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 39567b5c33da..e2baeaa053a5 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -192,8 +192,7 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr)
192 * 6. T1 : reaches here, sees vma_pkey(vma)=5, when we really 192 * 6. T1 : reaches here, sees vma_pkey(vma)=5, when we really
193 * faulted on a pte with its pkey=4. 193 * faulted on a pte with its pkey=4.
194 */ 194 */
195static void fill_sig_info_pkey(int si_code, siginfo_t *info, 195static void fill_sig_info_pkey(int si_code, siginfo_t *info, u32 *pkey)
196 struct vm_area_struct *vma)
197{ 196{
198 /* This is effectively an #ifdef */ 197 /* This is effectively an #ifdef */
199 if (!boot_cpu_has(X86_FEATURE_OSPKE)) 198 if (!boot_cpu_has(X86_FEATURE_OSPKE))
@@ -209,7 +208,7 @@ static void fill_sig_info_pkey(int si_code, siginfo_t *info,
209 * valid VMA, so we should never reach this without a 208 * valid VMA, so we should never reach this without a
210 * valid VMA. 209 * valid VMA.
211 */ 210 */
212 if (!vma) { 211 if (!pkey) {
213 WARN_ONCE(1, "PKU fault with no VMA passed in"); 212 WARN_ONCE(1, "PKU fault with no VMA passed in");
214 info->si_pkey = 0; 213 info->si_pkey = 0;
215 return; 214 return;
@@ -219,13 +218,12 @@ static void fill_sig_info_pkey(int si_code, siginfo_t *info,
219 * absolutely guranteed to be 100% accurate because of 218 * absolutely guranteed to be 100% accurate because of
220 * the race explained above. 219 * the race explained above.
221 */ 220 */
222 info->si_pkey = vma_pkey(vma); 221 info->si_pkey = *pkey;
223} 222}
224 223
225static void 224static void
226force_sig_info_fault(int si_signo, int si_code, unsigned long address, 225force_sig_info_fault(int si_signo, int si_code, unsigned long address,
227 struct task_struct *tsk, struct vm_area_struct *vma, 226 struct task_struct *tsk, u32 *pkey, int fault)
228 int fault)
229{ 227{
230 unsigned lsb = 0; 228 unsigned lsb = 0;
231 siginfo_t info; 229 siginfo_t info;
@@ -240,7 +238,7 @@ force_sig_info_fault(int si_signo, int si_code, unsigned long address,
240 lsb = PAGE_SHIFT; 238 lsb = PAGE_SHIFT;
241 info.si_addr_lsb = lsb; 239 info.si_addr_lsb = lsb;
242 240
243 fill_sig_info_pkey(si_code, &info, vma); 241 fill_sig_info_pkey(si_code, &info, pkey);
244 242
245 force_sig_info(si_signo, &info, tsk); 243 force_sig_info(si_signo, &info, tsk);
246} 244}
@@ -762,8 +760,6 @@ no_context(struct pt_regs *regs, unsigned long error_code,
762 struct task_struct *tsk = current; 760 struct task_struct *tsk = current;
763 unsigned long flags; 761 unsigned long flags;
764 int sig; 762 int sig;
765 /* No context means no VMA to pass down */
766 struct vm_area_struct *vma = NULL;
767 763
768 /* Are we prepared to handle this kernel fault? */ 764 /* Are we prepared to handle this kernel fault? */
769 if (fixup_exception(regs, X86_TRAP_PF)) { 765 if (fixup_exception(regs, X86_TRAP_PF)) {
@@ -788,7 +784,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
788 784
789 /* XXX: hwpoison faults will set the wrong code. */ 785 /* XXX: hwpoison faults will set the wrong code. */
790 force_sig_info_fault(signal, si_code, address, 786 force_sig_info_fault(signal, si_code, address,
791 tsk, vma, 0); 787 tsk, NULL, 0);
792 } 788 }
793 789
794 /* 790 /*
@@ -896,8 +892,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,
896 892
897static void 893static void
898__bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, 894__bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
899 unsigned long address, struct vm_area_struct *vma, 895 unsigned long address, u32 *pkey, int si_code)
900 int si_code)
901{ 896{
902 struct task_struct *tsk = current; 897 struct task_struct *tsk = current;
903 898
@@ -945,7 +940,7 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
945 tsk->thread.error_code = error_code; 940 tsk->thread.error_code = error_code;
946 tsk->thread.trap_nr = X86_TRAP_PF; 941 tsk->thread.trap_nr = X86_TRAP_PF;
947 942
948 force_sig_info_fault(SIGSEGV, si_code, address, tsk, vma, 0); 943 force_sig_info_fault(SIGSEGV, si_code, address, tsk, pkey, 0);
949 944
950 return; 945 return;
951 } 946 }
@@ -958,9 +953,9 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
958 953
959static noinline void 954static noinline void
960bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, 955bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
961 unsigned long address, struct vm_area_struct *vma) 956 unsigned long address, u32 *pkey)
962{ 957{
963 __bad_area_nosemaphore(regs, error_code, address, vma, SEGV_MAPERR); 958 __bad_area_nosemaphore(regs, error_code, address, pkey, SEGV_MAPERR);
964} 959}
965 960
966static void 961static void
@@ -968,6 +963,10 @@ __bad_area(struct pt_regs *regs, unsigned long error_code,
968 unsigned long address, struct vm_area_struct *vma, int si_code) 963 unsigned long address, struct vm_area_struct *vma, int si_code)
969{ 964{
970 struct mm_struct *mm = current->mm; 965 struct mm_struct *mm = current->mm;
966 u32 pkey;
967
968 if (vma)
969 pkey = vma_pkey(vma);
971 970
972 /* 971 /*
973 * Something tried to access memory that isn't in our memory map.. 972 * Something tried to access memory that isn't in our memory map..
@@ -975,7 +974,8 @@ __bad_area(struct pt_regs *regs, unsigned long error_code,
975 */ 974 */
976 up_read(&mm->mmap_sem); 975 up_read(&mm->mmap_sem);
977 976
978 __bad_area_nosemaphore(regs, error_code, address, vma, si_code); 977 __bad_area_nosemaphore(regs, error_code, address,
978 (vma) ? &pkey : NULL, si_code);
979} 979}
980 980
981static noinline void 981static noinline void
@@ -1018,7 +1018,7 @@ bad_area_access_error(struct pt_regs *regs, unsigned long error_code,
1018 1018
1019static void 1019static void
1020do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address, 1020do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
1021 struct vm_area_struct *vma, unsigned int fault) 1021 u32 *pkey, unsigned int fault)
1022{ 1022{
1023 struct task_struct *tsk = current; 1023 struct task_struct *tsk = current;
1024 int code = BUS_ADRERR; 1024 int code = BUS_ADRERR;
@@ -1045,13 +1045,12 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
1045 code = BUS_MCEERR_AR; 1045 code = BUS_MCEERR_AR;
1046 } 1046 }
1047#endif 1047#endif
1048 force_sig_info_fault(SIGBUS, code, address, tsk, vma, fault); 1048 force_sig_info_fault(SIGBUS, code, address, tsk, pkey, fault);
1049} 1049}
1050 1050
1051static noinline void 1051static noinline void
1052mm_fault_error(struct pt_regs *regs, unsigned long error_code, 1052mm_fault_error(struct pt_regs *regs, unsigned long error_code,
1053 unsigned long address, struct vm_area_struct *vma, 1053 unsigned long address, u32 *pkey, unsigned int fault)
1054 unsigned int fault)
1055{ 1054{
1056 if (fatal_signal_pending(current) && !(error_code & PF_USER)) { 1055 if (fatal_signal_pending(current) && !(error_code & PF_USER)) {
1057 no_context(regs, error_code, address, 0, 0); 1056 no_context(regs, error_code, address, 0, 0);
@@ -1075,9 +1074,9 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
1075 } else { 1074 } else {
1076 if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON| 1075 if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|
1077 VM_FAULT_HWPOISON_LARGE)) 1076 VM_FAULT_HWPOISON_LARGE))
1078 do_sigbus(regs, error_code, address, vma, fault); 1077 do_sigbus(regs, error_code, address, pkey, fault);
1079 else if (fault & VM_FAULT_SIGSEGV) 1078 else if (fault & VM_FAULT_SIGSEGV)
1080 bad_area_nosemaphore(regs, error_code, address, vma); 1079 bad_area_nosemaphore(regs, error_code, address, pkey);
1081 else 1080 else
1082 BUG(); 1081 BUG();
1083 } 1082 }
@@ -1267,6 +1266,7 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
1267 struct mm_struct *mm; 1266 struct mm_struct *mm;
1268 int fault, major = 0; 1267 int fault, major = 0;
1269 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; 1268 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
1269 u32 pkey;
1270 1270
1271 tsk = current; 1271 tsk = current;
1272 mm = tsk->mm; 1272 mm = tsk->mm;
@@ -1467,9 +1467,10 @@ good_area:
1467 return; 1467 return;
1468 } 1468 }
1469 1469
1470 pkey = vma_pkey(vma);
1470 up_read(&mm->mmap_sem); 1471 up_read(&mm->mmap_sem);
1471 if (unlikely(fault & VM_FAULT_ERROR)) { 1472 if (unlikely(fault & VM_FAULT_ERROR)) {
1472 mm_fault_error(regs, error_code, address, vma, fault); 1473 mm_fault_error(regs, error_code, address, &pkey, fault);
1473 return; 1474 return;
1474 } 1475 }
1475 1476
diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index 3fcc8e01683b..16c5f37933a2 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -10,6 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#define DISABLE_BRANCH_PROFILING
14
13#include <linux/linkage.h> 15#include <linux/linkage.h>
14#include <linux/init.h> 16#include <linux/init.h>
15#include <linux/mm.h> 17#include <linux/mm.h>
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 93fe97cce581..49d9778376d7 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -191,7 +191,7 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
191 * mapped in the new pgd, we'll double-fault. Forcibly 191 * mapped in the new pgd, we'll double-fault. Forcibly
192 * map it. 192 * map it.
193 */ 193 */
194 unsigned int index = pgd_index(current_stack_pointer()); 194 unsigned int index = pgd_index(current_stack_pointer);
195 pgd_t *pgd = next->pgd + index; 195 pgd_t *pgd = next->pgd + index;
196 196
197 if (unlikely(pgd_none(*pgd))) 197 if (unlikely(pgd_none(*pgd)))
diff --git a/drivers/clocksource/numachip.c b/drivers/clocksource/numachip.c
index 6a20dc8b253f..9a7d7f0f23fe 100644
--- a/drivers/clocksource/numachip.c
+++ b/drivers/clocksource/numachip.c
@@ -43,7 +43,7 @@ static int numachip2_set_next_event(unsigned long delta, struct clock_event_devi
43 return 0; 43 return 0;
44} 44}
45 45
46static struct clock_event_device numachip2_clockevent = { 46static const struct clock_event_device numachip2_clockevent __initconst = {
47 .name = "numachip2", 47 .name = "numachip2",
48 .rating = 400, 48 .rating = 400,
49 .set_next_event = numachip2_set_next_event, 49 .set_next_event = numachip2_set_next_event,