From nobody Mon Nov 23 22:31:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1793081859; cv=none; d=zohomail.com; s=zohoarc; b=agmPrBSh5/2ogi2hPcf/wPyM+ZD9wgeFO+COj7pbjG0THWMUswjcQXzrvnoXL7rRBPw65ce12WRvQn7sHEB6K2ekW933L/x26k0b4kfbSTf+72uthp73RCY2gdVwcoSyRur5u5W8wQVBcACEcoiENpBH6jBcCw6eBIqqRkYwKpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793081859; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=S5gJzH23fh/nKBiSObpCi+vZMP2u0y30tbWtykkO/f4=; b=SSnESa19n/EdBGBPaXXnZIyB4YkINDOfm+9Y0i+qqIHkP6EU8SCavuZplZI7JFTdJp5Hg0K6wjpqRpdqcc6Inmc206Ft6wdo4tihPKMmtaUFuAoNdbJG/jl7cSirfXjseqFzE8m5Hpqchn2gceP4pCTZeWZTuLwQyNqrbF3bMgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793081859442344.6946404146421; Mon, 26 Oct 2026 23:17:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1461804.1672840 (Exim 4.92) (envelope-from ) id 1xLaUY-0007ud-Og; Tue, 27 Oct 2026 06:17:02 +0000 Received: by outflank-mailman (output) from mailman id 1461804.1672840; Tue, 27 Oct 2026 06:17:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xLaUY-0007uW-Lc; Tue, 27 Oct 2026 06:17:02 +0000 Received: by outflank-mailman (input) for mailman id 1461804; Tue, 27 Oct 2026 03:19:13 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xLXiT-0007I4-2h for xen-devel@lists.xenproject.org; Tue, 27 Oct 2026 03:19:13 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xLXiS-004yKJ-1r for xen-devel@lists.xenproject.org; Tue, 27 Oct 2026 04:19:12 +0100 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ae017c0-e002-0a2a0a5209dd-0a2a4509b8d8-46 for ; Tue, 27 Oct 2026 04:19:12 +0100 Received: from [209.85.214.173] (helo=mail-pl1-f173.google.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ae0182e-be1a-0a2a45090019-d155d6adc4a8-3 for ; Tue, 27 Oct 2026 04:19:11 +0100 Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2e5fb79ce82so23269635ad.0 for ; Mon, 26 Oct 2026 20:19:11 -0700 (PDT) Received: from visitorckw-work01.c.googlers.com.com (55.11.81.34.bc.googleusercontent.com. [34.81.11.55]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2eae6c3b67bsm2337455ad.52.2026.10.26.20.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2026 20:19:08 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1793071150; x=1793675950; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=S5gJzH23fh/nKBiSObpCi+vZMP2u0y30tbWtykkO/f4=; b=b3Fy06htmGpGrQJTOO14irawXGNSrHV159EiSegHgpzICpeja8Okc5+oa5+WMUlTRY hty6IDCGfmmSiUGg81rE1Q91oIUIX9cOle9ypJNPGpegyrEN/ytZj0WzLUdIQK0hlYb3 1F8Mq866dP9TAAi2wPTrDpin5lWuhayai6M7AjiIBsOm6BrAS6agW+qnnOvSGOHpEBfT mIjoPBLUCYL3wFqO26S8pkKWhNr6wM//MONZ9hcQvu8UcWzHWWpVdJgclSxYsw9l9LWI GRbKspbs2DwwD6LfYkgBAuuR3FT0V8utALW7VcwmTYGpM8fOQ6DJJzEQ6fagd0Qzw9T2 7mPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793071150; x=1793675950; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=S5gJzH23fh/nKBiSObpCi+vZMP2u0y30tbWtykkO/f4=; b=kK8WTpQRiZdtQzdVm4xted+77NhgUNFok4IrELfeqK+wzKi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-Received: by 2002:a17:902:da85:b0:2ea:71a7:7f21 with SMTP id d9443c01a7336-2ea9c6c245fmr67368925ad.13.1793071149905; Mon, 26 Oct 2026 20:19:09 -0700 (PDT) From: Kuan-Wei Chiu To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, julien@xen.org, bertrand.marquis@arm.com, michal.orzel@amd.com, marscheng@google.com, jserv@ccns.ncku.edu.tw, eleanor15x@gmail.com, Kuan-Wei Chiu Subject: [PATCH] xen/dt: Only parse direct child nodes of /reserved-memory Date: Tue, 27 Oct 2026 03:18:55 +0000 Message-ID: <20261027031855.2671912-1-visitorckw@gmail.com> X-Mailer: git-send-email 2.56.0.307.g5fe7bd680c-goog MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-bad1c0/1793071152-3A4DB034-815C6872/0/0 X-purgate-type: clean X-purgate-size: 1663 X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1793081861499158500 Content-Type: text/plain; charset="utf-8" process_reserved_memory() uses device_tree_for_each_node(), which walks all descendants of /reserved-memory rather than just its direct children. However, a child node such as nvmem-rmem can contain nvmem-layout and cell subnodes whose reg properties specify internal offsets rather than physical memory addresses. Parsing these subnodes records invalid reserved memory regions and fails the overlap check when bitfield cells share the same offset. Ignore nodes with depth !=3D 1 in process_reserved_memory_node(). Fixes: d96594eef39a ("xen/arm: keep track of reserved-memory regions") Signed-off-by: Kuan-Wei Chiu Reviewed-by: Michal Orzel --- xen/common/device-tree/bootinfo-fdt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/common/device-tree/bootinfo-fdt.c b/xen/common/device-tree= /bootinfo-fdt.c index ca64daf4cd..eea35325f7 100644 --- a/xen/common/device-tree/bootinfo-fdt.c +++ b/xen/common/device-tree/bootinfo-fdt.c @@ -185,8 +185,13 @@ static int __init process_reserved_memory_node(const v= oid *fdt, int node, u32 size_cells, void *data) { - int rc =3D process_memory_node(fdt, node, name, depth, address_cells, - size_cells, data); + int rc; + + if ( depth !=3D 1 ) + return 0; + + rc =3D process_memory_node(fdt, node, name, depth, address_cells, + size_cells, data); =20 if ( rc =3D=3D -ENOSPC ) panic("Max number of supported reserved-memory regions reached.\n"= ); --=20 2.56.0.307.g5fe7bd680c-goog