Skip to content

Commit 0a646e9

Browse files
committed
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
2 parents f74a127 + 328008a commit 0a646e9

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

arch/x86/kernel/dumpstack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
109109
struct stack_info stack_info = {0};
110110
unsigned long visit_mask = 0;
111111
int graph_idx = 0;
112-
bool partial;
112+
bool partial = false;
113113

114114
printk("%sCall Trace:\n", log_lvl);
115115

arch/x86/kernel/relocate_kernel_64.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ relocate_kernel:
6868
movq %cr4, %rax
6969
movq %rax, CR4(%r11)
7070

71+
/* Save CR4. Required to enable the right paging mode later. */
72+
movq %rax, %r13
73+
7174
/* zero out flags, and disable interrupts */
7275
pushq $0
7376
popfq
@@ -126,8 +129,13 @@ identity_mapped:
126129
/*
127130
* Set cr4 to a known state:
128131
* - physical address extension enabled
132+
* - 5-level paging, if it was enabled before
129133
*/
130134
movl $X86_CR4_PAE, %eax
135+
testq $X86_CR4_LA57, %r13
136+
jz 1f
137+
orl $X86_CR4_LA57, %eax
138+
1:
131139
movq %rax, %cr4
132140

133141
jmp 1f

arch/x86/power/hibernate_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static inline void resume_init_first_level_page_table(pgd_t *pg_dir)
145145
#endif
146146
}
147147

148-
int swsusp_arch_resume(void)
148+
asmlinkage int swsusp_arch_resume(void)
149149
{
150150
int error;
151151

arch/x86/power/hibernate_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static int relocate_restore_code(void)
174174
return 0;
175175
}
176176

177-
int swsusp_arch_resume(void)
177+
asmlinkage int swsusp_arch_resume(void)
178178
{
179179
int error;
180180

include/linux/suspend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ extern int swsusp_page_is_forbidden(struct page *);
384384
extern void swsusp_set_page_free(struct page *);
385385
extern void swsusp_unset_page_free(struct page *);
386386
extern unsigned long get_safe_page(gfp_t gfp_mask);
387+
extern asmlinkage int swsusp_arch_suspend(void);
388+
extern asmlinkage int swsusp_arch_resume(void);
387389

388390
extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
389391
extern int hibernate(void);

kernel/power/power.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ extern int in_suspend;
104104
extern dev_t swsusp_resume_device;
105105
extern sector_t swsusp_resume_block;
106106

107-
extern asmlinkage int swsusp_arch_suspend(void);
108-
extern asmlinkage int swsusp_arch_resume(void);
109-
110107
extern int create_basic_memory_bitmaps(void);
111108
extern void free_basic_memory_bitmaps(void);
112109
extern int hibernate_preallocate_memory(void);

0 commit comments

Comments
 (0)