Clear .bss for PV guests
Subsystems (2)
Boris Ostrovsky
reviewerv4 cover Clear .bss for PV guests
PV guests need to have their .bss zeroed out since it is not guaranteed to be cleared by Xen's domain builder (even if it is done so currently)
v4:
* Better use of mode-selecting macros.
* Drop stable tag.
* Update commit message for patch 1.
Boris Ostrovsky (2):
xen/x86: Zero out .bss for PV guests xen/x86: Drop mode-selecting ifdefs in startup_xen()
arch/x86/xen/xen-head.S | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
Signature · 1 line
2.1.0
Boris Ostrovsky
reviewerPATCH v4 1/2 xen/x86: Zero out .bss for PV guests
ELF spec is unclear about whether .bss must me cleared by the loader. Currently the domain builder does it when loading the guest but because it is not (or rather may not be) guaranteed we should zero it out explicitly.
--- arch/x86/xen/xen-head.S | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/x86/xen/xen-head.S +9 -0
@@ -38,6 +38,15 @@ __INIT ENTRY(startup_xen) cld + + /* Clear .bss */ + xor %eax,%eax + mov $__bss_start, %_ASM_DI + mov $__bss_stop, %_ASM_CX + sub %_ASM_DI, %_ASM_CX + shr $__ASM_SEL(2, 3), %_ASM_CX + rep __ASM_SIZE(stos) + #ifdef CONFIG_X86_32 mov %esi,xen_start_info mov $init_thread_union+THREAD_SIZE,%esp
Signature · 7 lines
2.1.0 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerPATCH v4 2/2 xen/x86: Drop mode-selecting ifdefs in startup_xen()
In reply to Boris OstrovskyUse asm/asm.h macros instead.
--- arch/x86/xen/xen-head.S | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
arch/x86/xen/xen-head.S +3 -7
@@ -47,13 +47,9 @@ ENTRY(startup_xen) shr $__ASM_SEL(2, 3), %_ASM_CX rep __ASM_SIZE(stos) -#ifdef CONFIG_X86_32 - mov %esi,xen_start_info - mov $init_thread_union+THREAD_SIZE,%esp -#else - mov %rsi,xen_start_info - mov $init_thread_union+THREAD_SIZE,%rsp -#endif + mov %_ASM_SI, xen_start_info + mov $init_thread_union+THREAD_SIZE, %_ASM_SP + jmp xen_start_kernel __FINIT
Signature · 1 line
2.1.0
Boris Ostrovsky
reviewerPATCH v4 2/2 xen/x86: Drop mode-selecting ifdefs in startup_xen()
In reply to Boris OstrovskyUse asm/asm.h macros instead.
--- arch/x86/xen/xen-head.S | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
arch/x86/xen/xen-head.S +3 -7
@@ -47,13 +47,9 @@ ENTRY(startup_xen) shr $__ASM_SEL(2, 3), %_ASM_CX rep __ASM_SIZE(stos) -#ifdef CONFIG_X86_32 - mov %esi,xen_start_info - mov $init_thread_union+THREAD_SIZE,%esp -#else - mov %rsi,xen_start_info - mov $init_thread_union+THREAD_SIZE,%rsp -#endif + mov %_ASM_SI, xen_start_info + mov $init_thread_union+THREAD_SIZE, %_ASM_SP + jmp xen_start_kernel __FINIT
Signature · 7 lines
2.1.0 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerPATCH v4 1/2 xen/x86: Zero out .bss for PV guests
In reply to Boris OstrovskyELF spec is unclear about whether .bss must me cleared by the loader. Currently the domain builder does it when loading the guest but because it is not (or rather may not be) guaranteed we should zero it out explicitly.
--- arch/x86/xen/xen-head.S | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/x86/xen/xen-head.S +9 -0
@@ -38,6 +38,15 @@ __INIT ENTRY(startup_xen) cld + + /* Clear .bss */ + xor %eax,%eax + mov $__bss_start, %_ASM_DI + mov $__bss_stop, %_ASM_CX + sub %_ASM_DI, %_ASM_CX + shr $__ASM_SEL(2, 3), %_ASM_CX + rep __ASM_SIZE(stos) + #ifdef CONFIG_X86_32 mov %esi,xen_start_info mov $init_thread_union+THREAD_SIZE,%esp
Signature · 1 line
2.1.0
David Vrabel
AppliedQuoted 2 lines · Boris Ostrovsky
PV guests need to have their .bss zeroed out since it is not guaranteed to be cleared by Xen's domain builder (even if it is done so currently)
Applied to for-linus-4.6, thanks.
David
David Vrabel
AppliedQuoted 2 lines · Boris Ostrovsky
PV guests need to have their .bss zeroed out since it is not guaranteed to be cleared by Xen's domain builder (even if it is done so currently)
Applied to for-linus-4.6, thanks.
David
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel