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

Re: [PATCH v6 06/12] x86/hyperlaunch: obtain cmdline from device tree


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 10 Jun 2025 13:39:03 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com 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=PksA5C6iw+sZppG3ZXdMEOJitc+OQy9il77T0rpHx80=; b=PcFOLQOJSyZnvOvl/nqjXdB3ZVE9X4zrZzv029VFhClygXgOXT4jRaSsOjlEZ3S+JJNjWI0oRsYarHLJn4wLvFBKxz9k7BTlV1nkKnqTO10m5+q1DAqOhTEzNFEcBLAX+EyLOLeiFFH9KzC1ixGghPgG0id1/7zQRPlfvJ1TH/cXi7mb3AiVqY3XF4DBdO8r+deYBCDEEb5CyUrjRvHJnigskbjibap1Qt9c9fA/1VX8F9EZp7mondmPWJkB2J435X6xs/5MiCVwYrsK5BkIWlCSklU3kzuwmD559JZQgV9oDB4ZdrNiMzuT6Zqvm4WVZSUmEo+JuXV1+5gRFZxWPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LG0Nu7vFxr38MyBO2jp5g5savh+zCQM1nwXFDkwi9jMmOcTFtFbL08H7WcyUT3NAXbdo/inYBrai0jNu9HrcfdBqn1sLj1YIsQroEBPcWY1andpGraLGDUOS05DVIYwa1KBsvZJP0BqYXXtmteBAVTcwKNv+LY9q8rwallO5bciq5rdw8lyDjtq3ctMc3lVkXAg+eDtPA8BkT89AndYXvBAIMGok04uFdfnj+MsEU8Kf5MXXTjaE5p+RWDUxD1kvf0X7530HlcbRnronlewFjr87Eh8ugOq9vNRpx2BDjopYwFYLkgoz9eMpCXFK8A009t+n9MfNjfO9i5XrNggwkA==
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Michal Orzel" <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Denis Mukhin <dmukhin@xxxxxxxx>, "Alejandro Vallejo" <agarciav@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 10 Jun 2025 17:40:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 2025-06-10 02:56, Jan Beulich wrote:
On 09.06.2025 19:07, Jason Andryuk wrote:
On 2025-04-29 08:36, Alejandro Vallejo wrote:
From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>

Add support to read the command line from the hyperlaunch device tree.
The device tree command line is located in the "bootargs" property of the
"multiboot,kernel" node.

A boot loader command line, e.g. a grub module string field, takes
precendence over the device tree one since it is easier to modify.

Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
Signed-off-by: Alejandro Vallejo <agarciav@xxxxxxx>
Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx>
---

diff --git a/xen/common/domain-builder/fdt.c b/xen/common/domain-builder/fdt.c
index cbb0ed30a2..dabe201b04 100644
--- a/xen/common/domain-builder/fdt.c
+++ b/xen/common/domain-builder/fdt.c
@@ -219,6 +219,12 @@ static int __init fdt_process_domain_node(
               printk(XENLOG_INFO "  kernel: multiboot-index=%d\n", idx);
               bi->mods[idx].type = BOOTMOD_KERNEL;
               bd->kernel = &bi->mods[idx];
+
+            /* If bootloader didn't set cmdline, see if FDT provides one. */
+            if ( bd->kernel->cmdline_pa &&
+                 !((char *)__va(bd->kernel->cmdline_pa))[0] )

The logic is incorrect - it should be:

             if ( !bd->kernel->cmdline_pa ||
                  !((char *)__va(bd->kernel->cmdline_pa))[0] )

If there is no cmdline_pa (which happens with the "reg" property) or the if 
there is a 0-length string, then check the DT for bootargs.

Even that sounds bogus to me: There's a difference between "no command line"
and "empty command line".

Yes, you have a point. The difficulty is grub always provides a NUL terminated string, so Xen can't differentiate the two.

Regards,
Jason



 


Rackspace

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