Re: [Xen-devel] [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Boris Ostrovsky
On 02/24/2016 12:26 PM, Andrew Cooper wrote: On 24/02/16 15:19, Boris Ostrovsky wrote: + /* Clear .bss */ + xor REG(ax),REG(ax) If we are nitpicking, This should be xor %eax, %eax even in 64bit. Functionally identical, and shorter to encode. Right, Brian Gerst pointed this out

Re: [Xen-devel] [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Boris Ostrovsky
On 02/24/2016 12:26 PM, Andrew Cooper wrote: On 24/02/16 15:19, Boris Ostrovsky wrote: + /* Clear .bss */ + xor REG(ax),REG(ax) If we are nitpicking, This should be xor %eax, %eax even in 64bit. Functionally identical, and shorter to encode. Right, Brian Gerst pointed this out

Re: [Xen-devel] [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Andrew Cooper
On 24/02/16 15:19, Boris Ostrovsky wrote: > Baremetal kernels clear .bss early in the boot but Xen PV guests don't > execute that code. They have been able to run without problems because > Xen domain builder happens to give out zeroed pages. However, since this > is not really guaranteed, .bss

Re: [Xen-devel] [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Andrew Cooper
On 24/02/16 15:19, Boris Ostrovsky wrote: > Baremetal kernels clear .bss early in the boot but Xen PV guests don't > execute that code. They have been able to run without problems because > Xen domain builder happens to give out zeroed pages. However, since this > is not really guaranteed, .bss

Re: [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Boris Ostrovsky
On 02/24/2016 11:05 AM, Brian Gerst wrote: Use the macros in instead of defining your own. Also, xorl %eax,%eax is good for 64-bit too, since the upper bits are cleared. I suspected this would have to be defined somewhere but couldn't find it. Thanks! -boris

Re: [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Boris Ostrovsky
On 02/24/2016 11:05 AM, Brian Gerst wrote: Use the macros in instead of defining your own. Also, xorl %eax,%eax is good for 64-bit too, since the upper bits are cleared. I suspected this would have to be defined somewhere but couldn't find it. Thanks! -boris

Re: [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Brian Gerst
On Wed, Feb 24, 2016 at 10:19 AM, Boris Ostrovsky wrote: > Baremetal kernels clear .bss early in the boot but Xen PV guests don't > execute that code. They have been able to run without problems because > Xen domain builder happens to give out zeroed pages. However,

Re: [PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Brian Gerst
On Wed, Feb 24, 2016 at 10:19 AM, Boris Ostrovsky wrote: > Baremetal kernels clear .bss early in the boot but Xen PV guests don't > execute that code. They have been able to run without problems because > Xen domain builder happens to give out zeroed pages. However, since this > is not really

[PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Boris Ostrovsky
Baremetal kernels clear .bss early in the boot but Xen PV guests don't execute that code. They have been able to run without problems because Xen domain builder happens to give out zeroed pages. However, since this is not really guaranteed, .bss should be explicitly cleared. (Since we introduce

[PATCH v2] xen/x86: Zero out .bss for PV guests

2016-02-24 Thread Boris Ostrovsky
Baremetal kernels clear .bss early in the boot but Xen PV guests don't execute that code. They have been able to run without problems because Xen domain builder happens to give out zeroed pages. However, since this is not really guaranteed, .bss should be explicitly cleared. (Since we introduce