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

Re: [PATCH v5 08/12] x86/hyperlaunch: add domain id parsing to domain config


  • To: Jason Andryuk <jason.andryuk@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Fri, 25 Apr 2025 13:43:55 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=NcYmEprzaZs/Q6kbtd2FxUIRyxvkasqXfYSFz94h1RQ=; b=U6Tnx6LG6VuhnLngVtX6GPYIZQnsxLOEjvdxUzhMLtCE7S/fEiIZhjMwC8dhcgzY254JQB4v5pVAKHHVwrtFaM5ASiaSfhrZQf1TBLuu64YVd/w8Y+cRYTv+Na0FEeCRnSxvELqbhVOZcAw7RxruthObrGFUZBBtkThAOdLUhwOEVEIDKT7pRWi0ceReDcxb87xIefyUQ+YqIqatQwgbb+ixcgjTFefrdtKWyt2GurJOzq7C5TR4LM3FCJ7YolN30RQs6xQZZ4TmGT7IdEZV9QdjX8yXe4u8wUvUAWSx9ErK0w1xhPFOy5vwXX8/jFhuVZp8/s91EKWN1tyiumtz3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z20d6EkBUDoNWTvRJY1cTxP0n/5MbquVCJhvLW4xdyYNbNSylVB6B9ER708rJCM7CZNJZJQowGcLPTtUistwUBS+G9DetGq2xG8/aj5ulVvPNIcCn29eno52ELexGfJh6VjgiakP7BwESylvUQQ9VhPKoLXPsSmxXKGXxoa2WO1rxE9vQFfDPp6MfgDyGQHB3MF92NS4atKTL39KTx9dCdmq4b8xMO2skwwDSckxArb53eJdszsyALA8huPt0j4DF4YRIjmt2iJLvROYxc3/+rmC+WZYQrhqQhRc4CR1h3Bay1QRYcw/t/H7KtCzJgBsZ0kJEsSgwz0G4HLk4m6VaQ==
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, 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>
  • Delivery-date: Fri, 25 Apr 2025 12:44:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu Apr 24, 2025 at 6:41 PM BST, Jason Andryuk wrote:
> On 2025-04-24 12:10, Alejandro Vallejo wrote:
>> From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
>> 
>> Introduce the ability to specify the desired domain id for the domain
>> definition. The domain id will be populated in the domid property of the
>> domain node in the device tree configuration.
>> 
>> Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
>> Signed-off-by: Alejandro Vallejo <agarciav@xxxxxxx>
>> ---
>
>> diff --git a/xen/common/domain-builder/fdt.c 
>> b/xen/common/domain-builder/fdt.c
>> index 144fcc75b5..5a5b3c8806 100644
>> --- a/xen/common/domain-builder/fdt.c
>> +++ b/xen/common/domain-builder/fdt.c
>
>> @@ -188,12 +189,54 @@ static int __init fdt_read_multiboot_module(const void 
>> *fdt, int node,
>>   static int __init process_domain_node(
>>       struct boot_info *bi, const void *fdt, int dom_node)
>>   {
>> -    int node;
>> +    int node, property;
>>       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_property_offset(property, fdt, dom_node)
>> +    {
>> +        const struct fdt_property *prop;
>> +        const char *prop_name;
>> +        int name_len, rc;
>> +
>> +        prop = fdt_get_property_by_offset(fdt, property, NULL);
>> +        if ( !prop )
>> +            continue; /* silently skip */
>> +
>> +        prop_name = fdt_get_string(fdt, fdt32_to_cpu(prop->nameoff), 
>> &name_len);
>> +
>
> Stray blank line.
>
>> +        if ( !strncmp(prop_name, "domid", name_len) )
>> +        {
>> +            uint32_t val = DOMID_INVALID;
>> +
>> +            if ( (rc = fdt_prop_as_u32(prop, &val)) )
>> +            {
>> +                printk(XENLOG_ERR
>> +                       "  failed processing domain id for domain %s\n", 
>> name);
>> +                return rc;
>> +            }
>
> Maybe add a blank line here?
>
>> +            if ( val >= DOMID_FIRST_RESERVED )
>> +            {
>> +                printk(XENLOG_ERR "  invalid domain id for domain %s\n", 
>> name);
>> +                return -EINVAL;
>> +            }
>> +
>
>> @@ -258,6 +301,13 @@ static int __init process_domain_node(
>>           return -ENODATA;
>>       }
>>   
>> +    if ( bd->domid == DOMID_INVALID )
>> +        bd->domid = get_initial_domain_id();
>> +    else if ( bd->domid != get_initial_domain_id() )
>> +        printk(XENLOG_WARNING
>> +               "warning: unsupported boot. d%d is not the initial 
>> domain.\n",
>
> Maybe:
> "warning: d%u is not the expected initial domid (%u)\n" ?
>
> It's a strange message.  The domid property is added, but it's not 
> expected to actually be used?

It's just a transient message until multidomain boot is added in a later
series. It's merely informative that you're booting something you
probably didn't mean to. Or didn't mean to on this hypervisor.

>
> With the newlines addressed (and optionally the message change):

I'm happy to make those adjustments.

>
> Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

Thanks

>
> Thanks,
> Jason

Cheers,
Alejandro



 


Rackspace

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