[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>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Thu, 12 Jun 2025 10:20:51 +0200
  • 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=jewQKCz7Z4tAbpLWHCuGD1C9deOuDBXm7aNlPx1tB8U=; b=yQNpF2B3ir/WkiY5al1fzxU4HwB6Q8HWYlDIK+i6cMHEUasmO58mLWTSpnROgbhZU96OCni7XkANGRmrS5AuXA2RVtnhNQD3m8MuAtQ4QeHvw3m7JzoNuSgRNEelz8HIKZ+LGK2SAoSi9pMyv7OhX+eaOsqwxXBw0bMbV+kIl0FFeFtbqcoCZH1/Ru3C+DuuzfCAYb5SnIqAQowkMMIY1n0TB4i3e6DppLVVkrBUpyaoVcpAaQg3GEjHLVEXbIkThhYt57S+XQPcmn/qYAXoRH3yfEZoWm2GosregItlI5fkd0dAk7WXoFcbKe4/4ibGB4LYQJxF26JvL3dMIIFFSA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JG9kry2B2NJCcuz1n+CeetTfRr26abpoK80IscCi/b8ehPGCvWCzx+GlDN+/jkSVmbIhSuggb/jGVv+3j3PpGn4dv8PjB+6xbDVj5+lbG0o/Q7VDcvZxXiZOWuLFmG3YM3+Jd4W6gb5gAXAGtY/H2C4nRv5FOBdBd9y7Fda5qIy7FrljSXNaM7M0MaPOf8TAU22w4v7GZTGVa+NijS7rZe77E3yq/O04wmGMla1o8+AXM+hbHWqfwOiwqrq3wOweDN+hIahEoTgJQzuTFk9O8YmMyB9sKEOMvsq+/XemSUUA80okwgMOmTgCPQM3ulFvmbNDw9258AEFt53cyhYXig==
  • 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>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 12 Jun 2025 08:21:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed Jun 11, 2025 at 7:35 AM CEST, Jan Beulich wrote:
> On 10.06.2025 19:39, Jason Andryuk wrote:
>> 
>> 
>> 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.
>
> Which may call for either special-casing GrUB, or at least calling out that
> behavior in the comment. (Ideally we'd still have a way to distinguish
> between both cases, but likely we'll need to resort to documenting that some
> dummy option will need adding to tell "none" from [intended to be] empty.)
>
> Jan

We can add suitable comments where required, sure.

About the dummy option, note that even if we have an option for Xen, that does
nothing for the kernel cmdlines. If there's such dummy option there I don't know
of it.

Cheers,
Alejandro



 


Rackspace

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