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

Re: [PATCH v3 09/16] x86/hyperlaunch: locate dom0 kernel with hyperlaunch


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Mon, 14 Apr 2025 14:58:51 +0100
  • 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=sy597cODJ56+FOhqRWzJ1gQXGTJKR+k+qSI6Gh93lO4=; b=SPye6g24xVvBclyayiqfAiqpA+PDfRMo2hr7Wl1tT5bJHzSxzmuwhM3534d2PifKVkR7vFau2UYz//s8KAOxQoR7xvvxgYcCKt/jCJpt9Bh5FApqh8CK6lJrzDWLa1WPOeOAS3GsPsWvX7sVxKU6uLAhFXXrjyKFo+nZfvFem+fXKhP0x0297vX7CLKCH6J4plfmUQKg5c4bJIpG8BZSNxzYaN9Moy0LYFls4dsXj4SWJ1F2BEPdoVZ7+vVIuh3fEwk0QHyVzOvB6e5oEStsDQzgu0lgqMczsivPLsA8YQCMRqWTzu9k1HVbH+ABT59QlF5DJeSr2zh22AU3j/S3WQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MBrQFPeTp2Ij8psBv0GNxFriMoEARRmMleDV4Qsg1Fxp+ZCLGwIuGuY2sSZ9QQw5gQlHN3pECdtJSyLQ4S1HQaAlXOO4Ha4wYzt/VFoG2HQGbQvieCMV6sFTuAA9SkZsA1qwkMbvF+GBXeJbsi7qMrpMqjcG7R77FzekfRgwX+vcTwz+Trj0zkkNbMiaGk4I2exrSmAiDtD+ZUoiZNzTu7M7asWLgXsLYXYWSnYJaIGrgFdjRvU8G9u4+teSlxnqCdsxLOYm5XrO0AAZxkEQ0DjEVNAYgd5KZ+LZzd8GGhxxi57bnrxca+odTqDTy435y5OpOdJmyeKDT+Lsd/fH4A==
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 14 Apr 2025 13:59:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu Apr 10, 2025 at 11:58 AM BST, Jan Beulich wrote:
> On 08.04.2025 18:07, Alejandro Vallejo wrote:
>> From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
>> 
>> 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@xxxxxxxxxxxxxxxxxxxx>
>> Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
>> Signed-off-by: Alejandro Vallejo <agarciav@xxxxxxx>
>> ---
>> v3:
>>     * Add const to fdt
>>     * Remove idx == NULL checks
>>     * Add BUILD_BUG_ON for MAX_NR_BOOTMODS fitting in a uint32_t
>
> At least this one looks to rather belong into patch 08?

Urg, yes. Sorry. There was a lot of code motion when I factored out the
helpers.

>
>> --- 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);
>
> Oh, okay - regarding my earlier comment elsewhere: If the sizes come from DT,
> then of course ASSERT_UNREACHABLE() can't be used at the place where bogus
> ones are rejected.
>
>> +    fdt_for_each_subnode(node, fdt, dom_node)
>> +    {
>> +        if ( fdt_node_check_compatible(fdt, node, "multiboot,kernel") == 0 )
>> +        {
>
> When the loop body is merely an if() with a non-negligible body, inverting
> the condition and using "continue" is usually better. Much like you do ...

This becomes a chain of if conditions later on, one per property.

>
>> +            int idx;
>> +
>> +            if ( bd->kernel )
>> +            {
>> +                printk(XENLOG_ERR "Duplicate kernel module for domain %s\n",
>> +                       name);
>> +                continue;
>
> ... here already.
>
> Jan

Cheers,
Alejandro




 


Rackspace

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