From: Alejandro Vallejo <agarciav@amd.com>
To: Jan Beulich <jbeulich@suse.com>, Jason Andryuk <jason.andryuk@amd.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Denis Mukhin" <dmukhin@ford.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 06/12] x86/hyperlaunch: obtain cmdline from device tree
Date: Thu, 12 Jun 2025 10:20:51 +0200 [thread overview]
Message-ID: <DAKEPTAU5XB4.3NA0LU38UFH6L@amd.com> (raw)
In-Reply-To: <ef46b3ec-af0e-480f-b206-5191c79e62f9@suse.com>
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@apertussolutions.com>
>>>>>
>>>>> 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@apertussolutions.com>
>>>>> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
>>>>> Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
>>>>> Reviewed-by: Denis Mukhin <dmukhin@ford.com>
>>>>> ---
>>>>
>>>>> 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
next prev parent reply other threads:[~2025-06-12 8:21 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 12:36 [PATCH v6 00/12] Hyperlaunch device tree for dom0 Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 01/12] kconfig: introduce CONFIG_DOMAIN_BUILDER Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 02/12] common/hyperlaunch: introduce the domain builder Alejandro Vallejo
2025-04-30 18:56 ` Daniel P. Smith
2025-05-02 7:21 ` Jan Beulich
2025-05-06 19:29 ` Daniel P. Smith
2025-05-13 8:05 ` Jan Beulich
2025-05-13 22:23 ` Daniel P. Smith
2025-05-22 14:07 ` Alejandro Vallejo
2025-05-15 13:17 ` Daniel P. Smith
2025-05-21 8:54 ` Jan Beulich
2025-05-22 12:09 ` Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 03/12] x86/hyperlaunch: initial support for hyperlaunch device tree Alejandro Vallejo
2025-05-21 15:00 ` Jan Beulich
2025-05-21 17:24 ` Alejandro Vallejo
2025-05-22 6:55 ` Jan Beulich
2025-04-29 12:36 ` [PATCH v6 04/12] x86/hyperlaunch: Add helpers to locate multiboot modules Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 05/12] x86/hyperlaunch: locate dom0 kernel with hyperlaunch Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 06/12] x86/hyperlaunch: obtain cmdline from device tree Alejandro Vallejo
2025-06-09 17:07 ` Jason Andryuk
2025-06-10 6:56 ` Jan Beulich
2025-06-10 17:39 ` Jason Andryuk
2025-06-11 5:35 ` Jan Beulich
2025-06-12 8:20 ` Alejandro Vallejo [this message]
2025-06-12 8:44 ` Jan Beulich
2025-04-29 12:36 ` [PATCH v6 07/12] x86/hyperlaunch: locate dom0 initrd with hyperlaunch Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 08/12] x86/hyperlaunch: add domain id parsing to domain config Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 09/12] x86/hyperlaunch: specify dom0 mode with device tree Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 10/12] x86/hyperlaunch: add memory parsing to domain config Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 11/12] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree Alejandro Vallejo
2025-04-29 12:36 ` [PATCH v6 12/12] x86/hyperlaunch: add capabilities to boot domain Alejandro Vallejo
2025-04-29 13:00 ` [PATCH v6 00/12] Hyperlaunch device tree for dom0 Jan Beulich
2025-04-29 13:22 ` Alejandro Vallejo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DAKEPTAU5XB4.3NA0LU38UFH6L@amd.com \
--to=agarciav@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=dmukhin@ford.com \
--cc=dpsmith@apertussolutions.com \
--cc=jason.andryuk@amd.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.