Skip to contentSkip to conversation

x86/kexec: Initialize the value of ident mapping offset

PATCH In review Hewenliang 2 participants 2 messages Nov 6, 2020 x86

lore
Share & tools
lore

Hewenliang

author
#0 lore raw

PATCH 1/1 x86/kexec: Initialize the value of ident mapping offset

From: hewenliang <[email protected]>

It is necessary to initialize the value of ident mapping offset. This can not only avoid using dirty data, but also improve the code readability when we using the variable of offset.

---
 arch/x86/kernel/machine_kexec_64.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/machine_kexec_64.c +1 -0
index a29a44a98e5b..101cbce893e4 100644
@@ -196,6 +196,7 @@ static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
 		.alloc_pgt_page	= alloc_pgt_page,
 		.context	= image,
 		.page_flag	= __PAGE_KERNEL_LARGE_EXEC,
+		.offset		= 0,
 		.kernpg_flag	= _KERNPG_TABLE_NOENC,
 	};
 	unsigned long mstart, mend;
Signature · 1 line
2.19.1
maintainer
#1 lore raw
Quoted 3 lines · Hewenliang

From: hewenliang <[email protected]>

It is necessary to initialize the value of ident mapping offset.

Why is it necessary?

Quoted 1 line

This can not only avoid using dirty data,

What happens to designated initializers when some of the members are not explicitly mentioned?

Hint:

$ make arch/x86/kernel/machine_kexec_64.s

and look at that file before your patch.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette