From nobody Sun Apr 28 11:17:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=fail (BodyHash is different from the expected one) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1571342959431809.1685719452228; Thu, 17 Oct 2019 13:09:19 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iLC46-0002OD-4f; Thu, 17 Oct 2019 20:08:06 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iLC44-0002O8-Qg for xen-devel@lists.xenproject.org; Thu, 17 Oct 2019 20:08:04 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (unknown [40.107.76.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d3433c52-f119-11e9-93d7-12813bfff9fa; Thu, 17 Oct 2019 20:08:03 +0000 (UTC) Received: from SN4PR0201CA0068.namprd02.prod.outlook.com (2603:10b6:803:20::30) by BL0PR02MB3796.namprd02.prod.outlook.com (2603:10b6:207:48::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.21; Thu, 17 Oct 2019 20:08:00 +0000 Received: from SN1NAM02FT025.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by SN4PR0201CA0068.outlook.office365.com (2603:10b6:803:20::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2347.18 via Frontend Transport; Thu, 17 Oct 2019 20:08:00 +0000 Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT025.mail.protection.outlook.com (10.152.72.87) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2367.14 via Frontend Transport; Thu, 17 Oct 2019 20:08:00 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1iLC3z-0002JZ-PX; Thu, 17 Oct 2019 13:07:59 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1iLC3u-0002IJ-MD; Thu, 17 Oct 2019 13:07:54 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x9HK7npR022748; Thu, 17 Oct 2019 13:07:49 -0700 Received: from [172.19.2.62] (helo=xsjwoods50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1iLC3p-0002HY-3b; Thu, 17 Oct 2019 13:07:49 -0700 X-Inumbo-ID: d3433c52-f119-11e9-93d7-12813bfff9fa ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VNRCpS5NaCGtVKBTlyvoH3/1kkCW/DeTQj79+KBONR3z/rHX8rNymMSQmw0+up6wCBQmL6ccN2QkfBg+Hjp+PVPMzJel6CFv7KMaJ/QN9eqyG6QaEVPOftO+kctN/1MYBvL+8AWqEK6V4/IlI83NkgwOCzY/BWP6s8E0qM+y3vzzP5L0vXugNkXA41Q1s3Y9FU7YPzY8Xf/aCbhKYDgTLhfpwLiUJYeM4RNYiQKDhfZt+domYfbs8w43BuKo3vmrFTRMUVVH8h671w8Gppy7f4QkR003h+a2R3HnnHEEuCx9FFZ//f/UDiVdlsSBZJAmIE/FkPXlFXOwyJA2cILaMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+6aqsrlVx+M4Yaf0+/zrHQY0vg69SlIZH0Lw6B9X3E8=; b=kXLzWw3CVtouyN2ipqqKs+FwPPjCd+N/BWQRSRrvIwe3LVe6gbFeTLiEzdaQnCfv78oOW+7nNzawEsKFKe+CqeMoZE6XRk0vmWJnEZQp/QQMpB99+4NNSAdi9MzBunXU7g+2scCF0nL5qywMkL9Dwb4v8Ui7FXGOFAmfVZ2qeB4M9ARWGVejSvMzhTx1KscLwA4y0T4lh6lm7S8cfBh+eIIm6RGGFar5Bvt3sy+G6h/x3MAEdugI9htNMo/xbpehEc98tu94Woto7JcMk+JqFAweyLpCU7jhBqehSZK1tjtVuOryFUqoAVJCYtdREP2Q+J6B/zKRNcS1kxJZPyBOfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=epam.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+6aqsrlVx+M4Yaf0+/zrHQY0vg69SlIZH0Lw6B9X3E8=; b=NZFed5DYq2k3YJ1c8GMbqhiL8OrazqtOWJN1/2lwv4J4oxitoaaiuaojoonwAKtSihGSPTCystCQuNR+YY9nf1yJaCSpKmEqFeNLLznqhkqzKvuYJp+Ka+lfIDry23xp7kSGJ14qy4fSroUCO58pug4z6y9hQnY0or0vI/D03F0= Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; epam.com; dkim=none (message not signed) header.d=none;epam.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; From: Brian Woods To: xen-devel@lists.xenproject.org Date: Thu, 17 Oct 2019 13:07:40 -0700 Message-Id: <1571342860-15838-1-git-send-email-brian.woods@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1570650447-3225-1-git-send-email-brian.woods@xilinx.com> References: <1570650447-3225-1-git-send-email-brian.woods@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(199004)(189003)(4326008)(426003)(6916009)(305945005)(36386004)(11346002)(486006)(476003)(2616005)(14444005)(126002)(336012)(2906002)(70586007)(48376002)(446003)(44832011)(70206006)(50226002)(8936002)(8676002)(9786002)(81166006)(81156014)(2361001)(2351001)(498600001)(36756003)(5660300002)(26005)(186003)(86362001)(47776003)(7696005)(76176011)(51416003)(50466002)(54906003)(6666004)(106002)(16586007)(356004); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB3796; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 483cd3a1-1bc0-48af-4c52-08d7533db5bb X-MS-TrafficTypeDiagnostic: BL0PR02MB3796: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:595; X-Forefront-PRVS: 01930B2BA8 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HeN1AR+as6qtmYersEqM4SbCcfl8FYzN1Cdz398qXND4ipLTZXOh8umaRqds87CRSInLJpWcHOBjy/UOSNmnRTUtlsEpdROOesJoZGGojbOArnDiMfwBK3f4CzknJv32n8f9+hTmFEc7JYFLO2qRMES3qrYWiJolTmcMc6nyBHNjFIG2cabGx77J94fRIiojT5X6gMWZbxODqB0dasXVg3yxZZo2kxe6U9pNaniUOraLboRjaDKtlRXl1Jym2uI8YMn7D1FzPqDMUigyzlUFyHm4w/LkX9KggeezdlyW9z/OA1r/Sennqzfw0sGI4Diir06YOQNVSsjgqdaE7/MNOU0nKmZgjPnrT8cEqiip3VCIXTzQKxleXv7IMJlHU8hi8T39lvGYx4Yva7ONrtPY6XDVF9SsFbdqUs8Vr7gaH4g= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2019 20:08:00.1784 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 483cd3a1-1bc0-48af-4c52-08d7533db5bb X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB3796 Subject: [Xen-devel] [PATCH v2] xen/arm: add warning if memory modules overlap X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Brian Woods , Stefano Stabellini , Julien Grall , Volodymyr Babchuk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) It's possible for a misconfigured device tree to cause Xen to crash when there are overlapping addresses in the memory modules. Add a warning when printing the addresses to let the user know there's a possible issue. Signed-off-by: Brian Woods --- v1 -> v2 - removed nested loop and placed check in add_boot_module() Sample output: ... (XEN) MODULE[0]: 0000000001400000 - 0000000001542121 Xen =20 (XEN) MODULE[1]: 0000000003846000 - 0000000003850080 Device Tree=20 (XEN) MODULE[2]: 0000000003853000 - 0000000007fff676 Ramdisk =20 (XEN) MODULE[3]: 0000000000080000 - 0000000003180000 Kernel =20 (XEN) RESVD[0]: 0000000003846000 - 0000000003850000 (XEN) RESVD[1]: 0000000003853000 - 0000000007fff676 (XEN)=20 (XEN) WARNING: overlap detected in the memory module addresses (XEN)=20 (XEN) Command line: console=3Ddtuart dtuart=3Dserial0 dom0_mem=3D1G bootscr= ub=3D0 maxcpus=3D1 timer_slop=3D0 ... xen/arch/arm/bootfdt.c | 4 ++++ xen/arch/arm/setup.c | 6 ++++++ xen/include/asm-arm/setup.h | 1 + 3 files changed, 11 insertions(+) diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c index 08fb59f..f8b34d4 100644 --- a/xen/arch/arm/bootfdt.c +++ b/xen/arch/arm/bootfdt.c @@ -387,6 +387,10 @@ static void __init early_print_info(void) mem_resv->bank[j].start + mem_resv->bank[j].size - 1); } printk("\n"); + + if ( mem_module_overlap ) + printk("WARNING: overlap detected in the memory module addresses.\= n"); + for ( i =3D 0 ; i < cmds->nr_mods; i++ ) printk("CMDLINE[%"PRIpaddr"]:%s %s\n", cmds->cmdline[i].start, cmds->cmdline[i].dt_name, diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 705a917..315a131 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -69,6 +69,8 @@ integer_param("xenheap_megabytes", opt_xenheap_megabytes); =20 domid_t __read_mostly max_init_domid; =20 +bool __initdata mem_module_overlap; + static __used void init_done(void) { /* Must be done past setting system_state. */ @@ -254,6 +256,10 @@ struct bootmodule __init *add_boot_module(bootmodule_k= ind kind, mod->domU =3D false; return mod; } + + if ( ((mod->start >=3D start) && (mod->start < start + size)) || + ((start >=3D mod->start) && (start < mod->start + mod->size))= ) + mem_module_overlap =3D true; } =20 mod =3D &mods->module[mods->nr_mods++]; diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h index 2f8f24e..4bb1ba1 100644 --- a/xen/include/asm-arm/setup.h +++ b/xen/include/asm-arm/setup.h @@ -122,6 +122,7 @@ void device_tree_get_reg(const __be32 **cell, u32 addre= ss_cells, u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name, u32 dflt); =20 +extern bool mem_module_overlap; #endif /* * Local variables: --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel