From patchwork Fri Jan 10 03:27:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 23070 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BCA920555 for ; Fri, 10 Jan 2014 03:28:02 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id h16sf14750023oag.9 for ; Thu, 09 Jan 2014 19:28:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=LTNFVdW2feoY37KIutRHEvROiZ3XgoKoUTUbbT7zhHU=; b=a4lJhpLYycSGzwH0vh2xZwgFwlqeDsW3XwjyHWSe1pDEVteLtnkSe8c3N2jZKgEDio psKp6/Y7xU/M8/xS9awlZE+xmhlPxMVZQ/JDuPhT+Preiqu0Ys/ghRovD/bwZzf1emQK 9HsBZAVxxzVidmb+LZKcfk4jjxP47UdjqgpWoYmVvdELU/SZe7VhPvwGzGyvixogYH0K 2OktIoTklBJeP76GcXyE3g8ol9Bk1Rbw3Nz9Rf4z20JL9oXo85mDnYBi5IpuWTMN0cmp i753XLYz6VsiT0h9ylC13XV13NiOot6h3xZ9ay3A1A+BJQZWvlhBNimKdSDl5tlwz/gz MTpw== X-Gm-Message-State: ALoCoQkbM0TEju51s/3DnlxQpYjkt1bF7WOkXCQlIJfkZ80xmK7Bnz1ti0B+cgDXeObvvXXId5x5 X-Received: by 10.50.49.3 with SMTP id q3mr221958ign.7.1389324481501; Thu, 09 Jan 2014 19:28:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.97 with SMTP id e1ls978470qel.30.gmail; Thu, 09 Jan 2014 19:28:01 -0800 (PST) X-Received: by 10.58.4.138 with SMTP id k10mr5964534vek.8.1389324481342; Thu, 09 Jan 2014 19:28:01 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id sg4si3927994vdc.131.2014.01.09.19.28.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Jan 2014 19:28:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id w8so635925vbj.34 for ; Thu, 09 Jan 2014 19:28:01 -0800 (PST) X-Received: by 10.58.186.198 with SMTP id fm6mr6001243vec.16.1389324480987; Thu, 09 Jan 2014 19:28:00 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp56833ved; Thu, 9 Jan 2014 19:28:00 -0800 (PST) X-Received: by 10.14.4.67 with SMTP id 43mr6628188eei.70.1389324480024; Thu, 09 Jan 2014 19:28:00 -0800 (PST) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx.google.com with ESMTPS id b44si7114656eez.245.2014.01.09.19.27.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Jan 2014 19:28:00 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.43 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.43; Received: by mail-ee0-f43.google.com with SMTP id c13so1648914eek.16 for ; Thu, 09 Jan 2014 19:27:59 -0800 (PST) X-Received: by 10.14.87.2 with SMTP id x2mr6500106eee.79.1389324479606; Thu, 09 Jan 2014 19:27:59 -0800 (PST) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id e43sm10842592eep.7.2014.01.09.19.27.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jan 2014 19:27:58 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, ian.campbell@citrix.com, tim@xen.org, stefano.stabellini@citrix.com, Julien Grall Subject: [PATCH] xen/arm: Scrub heap pages during boot Date: Fri, 10 Jan 2014 03:27:55 +0000 Message-Id: <1389324476-9158-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. 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. --- 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();