* [PATCH] x86/kexec: Initialize the value of ident mapping offset
@ 2020-11-06 3:30 Hewenliang
2020-11-06 15:22 ` Borislav Petkov
0 siblings, 1 reply; 2+ messages in thread
From: Hewenliang @ 2020-11-06 3:30 UTC (permalink / raw)
To: tglx, mingo, bp, hpa, osandov, rppt, lijiang, linux-kernel
Cc: hewenliang4, hushiyuan
From: hewenliang <hewenliang4@huawei.com>
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.
Signed-off-by: hewenliang <hewenliang4@huawei.com>
---
arch/x86/kernel/machine_kexec_64.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index a29a44a98e5b..101cbce893e4 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -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;
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/kexec: Initialize the value of ident mapping offset
2020-11-06 3:30 [PATCH] x86/kexec: Initialize the value of ident mapping offset Hewenliang
@ 2020-11-06 15:22 ` Borislav Petkov
0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2020-11-06 15:22 UTC (permalink / raw)
To: Hewenliang
Cc: tglx, mingo, hpa, osandov, rppt, lijiang, linux-kernel, hushiyuan
On Thu, Nov 05, 2020 at 10:30:05PM -0500, Hewenliang wrote:
> From: hewenliang <hewenliang4@huawei.com>
>
> It is necessary to initialize the value of ident mapping offset.
Why is it necessary?
> 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.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-06 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-06 3:30 [PATCH] x86/kexec: Initialize the value of ident mapping offset Hewenliang
2020-11-06 15:22 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox