From: Alejandro Vallejo <agarciav@amd.com>
To: Denis Mukhin <dmkhn@proton.me>
Cc: xen-devel@lists.xenproject.org,
"Daniel P. Smith" <dpsmith@apertussolutions.com>,
"Jason Andryuk" <jason.andryuk@amd.com>,
"Xenia Ragiadakou" <xenia.ragiadakou@amd.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Michal Orzel" <michal.orzel@amd.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v3 09/16] x86/hyperlaunch: locate dom0 kernel with hyperlaunch
Date: Mon, 14 Apr 2025 14:56:58 +0100 [thread overview]
Message-ID: <D96EX0QNDA51.1KN145E8H1PCI@amd.com> (raw)
In-Reply-To: <DSF977mG3NYzAt3ivBQ4eG8vpcpUtHkruh1kwWNMEpmV4YretAAOz5B3bIdJox_2MxVZvoKvrQ3Xwx8z_MMHHM-lj7JYUx00v79nQcuu6ic=@proton.me>
On Wed Apr 9, 2025 at 10:24 PM BST, Denis Mukhin wrote:
> On Tuesday, April 8th, 2025 at 9:07 AM, Alejandro Vallejo <agarciav@amd.com> wrote:
>
>>
>>
>> From: "Daniel P. Smith" dpsmith@apertussolutions.com
>>
>>
>> Look for a subnode of type `multiboot,kernel` within a domain node. If
>> found, locate it using the multiboot module helper to generically ensure
>> it lives in the module list. If the bootargs property is present and
>> there was not an MB1 string, then use the command line from the device
>> tree definition.
>>
>> 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
>>
>> ---
>> v3:
>> * Add const to fdt
>> * Remove idx == NULL checks
>> * Add BUILD_BUG_ON for MAX_NR_BOOTMODS fitting in a uint32_t
>> * Remove trailing ) from printks
>> * Return ENODATA for missing kernel
>> * Re-work "max domains" warning and print limit
>> * fdt_cell_as_u32/directly return values
>> * Remove "pairs" looping from fdt_get_reg_prop() and only grab 1.
>> * Use addr_cells and size_cells
>> ---
>> xen/arch/x86/domain-builder/core.c | 11 ++++++
>> xen/arch/x86/domain-builder/fdt.c | 57 ++++++++++++++++++++++++++++++
>> xen/arch/x86/setup.c | 5 ---
>> 3 files changed, 68 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/x86/domain-builder/core.c b/xen/arch/x86/domain-builder/core.c
>> index c50eff34fb..eda7fa7a8f 100644
>> --- a/xen/arch/x86/domain-builder/core.c
>> +++ b/xen/arch/x86/domain-builder/core.c
>> @@ -59,6 +59,17 @@ void __init builder_init(struct boot_info *bi)
>>
>> printk(XENLOG_INFO " Number of domains: %d\n", bi->nr_domains);
>>
>> }
>> + else
>> + {
>> + unsigned int i;
>> +
>> + /* Find first unknown boot module to use as Dom0 kernel */
>> + printk("Falling back to using first boot module as dom0\n");
>> + i = first_boot_module_index(bi, BOOTMOD_UNKNOWN);
>> + bi->mods[i].type = BOOTMOD_KERNEL;
>>
>> + bi->domains[0].kernel = &bi->mods[i];
>>
>> + bi->nr_domains = 1;
>>
>> + }
>> }
>>
>> /*
>> diff --git a/xen/arch/x86/domain-builder/fdt.c b/xen/arch/x86/domain-builder/fdt.c
>> index 9ebc8fd0e4..a037c8b6cb 100644
>> --- a/xen/arch/x86/domain-builder/fdt.c
>> +++ b/xen/arch/x86/domain-builder/fdt.c
>> @@ -155,6 +155,52 @@ int __init fdt_read_multiboot_module(const void *fdt, int node,
>> return idx;
>> }
>>
>> +static int __init process_domain_node(
>> + struct boot_info *bi, const void *fdt, int dom_node)
>> +{
>> + int node;
>> + struct boot_domain *bd = &bi->domains[bi->nr_domains];
>>
>> + const char *name = fdt_get_name(fdt, dom_node, NULL) ?: "unknown";
>> + int address_cells = fdt_address_cells(fdt, dom_node);
>> + int size_cells = fdt_size_cells(fdt, dom_node);
>> +
>> + fdt_for_each_subnode(node, fdt, dom_node)
>> + {
>> + if ( fdt_node_check_compatible(fdt, node, "multiboot,kernel") == 0 )
>> + {
>> + int idx;
>> +
>> + if ( bd->kernel )
>>
>> + {
>> + printk(XENLOG_ERR "Duplicate kernel module for domain %s\n",
>
> Looks like it should be XENLOG_WARNING since the loop continues.
Fair point.
>
> Also, I would use either Capitalized or lower case messages everywhere
> for consistency.
That's related to those leading spaces. The lowercases end up
immediately under the configuration message so it's easier to bind them
visually as "hyperlaunch-related".
(XEN) Hyperlaunch configuration:
(XEN) something
(XEN) failed processing kernel module for domain %s
>
>> + name);
>> + continue;
>> + }
>> +
>> + idx = fdt_read_multiboot_module(fdt, node, address_cells,
>> + size_cells, bi);
>> + if ( idx < 0 )
>> + {
>> + printk(" failed processing kernel module for domain %s\n",
>
> I think this printout should have XENLOG_ERR in it since it's on the
> error code path.
All of these should have a XENLOG_X so they can be skipped when _INFO
is itself filtered out.
>
>> + name);
>> + return idx;
>> + }
>> +
>> + printk(" kernel: boot module %d\n", idx);
>> + bi->mods[idx].type = BOOTMOD_KERNEL;
>>
>> + bd->kernel = &bi->mods[idx];
>>
>> + }
>> + }
>> +
>> + if ( !bd->kernel )
>>
>> + {
>> + printk(XENLOG_ERR "ERR: no kernel assigned to domain\n");
>
> Drop "ERR" since it is already XENLOG_ERR level?
ERR: is printed though, whereas XENLOG_ERR is not. That's meant to make
it visually clear that's _really_ not meant to happen.
>
>> + return -ENODATA;
>> + }
>> +
>> + return 0;
>> +}
>> +
>> static int __init find_hyperlaunch_node(const void *fdt)
>> {
>> int hv_node = fdt_path_offset(fdt, "/chosen/hypervisor");
>> @@ -217,9 +263,20 @@ int __init walk_hyperlaunch_fdt(struct boot_info *bi)
>>
>> fdt_for_each_subnode(node, fdt, hv_node)
>> {
>> + if ( bi->nr_domains >= MAX_NR_BOOTDOMS )
>>
>> + {
>> + printk(XENLOG_WARNING
>> + "WARN: only creating first %u domains\n", MAX_NR_BOOTDOMS);
>
> Drop "WARN" since it is already XENLOG_WARNING level?
Same rationale as above.
>
>> + break;
>> + }
>> +
>> ret = fdt_node_check_compatible(fdt, node, "xen,domain");
>> if ( ret == 0 )
>> + {
>> + if ( (ret = process_domain_node(bi, fdt, node)) < 0 )
>> + break;
>> bi->nr_domains++;
>>
>> + }
>> }
>>
>> /* Until multi-domain construction is added, throw an error /
>> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
>> index e5d78bcb48..00e8c8a2a3 100644
>> --- a/xen/arch/x86/setup.c
>> +++ b/xen/arch/x86/setup.c
>> @@ -1284,11 +1284,6 @@ void asmlinkage __init noreturn __start_xen(void)
>>
>> builder_init(bi);
>>
>> - / Find first unknown boot module to use as Dom0 kernel */
>> - i = first_boot_module_index(bi, BOOTMOD_UNKNOWN);
>> - bi->mods[i].type = BOOTMOD_KERNEL;
>>
>> - bi->domains[0].kernel = &bi->mods[i];
>>
>> -
>> if ( pvh_boot )
>> {
>> /* pvh_init() already filled in e820_raw */
>> --
>> 2.43.0
Cheers,
Alejandro
next prev parent reply other threads:[~2025-04-14 13:57 UTC|newest]
Thread overview: 128+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 16:07 [PATCH v3 00/16] Hyperlaunch device tree for dom0 Alejandro Vallejo
2025-04-08 16:07 ` [PATCH v3 01/16] x86/boot: introduce boot domain Alejandro Vallejo
2025-04-09 6:24 ` Jan Beulich
2025-04-09 10:28 ` Alejandro Vallejo
2025-04-10 13:13 ` Daniel P. Smith
2025-04-10 20:56 ` Jason Andryuk
2025-04-10 13:09 ` Daniel P. Smith
2025-04-10 15:01 ` Jan Beulich
2025-04-10 20:56 ` Jason Andryuk
2025-04-16 13:02 ` Daniel P. Smith
2025-04-16 13:33 ` Jan Beulich
2025-04-16 14:00 ` Daniel P. Smith
2025-04-16 14:06 ` Jan Beulich
2025-04-16 15:01 ` Daniel P. Smith
2025-04-08 16:07 ` [PATCH v3 02/16] x86/boot: introduce domid field to struct boot_domain Alejandro Vallejo
2025-04-09 6:34 ` Jan Beulich
2025-04-09 10:33 ` Alejandro Vallejo
2025-04-10 16:18 ` Jason Andryuk
2025-04-08 16:07 ` [PATCH v3 03/16] x86/boot: add cmdline " Alejandro Vallejo
2025-04-09 6:48 ` Jan Beulich
2025-04-09 11:11 ` Alejandro Vallejo
2025-04-09 11:28 ` Alejandro Vallejo
2025-04-09 14:13 ` Jan Beulich
2025-04-09 14:00 ` Jan Beulich
2025-04-09 21:05 ` Denis Mukhin
2025-04-10 12:02 ` Alejandro Vallejo
2025-04-08 16:07 ` [PATCH v3 04/16] kconfig: introduce option to independently enable libfdt Alejandro Vallejo
2025-04-09 18:57 ` Denis Mukhin
2025-04-10 12:05 ` Alejandro Vallejo
2025-04-10 9:04 ` Jan Beulich
2025-04-10 12:04 ` Alejandro Vallejo
2025-04-08 16:07 ` [PATCH v3 05/16] kconfig: introduce domain builder config option Alejandro Vallejo
2025-04-10 9:08 ` Jan Beulich
2025-04-10 12:52 ` Alejandro Vallejo
2025-04-10 12:57 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 06/16] x86/hyperlaunch: introduce the domain builder Alejandro Vallejo
2025-04-09 18:53 ` Denis Mukhin
2025-04-10 7:49 ` Jan Beulich
2025-04-10 13:01 ` Alejandro Vallejo
2025-04-10 9:39 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 07/16] x86/hyperlaunch: initial support for hyperlaunch device tree Alejandro Vallejo
2025-04-10 10:10 ` Jan Beulich
2025-04-10 14:50 ` Alejandro Vallejo
2025-04-08 16:07 ` [PATCH v3 08/16] x86/hyperlaunch: Add helpers to locate multiboot modules Alejandro Vallejo
2025-04-10 10:42 ` Jan Beulich
2025-04-14 13:37 ` Alejandro Vallejo
2025-04-14 15:05 ` Jan Beulich
2025-04-14 18:01 ` Alejandro Vallejo
2025-04-15 6:05 ` Jan Beulich
2025-04-15 11:30 ` Alejandro Vallejo
2025-04-16 16:55 ` Nicola Vetrini
2025-04-17 11:50 ` Alejandro Vallejo
2025-04-14 19:09 ` Nicola Vetrini
2025-04-08 16:07 ` [PATCH v3 09/16] x86/hyperlaunch: locate dom0 kernel with hyperlaunch Alejandro Vallejo
2025-04-09 21:24 ` Denis Mukhin
2025-04-14 13:56 ` Alejandro Vallejo [this message]
2025-04-10 10:58 ` Jan Beulich
2025-04-14 13:58 ` Alejandro Vallejo
2025-04-08 16:07 ` [PATCH v3 10/16] x86/hyperlaunch: obtain cmdline from device tree Alejandro Vallejo
2025-04-09 22:04 ` Denis Mukhin
2025-04-14 14:54 ` Alejandro Vallejo
2025-04-10 11:12 ` Jan Beulich
2025-04-14 14:23 ` Alejandro Vallejo
2025-04-14 15:09 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 11/16] x86/hyperlaunch: locate dom0 initrd with hyperlaunch Alejandro Vallejo
2025-04-09 22:07 ` Denis Mukhin
2025-04-14 15:03 ` Alejandro Vallejo
2025-04-10 11:34 ` Jan Beulich
2025-04-14 17:06 ` Alejandro Vallejo
2025-04-14 17:27 ` Alejandro Vallejo
2025-04-15 6:17 ` Jan Beulich
2025-04-15 11:59 ` Alejandro Vallejo
2025-04-15 14:11 ` Jan Beulich
2025-04-16 13:19 ` Daniel P. Smith
2025-04-15 6:12 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 12/16] x86/hyperlaunch: add domain id parsing to domain config Alejandro Vallejo
2025-04-09 22:15 ` Denis Mukhin
2025-04-14 18:07 ` Alejandro Vallejo
2025-04-15 0:28 ` Stefano Stabellini
2025-04-15 6:21 ` Jan Beulich
2025-04-15 11:37 ` Alejandro Vallejo
2025-04-15 14:13 ` Jan Beulich
2025-04-10 11:49 ` Jan Beulich
2025-04-14 18:35 ` Alejandro Vallejo
2025-04-15 6:27 ` Jan Beulich
2025-04-15 12:05 ` Alejandro Vallejo
2025-04-15 14:16 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 13/16] x86/hyperlaunch: specify dom0 mode with device tree Alejandro Vallejo
2025-04-09 22:24 ` Denis Mukhin
2025-04-10 11:55 ` Jan Beulich
2025-04-14 18:45 ` Alejandro Vallejo
2025-04-10 11:57 ` Jan Beulich
2025-04-16 13:32 ` Daniel P. Smith
2025-04-16 13:38 ` Jan Beulich
2025-04-16 14:09 ` Daniel P. Smith
2025-04-16 14:24 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 14/16] x86/hyperlaunch: add memory parsing to domain config Alejandro Vallejo
2025-04-09 22:29 ` Denis Mukhin
2025-04-14 18:49 ` Alejandro Vallejo
2025-04-10 12:03 ` Jan Beulich
2025-04-14 18:59 ` Alejandro Vallejo
2025-04-16 13:37 ` Daniel P. Smith
2025-04-16 13:41 ` Jan Beulich
2025-04-16 14:12 ` Daniel P. Smith
2025-04-16 14:27 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 15/16] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree Alejandro Vallejo
2025-04-09 22:33 ` Denis Mukhin
2025-04-14 19:07 ` Alejandro Vallejo
2025-04-10 12:08 ` Jan Beulich
2025-04-14 19:12 ` Alejandro Vallejo
2025-04-16 13:42 ` Daniel P. Smith
2025-04-16 13:54 ` Alejandro Vallejo
2025-04-16 14:16 ` Daniel P. Smith
2025-04-16 13:54 ` Jan Beulich
2025-04-16 14:19 ` Daniel P. Smith
2025-04-16 14:31 ` Jan Beulich
2025-04-08 16:07 ` [PATCH v3 16/16] x86/hyperlaunch: add capabilities to boot domain Alejandro Vallejo
2025-04-09 22:39 ` Denis Mukhin
2025-04-14 19:17 ` Alejandro Vallejo
2025-04-10 12:18 ` Jan Beulich
2025-04-10 12:18 ` Jan Beulich
2025-04-14 19:31 ` Alejandro Vallejo
2025-04-15 6:38 ` Jan Beulich
2025-04-15 12:22 ` Alejandro Vallejo
2025-04-15 14:20 ` Jan Beulich
2025-04-09 6:29 ` [PATCH v3 00/16] Hyperlaunch device tree for dom0 Jan Beulich
2025-04-09 10:19 ` Alejandro Vallejo
2025-04-09 10:39 ` 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=D96EX0QNDA51.1KN145E8H1PCI@amd.com \
--to=agarciav@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=dmkhn@proton.me \
--cc=dpsmith@apertussolutions.com \
--cc=jason.andryuk@amd.com \
--cc=jbeulich@suse.com \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/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.