From: Ian Campbell Subject: Re: [PATCH] xen/arm: Scrub heap pages during boot Date: Fri, 10 Jan 2014 09:52:01 +0000 Message-ID: <1389347521.19142.9.camel@kazak.uk.xensource.com> References: <1389324476-9158-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W1Yl4-0002XX-EE for xen-devel@lists.xenproject.org; Fri, 10 Jan 2014 09:52:06 +0000 In-Reply-To: <1389324476-9158-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org On Fri, 2014-01-10 at 03:27 +0000, Julien Grall wrote: > Scrub heap pages was disabled because it was slow on the models. Now that Xen > supports real hardware, it's possible to enable by default scrubbing. > > Signed-off-by: Julien Grall Acked-by: Ian Campbell > --- > This patch should go to Xen 4.4. It avoid to give non-cleared page to > a domain. > > The downside is it's now slow on models. There is a no-bootscrub command-line option which can be used in that case. Could you update the relevant model wiki pages to mention it please? > The current implementation of scrub_heap_pages loop on every page in the > frametable. On ARM, there is only which can contains MMIO. We are safe > because when frametable is initialized, page are marked inuse. So the > function won't clear theses pages. I don't think this behaviour is specific to ARM, x86 has MMIO regions mixed in with RAM as well. >From an RM PoV I think this is a necessary fix since it can otherwise potentially leak information from a previous boot. I also think it is low risk, nothing should have been relying on non-zero content of any page. > --- > xen/arch/arm/setup.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c > index 9fc40c8..d7c7f4d 100644 > --- a/xen/arch/arm/setup.c > +++ b/xen/arch/arm/setup.c > @@ -764,10 +764,8 @@ void __init start_xen(unsigned long boot_phys_offset, > if ( construct_dom0(dom0) != 0) > panic("Could not set up DOM0 guest OS"); > > - /* Scrub RAM that is still free and so may go to an unprivileged domain. > - XXX too slow in simulator > - scrub_heap_pages(); > - */ > + /* Scrub RAM that is still free and so may go to an unprivileged domain. */ > + scrub_heap_pages(); > > init_constructors(); >