From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422893AbcBZTD0 (ORCPT ); Fri, 26 Feb 2016 14:03:26 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:26021 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932751AbcBZTDZ (ORCPT ); Fri, 26 Feb 2016 14:03:25 -0500 From: Boris Ostrovsky To: konrad.wilk@oracle.com, david.vrabel@citrix.com Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, mcgrof@kernel.org, brgerst@gmail.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Boris Ostrovsky Subject: [PATCH v4 1/2] xen/x86: Zero out .bss for PV guests Date: Fri, 26 Feb 2016 14:02:36 -0500 Message-Id: <1456513357-19981-2-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1456513357-19981-1-git-send-email-boris.ostrovsky@oracle.com> References: <1456513357-19981-1-git-send-email-boris.ostrovsky@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Boris Ostrovsky --- arch/x86/xen/xen-head.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S index b65f59a..5c63d2d 100644 --- a/arch/x86/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S @@ -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 -- 2.1.0