All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Andryuk <jason.andryuk@amd.com>
To: Jan Beulich <jbeulich@suse.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>,
	"Alejandro Vallejo" <agarciav@amd.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 06/12] x86/hyperlaunch: obtain cmdline from device tree
Date: Tue, 10 Jun 2025 13:39:03 -0400	[thread overview]
Message-ID: <03be429c-063d-4467-91e7-7ef2e148a2fb@amd.com> (raw)
In-Reply-To: <02ffa9cf-b5cd-431a-834a-a11bbf310196@suse.com>



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.

Regards,
Jason


  reply	other threads:[~2025-06-10 17:40 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 [this message]
2025-06-11  5:35         ` Jan Beulich
2025-06-12  8:20           ` Alejandro Vallejo
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=03be429c-063d-4467-91e7-7ef2e148a2fb@amd.com \
    --to=jason.andryuk@amd.com \
    --cc=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=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.