[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v1] imagebuilder: Add a script to check the sanity of device tree


  • To: "Orzel, Michal" <michal.orzel@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Mon, 1 Sep 2025 14:51:20 +0100
  • 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=nL3KT1SD5+QBSix2hix7cYoptDSWF5/XQfJQkOiUMaQ=; b=DYc/IVwjb48/ru27GJLPBRHtOH0HquJi1hpBGbe91tzhLxLggIpNOW0V3mC9hRQWbw0zr4QJB25WnxIpaKvSuiv2RumFUXWQtX/Pd/whmcPyY8s5DBGuBMCt64wED0D6+I4LRGHnRAbZRZSatEsaL/fNMjJ6BcEEndRVRc0SjBEbnpMDXmyLZCwMxtumg/mtFjWfBoUMnD6AqtjaQ8UdSkqUE0jYJroqhSl5BqCM+Ze+3BO1bXzr4qwO4kLerbWwBhtkWlG8OcsbYDyygAh8ClEUwERHyM6G3JHKOP07j9QDurcwj1iQWAewRH7fuzRBLQ92e9GVCKHF0S0SAVPtHw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SeGd8r2qjaWjWm8hL3eVmwrBMmAecegU3A1ncA2Zpr29EH9jzMgmQf1P0N1SJZnwdv07DPKqqDG70iLexM6IPi3fCIyOSOc97zKAw8NFlgSHQk7eev/1fK/z8p5Ks7OBEaVzjv8k+c07O/IIj8H0s2w+jhWNEEHMCUy8rPgEMi+c1x+d8sa+mfyrD4p4k4/HdGRJhEeEsEtuabgdH7Fz6brbEqeN2gnh9OB7/6THnxnRsO7i+QjvSNL1pHJtwzA1WIpxgn7Vb3xst0zEh6G9eM0GSw+Bc/vA0wIP53L2PazTG2Ev8Wjop6SCsRVcahbR19XDsdAQ6WMCp7pcRAQUCw==
  • Cc: <sstabellini@xxxxxxxxxx>, <bertrand.marquis@xxxxxxx>, <volodymyr_babchuk@xxxxxxxx>, <mark.brown@xxxxxxxxxxxxx>, <matthew.l.weber3@xxxxxxxxxx>, <sookyung.ahn@xxxxxxxxxx>
  • Delivery-date: Mon, 01 Sep 2025 13:51:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Michal,

On 01/09/2025 14:17, Orzel, Michal wrote:

On 01/09/2025 14:31, Ayan Kumar Halder wrote:
Xen gives a panic if certain nodes are not present in the device tree. In order
to prevent this panic, scripts/dt_sanity.py is written so that it checks if the
node/s are present. If the node/s are not present, the script gives an error.

User is expected to run the script against the device tree before booting Xen
with dtb.
I would expect the script to know what to look for in a passed dtb. Otherwise
it's just a script that searches for the list of specified compatibilities by
the user. In other words, a simple grep would also do the job.

I agree. The main idea is to check that a dt node with 'compatible="arm,gic-v3"' property is present. We can enhance the script as we go forward.

Compatibility is
not everything, there are other things that would prevent Xen from booting.

Agreed. The rationale here is to shift the responsibility to the system integrator to run some validation so that Xen does not catch these errors.

We wish to provide some sample tools to achieve this aim.

Another category of errors are the unsupported register configurations. For eg gicv3_info.nr_lrs can be supported with a max value of 16. So if we have a baremetal program that user can execute before running Xen, then the user can catch these errors.

If we are able to catch these errors outside of Xen, then we can claim such panic() will not be triggered in Xen. There will be certain assumptions to make like ....

Also, often times the dtb is modified by the bootloader before passing control
over to Xen (i.e. it may differ from the base dtb).

bootloader is not expected to modify the nodes which are sanitised by the external tool.

- Ayan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.