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

RE: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
  • Date: Fri, 17 Jul 2026 06:01:59 +0000
  • Accept-language: ja-JP, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=valinux.co.jp; dmarc=pass action=none header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
  • 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=DVeqx5bqHC1m86JR2w9nU597L7rl0iqQ3jF2E/MLGXQ=; b=SyKhCB5KR3dJ++tkEXzxsC7qiJio5D8rcW14Z26B40pjrfk4hBLlPcGuuFW3fdixmuVJ/6EdRNRs5eQCm29GPIAH21QlkSvBPZ5xIkNuUl9X7h0LVKJtUewNMj9HxgfouiSNOvDv+AGLKePtS9M3bL2/lJQhD4edFZlx3zbwkwvp4Bxxo0TtS5bJhYHb8ykyF7kSX+4LrP0d+s9Gu7kgZJqv+QSPe2mXJmtHRea3UyKvLZoj+TTw3inh5VhYP6ruCkZPoFWhsgWnvMB7f+JVuq+sIVSBblAiVEfhrRkvlXXKRwIG9ECi59MNzioxIDUqi78iL5QDCDko0E9HApScYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TQldbF6VCQy5ipawgVCXWsug0vEJeSYtHgImIoPtUywSxNmodeOXipLtPapqetkgjRL0kelWkSdDGny8JsyXbkDgazCKJbYmyaFWduP+KKK3RNSJK9vv/qX7hmb3KSepsSJbfEVnHKg8z24/+Rg71n60JiKMP+HR+PApJqjAsPmYVip0saAuwaYzsdPpNRNOAnPeqRigXro2fTXkbsOwJGB7VwLh/1ah+ghAdQVlj1mBCxoUtECbfNrIsi8s6wUyVAssUZY8zgfUY78/nHNkwQ4710dzEVI7Y01rrW1vg8yEhz6eWi+L+9lE5Y6SjUz2yYBWEyD/GHV2uO7Y7amUTQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: "Mykyta_Poturai@xxxxxxxx" <Mykyta_Poturai@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 17 Jul 2026 06:02:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdE336EabuJxSEHUSo4bExE1f467ZwQwuAgAD1uqA=
  • Thread-topic: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology

Hi Jan,

> > +static const struct acpi_pptt_processor *__init find_pptt_node(
> > +    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
> > +{
> > +    const struct acpi_subtable_header *entry;
> > +    unsigned long table_end;
> > +    const void *ptr;
> > +
> > +    BUG_ON(!pptt);
> 
> This being a static helper, I don't see a need for such a check.

I will remove it.

> > +    table_end = (unsigned long)pptt + pptt->header.length;
> > +
> > +    ptr = pptt + 1;
> > +
> > +    while ( (unsigned long)ptr + sizeof(struct acpi_subtable_header)
> 
> Please prefer sizeof(<expression>) over sizeof(<type>) whenever there's a
> connection to an expression in use (e.g. sizeof(*entry) here).

Okay, I will fix it.
 
> > +            else if ( level == 0 )
> > +            {
> > +                /*
> > +                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
> > +                 * revision 2 and later. Assume no threading support when
> > +                 * PPTT revision is 1.
> > +                 */
> > +                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
> > +                    threading = true;
> > +                else
> > +                    core_group_key = offset;
> > +            }
> > +            else if ( level == 1 )
> > +            {
> > +                if ( threading )
> > +                    core_group_key = offset;
> > +                else
> > +                    cluster_group_key = offset;
> 
> Mich like you're omitting braces here, you can also ...
> 
> > +            }
> > +            else if ( level == 2 && threading )
> > +            {
> > +                cluster_group_key = offset;
> > +            }
> 
> ... omit them here.

Okay.
 
> > +            if ( !proc->parent )
> > +                break;
> >
> > -        topo->phys_core_id = cpu;
> > -        topo->num_siblings = 1;
> > +            proc = (const struct acpi_pptt_processor *)
> > +                   ((const void *)pptt + proc->parent);
> 
> No need for the outer cast?

I will remove the cast.

> And then - how do you know proc->parent points inside the table?

Thank you for pointing this out.
I will add a proper bounds check here.

> > +        topo->num_siblings = cpumask_weight(topo->thread_sibling);
> > +    }
> > +
> > +out:
> 
> Nit: Labels indented by at least one blank please. See ./CODING_STYLE.

Okay, I will.

> Other comments (of the more general kind) given on earlier patches may also
> apply here.

I will thoroughly check this patch against the general comments from earlier 
patches as well.

Thank you,
Hirokazu Takahashi.

 


Rackspace

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