From: Babu Moger <babu.moger@amd.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "geoff@hostfission.com" <geoff@hostfission.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"mst@redhat.com" <mst@redhat.com>,
"kash@tripleback.net" <kash@tripleback.net>,
"mtosatti@redhat.com" <mtosatti@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"rth@twiddle.net" <rth@twiddle.net>
Subject: RE: [PATCH v13 1/5] i386: Add support for CPUID_8000_001E for AMD
Date: Thu, 4 Jun 2020 09:06:27 -0500 [thread overview]
Message-ID: <b6e22360-5fa0-9ade-624d-9de1f76b360b@amd.com> (raw)
In-Reply-To: <20200602175212.GH577771@habkost.net>
> -----Original Message-----
> From: Eduardo Habkost <ehabkost@redhat.com>
> Sent: Tuesday, June 2, 2020 12:52 PM
> To: Moger, Babu <Babu.Moger@amd.com>
> Cc: mst@redhat.com; marcel.apfelbaum@gmail.com; pbonzini@redhat.com;
> rth@twiddle.net; mtosatti@redhat.com; qemu-devel@nongnu.org;
> kvm@vger.kernel.org; kash@tripleback.net; geoff@hostfission.com; Dr. David
> Alan Gilbert <dgilbert@redhat.com>
> Subject: Re: [PATCH v13 1/5] i386: Add support for CPUID_8000_001E for AMD
>
> On Fri, Jun 08, 2018 at 06:56:17PM -0400, Babu Moger wrote:
> > Add support for cpuid leaf CPUID_8000_001E. Build the config that closely
> > match the underlying hardware. Please refer to the Processor Programming
> > Reference (PPR) for AMD Family 17h Model for more details.
> >
> > Signed-off-by: Babu Moger <babu.moger@amd.com>
> [...]
> > + case 0x8000001E:
> > + assert(cpu->core_id <= 255);
>
> It is possible to trigger this assert using:
>
> $ qemu-system-x86_64 -machine q35,accel=kvm,kernel-irqchip=split -device
> intel-iommu,intremap=on,eim=on -smp
> 1,maxcpus=258,cores=258,threads=1,sockets=1 -cpu
> qemu64,xlevel=0x8000001e -device qemu64-x86_64-cpu,apic-id=257
> qemu-system-x86_64: warning: Number of hotpluggable cpus requested (258)
> exceeds the recommended cpus supported by KVM (240)
> qemu-system-x86_64:
> /home/ehabkost/rh/proj/virt/qemu/target/i386/cpu.c:5888: cpu_x86_cpuid:
> Assertion `cpu->core_id <= 255' failed.
> Aborted (core dumped)
>
> See bug report and discussion at
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.
> redhat.com%2Fshow_bug.cgi%3Fid%3D1834200&data=02%7C01%7Cbabu.
> moger%40amd.com%7C8a2724729b914bc9b53d08d8071db392%7C3dd8961fe4
> 884e608e11a82d994e183d%7C0%7C0%7C637267171438806408&sdata=ib
> iGlF%2FF%2FVtYQLf7fe988kxFsLhj4GrRiTOq4LUuOT8%3D&reserved=0
>
> Also, it looks like encode_topo_cpuid8000001e() assumes core_id
> has only 3 bits, so the existing assert() is not even sufficient.
> We need to decide what to do if the user requests nr_cores > 8.
>
> Probably omitting CPUID[0x8000001E] if the VCPU topology is
> incompatible with encode_topo_cpuid8000001e() (and printing a
> warning) is the safest thing to do right now.
Eduardo, We need to generalize the encode_topo_cpuid8000001e decoding.
We will have to remove 3 bit limitation there. It will not scale with
latest configurations. I will take a look that.
For now, best option I think is to(like you mentioned in bug 1834200),
declaring nr_cores > 256 as never supported (or deprecated); and throw
warning.
What do you think?
>
>
>
> > + encode_topo_cpuid8000001e(cs, cpu,
> > + eax, ebx, ecx, edx);
> > + break;
> > case 0xC0000000:
> > *eax = env->cpuid_xlevel2;
> > *ebx = 0;
> > --
> > 1.8.3.1
> >
>
> --
> Eduardo
next prev parent reply other threads:[~2020-06-04 14:07 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 22:56 [Qemu-devel] [PATCH v13 0/5] i386: Enable TOPOEXT to support hyperthreading on AMD CPU Babu Moger
2018-06-08 22:56 ` [Qemu-devel] [PATCH v13 1/5] i386: Add support for CPUID_8000_001E for AMD Babu Moger
2018-06-11 20:54 ` Eduardo Habkost
2018-06-11 21:02 ` Moger, Babu
2020-06-02 17:52 ` Eduardo Habkost
2020-06-03 23:57 ` Babu Moger
2020-06-04 14:06 ` Babu Moger [this message]
2020-06-04 20:54 ` Eduardo Habkost
2020-06-05 16:21 ` Babu Moger
2018-06-08 22:56 ` [Qemu-devel] [PATCH v13 2/5] i386: Introduce auto_topoext bit to manage topoext Babu Moger
2018-06-11 20:25 ` Moger, Babu
2018-06-11 20:46 ` Eduardo Habkost
2018-06-11 20:59 ` Moger, Babu
2018-06-11 21:05 ` Eduardo Habkost
2018-06-11 21:20 ` Moger, Babu
2018-06-08 22:56 ` [Qemu-devel] [PATCH v13 3/5] i386: Enable TOPOEXT feature on AMD EPYC CPU Babu Moger
2018-06-11 20:50 ` Eduardo Habkost
2018-06-11 21:01 ` Moger, Babu
2018-06-11 21:10 ` Eduardo Habkost
2018-06-12 16:29 ` Moger, Babu
2018-06-12 17:40 ` Eduardo Habkost
2018-06-12 18:38 ` Moger, Babu
2018-06-12 19:05 ` Eduardo Habkost
2018-06-12 19:46 ` Babu Moger
2018-06-13 16:52 ` Moger, Babu
2018-06-13 17:18 ` Eduardo Habkost
2018-06-13 18:10 ` Moger, Babu
2018-06-13 18:12 ` Moger, Babu
2018-06-13 18:17 ` Eduardo Habkost
2018-06-13 18:21 ` Moger, Babu
2018-06-13 18:49 ` Eduardo Habkost
2018-06-14 0:58 ` Moger, Babu
2018-06-08 22:56 ` [Qemu-devel] [PATCH v13 4/5] i386: Verify and enable topoext feature if supported Babu Moger
2018-06-11 20:51 ` Eduardo Habkost
2018-06-11 21:01 ` Moger, Babu
2018-06-08 22:56 ` [Qemu-devel] [PATCH v13 5/5] i386: Remove generic SMT thread check Babu Moger
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=b6e22360-5fa0-9ade-624d-9de1f76b360b@amd.com \
--to=babu.moger@amd.com \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=geoff@hostfission.com \
--cc=kash@tripleback.net \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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;
as well as URLs for NNTP newsgroup(s).