aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-04 14:43:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-04 14:43:30 -0500
commit0a646e9c992e4846665dc995c86f30c599cda64c (patch)
treec403485e5093b1016e5c70ce04a555201e7056f3
parentf74a127f667faa9691ed3c4d584134a7a21a8647 (diff)
parent328008a72d38b5bde6491e463405c34a81a65d3e (diff)
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner: "A small set of changes: - a fixup for kexec related to 5-level paging mode. That covers most of the cases except kexec from a 5-level kernel to a 4-level kernel. The latter needs more work and is going to come in 4.17 - two trivial fixes for build warnings triggered by LTO and gcc-8" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/power: Fix swsusp_arch_resume prototype x86/dumpstack: Avoid uninitlized variable x86/kexec: Make kexec (mostly) work in 5-level paging mode
-rw-r--r--arch/x86/kernel/dumpstack.c2
-rw-r--r--arch/x86/kernel/relocate_kernel_64.S8
-rw-r--r--arch/x86/power/hibernate_32.c2
-rw-r--r--arch/x86/power/hibernate_64.c2
-rw-r--r--include/linux/suspend.h2
-rw-r--r--kernel/power/power.h3
6 files changed, 13 insertions, 6 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index afbecff161d1..a2d8a3908670 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -109,7 +109,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
109 struct stack_info stack_info = {0}; 109 struct stack_info stack_info = {0};
110 unsigned long visit_mask = 0; 110 unsigned long visit_mask = 0;
111 int graph_idx = 0; 111 int graph_idx = 0;
112 bool partial; 112 bool partial = false;
113 113
114 printk("%sCall Trace:\n", log_lvl); 114 printk("%sCall Trace:\n", log_lvl);
115 115
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index 307d3bac5f04..11eda21eb697 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -68,6 +68,9 @@ relocate_kernel:
68 movq %cr4, %rax 68 movq %cr4, %rax
69 movq %rax, CR4(%r11) 69 movq %rax, CR4(%r11)
70 70
71 /* Save CR4. Required to enable the right paging mode later. */
72 movq %rax, %r13
73
71 /* zero out flags, and disable interrupts */ 74 /* zero out flags, and disable interrupts */
72 pushq $0 75 pushq $0
73 popfq 76 popfq
@@ -126,8 +129,13 @@ identity_mapped:
126 /* 129 /*
127 * Set cr4 to a known state: 130 * Set cr4 to a known state:
128 * - physical address extension enabled 131 * - physical address extension enabled
132 * - 5-level paging, if it was enabled before
129 */ 133 */
130 movl $X86_CR4_PAE, %eax 134 movl $X86_CR4_PAE, %eax
135 testq $X86_CR4_LA57, %r13
136 jz 1f
137 orl $X86_CR4_LA57, %eax
1381:
131 movq %rax, %cr4 139 movq %rax, %cr4
132 140
133 jmp 1f 141 jmp 1f
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
index c35fdb585c68..afc4ed7b1578 100644
--- a/arch/x86/power/hibernate_32.c
+++ b/arch/x86/power/hibernate_32.c
@@ -145,7 +145,7 @@ static inline void resume_init_first_level_page_table(pgd_t *pg_dir)
145#endif 145#endif
146} 146}
147 147
148int swsusp_arch_resume(void) 148asmlinkage int swsusp_arch_resume(void)
149{ 149{
150 int error; 150 int error;
151 151
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c
index f910c514438f..0ef5e5204968 100644
--- a/arch/x86/power/hibernate_64.c
+++ b/arch/x86/power/hibernate_64.c
@@ -174,7 +174,7 @@ out:
174 return 0; 174 return 0;
175} 175}
176 176
177int swsusp_arch_resume(void) 177asmlinkage int swsusp_arch_resume(void)
178{ 178{
179 int error; 179 int error;
180 180
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cc22a24516d6..440b62f7502e 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -384,6 +384,8 @@ extern int swsusp_page_is_forbidden(struct page *);
384extern void swsusp_set_page_free(struct page *); 384extern void swsusp_set_page_free(struct page *);
385extern void swsusp_unset_page_free(struct page *); 385extern void swsusp_unset_page_free(struct page *);
386extern unsigned long get_safe_page(gfp_t gfp_mask); 386extern unsigned long get_safe_page(gfp_t gfp_mask);
387extern asmlinkage int swsusp_arch_suspend(void);
388extern asmlinkage int swsusp_arch_resume(void);
387 389
388extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); 390extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
389extern int hibernate(void); 391extern int hibernate(void);
diff --git a/kernel/power/power.h b/kernel/power/power.h
index f29cd178df90..9e58bdc8a562 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -104,9 +104,6 @@ extern int in_suspend;
104extern dev_t swsusp_resume_device; 104extern dev_t swsusp_resume_device;
105extern sector_t swsusp_resume_block; 105extern sector_t swsusp_resume_block;
106 106
107extern asmlinkage int swsusp_arch_suspend(void);
108extern asmlinkage int swsusp_arch_resume(void);
109
110extern int create_basic_memory_bitmaps(void); 107extern int create_basic_memory_bitmaps(void);
111extern void free_basic_memory_bitmaps(void); 108extern void free_basic_memory_bitmaps(void);
112extern int hibernate_preallocate_memory(void); 109extern int hibernate_preallocate_memory(void);