public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Zhang Rui <rui.zhang@intel.com>,
	rafael@kernel.org, lenb@kernel.org, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org
Cc: rui.zhang@intel.com, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, jmattson@google.com
Subject: Re: [PATCH] x86/acpi: Fix LAPIC/x2APIC parsing order
Date: Tue, 10 Dec 2024 23:51:30 +0100	[thread overview]
Message-ID: <87zfl3b18t.ffs@tglx> (raw)
In-Reply-To: <20241022001712.9218-1-rui.zhang@intel.com>

On Tue, Oct 22 2024 at 08:17, Zhang Rui wrote:
> On some systems, the same CPU (with the same APIC ID) is assigned a
> different logical CPU id after commit ec9aedb2aa1a ("x86/acpi: Ignore
> invalid x2APIC entries").
>
> This means that Linux enumerates the CPUs in a different order, which
> violates ACPI specification[1] that states:
>
>   "OSPM should initialize processors in the order that they appear in
>    the MADT"
>
> The problematic commit parses all LAPIC entries before any x2APIC
> entries, aiming to ignore x2APIC entries with APIC ID < 255 when valid
> LAPIC entries exist. However, it disrupts the CPU enumeration order on
> systems where x2APIC entries precede LAPIC entries in the MADT.
>
> Fix the problem by separately checking LAPIC entries before parsing any
> LAPIC or x2APIC entries.

I really had to stare at the change to understand how this fixes
anything. What you want to say is:

Fix this problem by:

    1) Parsing LAPIC entries first without registering them in the
       topology to evaluate whether valid LAPIC entries exist.

    2) Restoring the MADT in order parser which invokes either the LAPIC or
       the X2APIC parser function depending on the entry type.

       The X2APIC parser still ignores entries < 0xff in case that #1
       found valid LAPIC entries independent of their position in the
       MADT table.

Other than that:

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

       

  parent reply	other threads:[~2024-12-10 22:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22  0:17 [PATCH] x86/acpi: Fix LAPIC/x2APIC parsing order Zhang Rui
2024-12-10 14:59 ` Jim Mattson
2024-12-10 22:51 ` Thomas Gleixner [this message]
2024-12-11  5:40   ` Zhang, Rui

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=87zfl3b18t.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=jmattson@google.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox