[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] xen/arm: dom0less: cope with missing /gic phandle
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
- Date: Fri, 11 Oct 2024 17:19:56 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vY3yq9h5CtR2y/1Tci7pEa0GcD7LcLoRuyzXb6JpApI=; b=VfyWyC3XALpM1nrzwos89ZWFPmzK1AVAqWtnrqlLZxTFG7rebdMmyLGcBDMc78n9+RR5s2IxrpmyIpa/0xPiFUhxsAabJ2ziSatNhdk0CVHwao/zva92Op1eCiE8Vtiry2BvaU5U2o0XljMQ4iASs1ZDTnIh64D8sy2dDKZi0JAi7NbeK1ez+90u63i1AU/eJiFiHfp83QekHY7c/zkwG+UY+zsHlsJh+9J/CWu1RVlplulLJfVoVuqGO1VdKDqVYFC+ssj9ETxbsQrsVOHhBglNLrJnBuc5kpBVecEVKtlBWOKJZCIfCDBF4zgbDu7Nl5GQgUirNxj6lNP0EiEP4g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=th6PUN7uPDLZw2SOnzfSZl6fph7+g1qYcNvKD9nP2vp6dpKk3OmyUuXK0dNueS0bZJmsfdAOXCg6eyTxuXTxpOb3w1OJvPICqPTc0iINJ+CQvgE3FSAHbS52ZkRSqAIJtK6MoZcpA4J5o0lTyzWpt/IRU1yaRVCb9gSpwmlpRtAA+vYXiI5nwSzODSldO5rFTyeCOue94SF0oxGm2uQpEFCH2DG6YDS686VeWmX8MvvrMnxaBw+w0oW+u4G4o0bMedJr631XHQYVfzy2LIwEWyKAP24y1Z/mhzYB5BK/nKlRmTKWdYgq9WIKXyfThxD9f6kMizuxrf00x11qiSrKBw==
- Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Fri, 11 Oct 2024 21:20:23 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
If a partial DT has a /gic node, but no references to it, dtc may omit
the phandle property. With the phandle property missing,
fdt_get_phandle() returns 0, leading Xen to generate a malformed domU
dtb due to invalid interrupt-parent phandle references. 0 is an invalid
phandle value. Add a zero check, and fall back to GUEST_PHANDLE_GIC.
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
---
xen/arch/arm/dom0less-build.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 09b65e44aed3..f328a044e9d3 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -554,7 +554,10 @@ static int __init domain_handle_dtb_bootmodule(struct
domain *d,
*/
if ( dt_node_cmp(name, "gic") == 0 )
{
- kinfo->phandle_gic = fdt_get_phandle(pfdt, node_next);
+ uint32_t phandle_gic = fdt_get_phandle(pfdt, node_next);
+
+ if ( phandle_gic != 0 )
+ kinfo->phandle_gic = phandle_gic;
continue;
}
base-commit: 76a54badf890f56ff72644593c0fbc72138e13aa
--
2.47.0
|