From patchwork Sun Sep 11 20:35:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9325573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3296F6048B for ; Sun, 11 Sep 2016 20:38:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2332028AB1 for ; Sun, 11 Sep 2016 20:38:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17F1828AB7; Sun, 11 Sep 2016 20:38:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B76A428AB1 for ; Sun, 11 Sep 2016 20:38:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjBTj-0001w1-Pq; Sun, 11 Sep 2016 20:35:51 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjBTj-0001vb-2p for xen-devel@lists.xenproject.org; Sun, 11 Sep 2016 20:35:51 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 4E/86-04595-620C5D75; Sun, 11 Sep 2016 20:35:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsUyZ7p8oK7qgav hBusXmFp83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmvP/QzFpzirPgzbzVLA+M39i5GLg4hgclM EpOObmeEcH4zSsy/9IAFwtnIKLH63VJWCGcCo8TrjbfZuhg5ONgETCTerHIEiYsItDFKfDuxF WgWJwezgK/ErWevmEFsYQF7iR3HJ7GB2CwCqhIdf5axgNi8Am4Sl9evAJsjISAv8ex2PUiYU8 BdYuOc9ywgYSGgkhM9xiBhCQFjifa3F9kmMPItYGRYxahRnFpUllqka2iql1SUmZ5RkpuYmaN raGCml5taXJyYnpqTmFSsl5yfu4kRGCgMQLCD8duygEOMkhxMSqK8/guuhgvxJeWnVGYkFmfE F5XmpBYfYpTh4FCS4DXZD5QTLEpNT61Iy8wBhixMWoKDR0mE1xYkzVtckJhbnJkOkTrFqCglz vtlH1BCACSRUZoH1waLk0uMslLCvIxAhwjxFKQW5WaWoMq/YhTnYFQS5nUAGc+TmVcCN/0V0G ImoMVPt14GWVySiJCSamCUNmUSfW2onvBgevjXNW+eeu6PPmbP0/Ha5s3O0rxag9NnJB9oht6 aMU/2bCajQ2u7jeDXHIcPhRl3G5rrf1deaj2y63HbxynLcvbE3E6NPc7lc3vv0kJViS3ctYEl jboBjrxC56bJzS9i2cx+7O1bl7j01CXmzfU6LdP5t61qXnzGLHJL/wIlluKMREMt5qLiRAA7j 5+CjgIAAA== X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1473626147!32736707!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17043 invoked from network); 11 Sep 2016 20:35:49 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 11 Sep 2016 20:35:49 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8BKZdJQ021156 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 11 Sep 2016 20:35:40 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u8BKZdOs014196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 11 Sep 2016 20:35:39 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u8BKZcNB015934; Sun, 11 Sep 2016 20:35:38 GMT Received: from localhost.localdomain.com (/209.6.196.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 11 Sep 2016 13:35:38 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, konrad@kernel.org, julien.grall@arm.com, sstabellini@kernel.org, ross.lagerwall@citrix.com Date: Sun, 11 Sep 2016 16:35:12 -0400 Message-Id: <1473626125-13683-6-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1473626125-13683-1-git-send-email-konrad.wilk@oracle.com> References: <1473626125-13683-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: andrew.cooper3@citrix.com, Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v3 05/18] arm: poison initmem when it is freed. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The current byte sequence is '0xcc' which makes sense on x86, but on ARM it is: cccccccc stclgt 12, cr12, [ip], {204} ; 0xcc Picking something more ARM applicable such as: efefefef svc 0x00efefef Creates a nice crash if one executes that code: (XEN) CPU1: Unexpected Trap: Supervisor Call We don't have to worry about Thumb code so this instruction is a safe to execute. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini --- xen/arch/arm/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 07e2037..0fa5623 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -995,7 +995,7 @@ void free_init_memory(void) paddr_t pa = virt_to_maddr(__init_begin); unsigned long len = __init_end - __init_begin; set_pte_flags_on_range(__init_begin, len, mg_rw); - memset(__init_begin, 0xcc, len); + memset(__init_begin, 0xef, len); set_pte_flags_on_range(__init_begin, len, mg_clear); init_domheap_pages(pa, pa + len); printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);