public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
	Usama Arif <usama.arif@bytedance.com>,
	tglx@linutronix.de, kim.phillips@amd.com, brgerst@gmail.com,
	Sabin Rapan <sabrapan@amazon.com>,
	piotrgorski@cachyos.org, oleksandr@natalenko.name,
	arjan@linux.intel.com, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org,
	pbonzini@redhat.com, paulmck@kernel.org,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	rcu@vger.kernel.org, mimoja@mimoja.de, hewenliang4@huawei.com,
	pmenzel@molgen.mpg.de, fam.zheng@bytedance.com,
	punit.agrawal@bytedance.com, simon.evans@bytedance.com,
	liangma@liangbit.com
Subject: Re: [PATCH v13 00/11] Parallel CPU bringup for x86_64
Date: Tue, 7 Mar 2023 15:35:20 -0800	[thread overview]
Message-ID: <ZAfDhT97ctXSYiYe@google.com> (raw)
In-Reply-To: <1975308c952236895f2d8f0e56af9db288eaf330.camel@infradead.org>

On Tue, Mar 07, 2023, David Woodhouse wrote:
> On Tue, 2023-03-07 at 16:22 -0600, Tom Lendacky wrote:
> > 
> > I did some Qemu/KVM testing. One thing I noticed is that on AMD, CPUID 0xB 
> > EAX will be non-zero only if SMT is enabled. So just booting some guests 
> > without CPU topology never did parallel booting ("smpboot: Disabling 
> > parallel bringup because CPUID 0xb looks untrustworthy"). I would imagine 
> > a bare-metal system that has diabled SMT will not do parallel booting, too 
> > (but I haven't had time to test that).
> 
> Interesting, thanks. Should I change to checking for *both* EAX and EBX
> being zero? That's what I did first, after reading only the Intel SDM.
> But I changed to only EAX because the AMD doc only says that EAX will
> be zero for unsupported leaves.

LOL, nice.  '0' is a prefectly valid output for the shift if there's exactly one
CPU at the current level, which is why Intel states that both EAX and EBX are
cleared.  I assume/hope this is effectively a documentation goof, in that the APM
assumes that all "real" CPUs that support CPUID 0xB also support sub-function 0.

Nit, the AMD says EAX will be zero for unsupported _levels_.  The distinction
matters because if the entire leaf is unsupported, AMD behavior is to zero out
all output registers, even if the input leaf is above the max supported leaf.

Anyways, the kernel already sanity checks the outputs on all x86 CPUs, just
piggyback that logic, e.g. expose detect_extended_topology_leaf() or so.  If AMD
or a VMM is doing something crazy, the kernel is doomed anyways.

  parent reply	other threads:[~2023-03-07 23:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 11:12 [PATCH v13 00/11] Parallel CPU bringup for x86_64 Usama Arif
2023-03-02 11:12 ` [PATCH v13 01/11] x86/apic/x2apic: Allow CPU cluster_mask to be populated in parallel Usama Arif
2023-03-02 11:12 ` [PATCH v13 02/11] cpu/hotplug: Move idle_thread_get() to <linux/smpboot.h> Usama Arif
2023-03-02 11:12 ` [PATCH v13 03/11] cpu/hotplug: Add dynamic parallel bringup states before CPUHP_BRINGUP_CPU Usama Arif
2023-03-02 11:12 ` [PATCH v13 04/11] x86/smpboot: Reference count on smpboot_setup_warm_reset_vector() Usama Arif
2023-03-02 11:12 ` [PATCH v13 05/11] x86/smpboot: Split up native_cpu_up into separate phases and document them Usama Arif
2023-03-02 11:12 ` [PATCH v13 06/11] x86/smpboot: Remove initial_stack on 64-bit Usama Arif
2023-03-02 11:12 ` [PATCH v13 07/11] x86/smpboot: Remove early_gdt_descr " Usama Arif
2023-03-02 11:12 ` [PATCH v13 08/11] x86/smpboot: Remove initial_gs Usama Arif
2023-03-02 11:12 ` [PATCH v13 09/11] x86/smpboot: Support parallel startup of secondary CPUs Usama Arif
2023-03-02 11:12 ` [PATCH v13 10/11] x86/smpboot: Send INIT/SIPI/SIPI to secondary CPUs in parallel Usama Arif
2023-03-02 11:12 ` [PATCH v13 11/11] x86/smpboot: Serialize topology updates for secondary bringup Usama Arif
2023-03-07 14:42 ` [PATCH v13 00/11] Parallel CPU bringup for x86_64 David Woodhouse
2023-03-07 16:45   ` Tom Lendacky
2023-03-07 19:18     ` David Woodhouse
2023-03-07 20:06       ` Tom Lendacky
2023-03-07 22:22         ` Tom Lendacky
2023-03-07 22:27           ` David Woodhouse
2023-03-07 22:55             ` Tom Lendacky
2023-03-08  9:04               ` David Woodhouse
2023-03-08 11:27                 ` [External] " Usama Arif
2023-03-08 12:15                 ` David Laight
2023-03-08 12:19                   ` David Woodhouse
2023-03-08 14:10                 ` [External] " Usama Arif
2023-03-08 14:40                 ` Tom Lendacky
2023-03-07 23:35             ` Sean Christopherson [this message]
2023-03-08  7:38               ` David Woodhouse
2023-03-07 21:00       ` [External] " Usama Arif

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=ZAfDhT97ctXSYiYe@google.com \
    --to=seanjc@google.com \
    --cc=arjan@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=fam.zheng@bytedance.com \
    --cc=hewenliang4@huawei.com \
    --cc=hpa@zytor.com \
    --cc=kim.phillips@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=liangma@liangbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mimoja@mimoja.de \
    --cc=mingo@redhat.com \
    --cc=oleksandr@natalenko.name \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=piotrgorski@cachyos.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=punit.agrawal@bytedance.com \
    --cc=rcu@vger.kernel.org \
    --cc=sabrapan@amazon.com \
    --cc=simon.evans@bytedance.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=usama.arif@bytedance.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