public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: stable@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Naveen N Rao <naveen@kernel.org>
Subject: Re: [PATCH 6.6.y] x86/cpu/amd: Always try detect_extended_topology() on AMD processors
Date: Sun, 21 Sep 2025 19:15:48 +0200	[thread overview]
Message-ID: <2025092105-pager-plethora-13be@gregkh> (raw)
In-Reply-To: <20250915051825.1793-1-kprateek.nayak@amd.com>

On Mon, Sep 15, 2025 at 05:18:25AM +0000, K Prateek Nayak wrote:
> commit cba4262a19afae21665ee242b3404bcede5a94d7 upstream.
> 
> Support for parsing the topology on AMD/Hygon processors using CPUID leaf 0xb
> was added in
> 
>   3986a0a805e6 ("x86/CPU/AMD: Derive CPU topology from CPUID function 0xB when available").
> 
> In an effort to keep all the topology parsing bits in one place, this commit
> also introduced a pseudo dependency on the TOPOEXT feature to parse the CPUID
> leaf 0xb.
> 
> The TOPOEXT feature (CPUID 0x80000001 ECX[22]) advertises the support for
> Cache Properties leaf 0x8000001d and the CPUID leaf 0x8000001e EAX for
> "Extended APIC ID" however support for 0xb was introduced alongside the x2APIC
> support not only on AMD [1], but also historically on x86 [2].
> 
> The support for the 0xb leaf is expected to be confirmed by ensuring
> 
>   leaf <= max supported cpuid_level
> 
> and then parsing the level 0 of the leaf to confirm EBX[15:0]
> (LogProcAtThisLevel) is non-zero as stated in the definition of
> "CPUID_Fn0000000B_EAX_x00 [Extended Topology Enumeration]
> (Core::X86::Cpuid::ExtTopEnumEax0)" in Processor Programming Reference (PPR)
> for AMD Family 19h Model 01h Rev B1 Vol1 [3] Sec. 2.1.15.1 "CPUID Instruction
> Functions".
> 
> This has not been a problem on baremetal platforms since support for TOPOEXT
> (Fam 0x15 and later) predates the support for CPUID leaf 0xb (Fam 0x17[Zen2]
> and later), however, for AMD guests on QEMU, the "x2apic" feature can be
> enabled independent of the "topoext" feature where QEMU expects topology and
> the initial APICID to be parsed using the CPUID leaf 0xb (especially when
> number of cores > 255) which is populated independent of the "topoext" feature
> flag.
> 
> Unconditionally call detect_extended_topology() on AMD processors to first
> parse the topology using the extended topology leaf 0xb before using the
> TOPOEXT leaf (0x8000001e).
> 
> Parsing of "DIE_TYPE" in detect_extended_topology() is specific to CPUID
> leaf 0x1f which is only supported on Intel platforms. Continue using the
> TOPOEXT leaf (0x8000001e) to derive the "cpu_die_id" on AMD platforms.
> 
>   [ prateek: Adapted the fix from the original commit to stable kernel
>     which doesn't contain the x86 topology rewrite, renamed
>     cpu_parse_topology_ext() with the erstwhile
>     detect_extended_topology() function in commit message, dropped
>     references to extended topology leaf 0x80000026 which the stable
>     kernels aren't aware of, make a note of "cpu_die_id" parsing
>     nuances in detect_extended_topology() and why AMD processors should
>     still rely on TOPOEXT leaf for "cpu_die_id". ]

That's a lot of changes.  Why not just use a newer kernel for this new
hardware?  Why backport this in such a different way?  That is going to
cause other changes in the future to be harder to backport in the
future.

What's driving the requirement to run new hardware on old kernels?

thanks,

greg k-h

  reply	other threads:[~2025-09-21 17:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-14 16:34 FAILED: patch "[PATCH] x86/cpu/topology: Always try cpu_parse_topology_ext() on" failed to apply to 6.6-stable tree gregkh
2025-09-15  5:18 ` [PATCH 6.6.y] x86/cpu/amd: Always try detect_extended_topology() on AMD processors K Prateek Nayak
2025-09-21 17:15   ` Greg KH [this message]
2025-09-22  6:30     ` K Prateek Nayak
2025-09-22 12:08       ` Greg KH

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=2025092105-pager-plethora-13be@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kprateek.nayak@amd.com \
    --cc=mingo@redhat.com \
    --cc=naveen@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --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