From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757099AbcBXQrU (ORCPT ); Wed, 24 Feb 2016 11:47:20 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:41438 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752694AbcBXQrT (ORCPT ); Wed, 24 Feb 2016 11:47:19 -0500 Subject: Re: [Xen-devel] [PATCH] xen/x86: Zero out .bss for PV guests To: "Luis R. Rodriguez" , David Vrabel References: <1456178767-8038-1-git-send-email-boris.ostrovsky@oracle.com> <56CDBA5A.1000600@citrix.com> <56CDBB0F.9000203@citrix.com> <56CDC39B.3060004@oracle.com> <56CDC520.1000609@citrix.com> Cc: Andrew Cooper , Konrad Rzeszutek Wilk , xen-devel , "linux-kernel@vger.kernel.org" , Andy Lutomirski , Borislav Petkov From: Boris Ostrovsky Message-ID: <56CDDE7E.7040701@oracle.com> Date: Wed, 24 Feb 2016 11:46:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/24/2016 11:22 AM, Luis R. Rodriguez wrote: > On Wed, Feb 24, 2016 at 6:58 AM, David Vrabel wrote: >> Yes. Can you respin with a commit message explaining? (Or just provide >> the message here and I'll fix it up). > Is there no way to re-use somehow the clear_bss() from bare metal? xen_start_info lives in .bss and it is initialized in startup assembly code. We could move it to .data but I'd still want to do this first thing in startup_xen(). We may add more code there later that touches something in .bss and with delayed section clearing we may blow away that data. -boris > This uses a section range: > > /* Don't add a printk in there. printk relies on the PDA which is not > initialized > yet. */ > static void __init clear_bss(void) > { > memset(__bss_start, 0, > (unsigned long) __bss_stop - (unsigned long) __bss_start); > } > > Perhaps the section range might be different for PV guests? Or can > this simply not work even if one added a guest bss section size, or > would it be too late for PV guests, ie we need to do it in asm on PV > guests as you did? If so why. > > Luis