From: Eduardo Habkost <ehabkost@redhat.com>
To: Babu Moger <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
Date: Tue, 2 Jun 2020 13:52:12 -0400 [thread overview]
Message-ID: <20200602175212.GH577771@habkost.net> (raw)
In-Reply-To: <1528498581-131037-2-git-send-email-babu.moger@amd.com>
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://bugzilla.redhat.com/show_bug.cgi?id=1834200
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.
> + encode_topo_cpuid8000001e(cs, cpu,
> + eax, ebx, ecx, edx);
> + break;
> case 0xC0000000:
> *eax = env->cpuid_xlevel2;
> *ebx = 0;
> --
> 1.8.3.1
>
--
Eduardo
WARNING: multiple messages have this Message-ID (diff)
From: Eduardo Habkost <ehabkost@redhat.com>
To: Babu Moger <babu.moger@amd.com>
Cc: geoff@hostfission.com, kvm@vger.kernel.org, mst@redhat.com,
kash@tripleback.net, mtosatti@redhat.com, qemu-devel@nongnu.org,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
pbonzini@redhat.com, rth@twiddle.net
Subject: Re: [PATCH v13 1/5] i386: Add support for CPUID_8000_001E for AMD
Date: Tue, 2 Jun 2020 13:52:12 -0400 [thread overview]
Message-ID: <20200602175212.GH577771@habkost.net> (raw)
In-Reply-To: <1528498581-131037-2-git-send-email-babu.moger@amd.com>
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://bugzilla.redhat.com/show_bug.cgi?id=1834200
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.
> + 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-02 17:52 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 22:56 [PATCH v13 0/5] i386: Enable TOPOEXT to support hyperthreading on AMD CPU Babu Moger
2018-06-08 22:56 ` [Qemu-devel] " Babu Moger
2018-06-08 22:56 ` [PATCH v13 1/5] i386: Add support for CPUID_8000_001E for AMD Babu Moger
2018-06-08 22:56 ` [Qemu-devel] " Babu Moger
2018-06-11 20:54 ` Eduardo Habkost
2018-06-11 20:54 ` [Qemu-devel] " Eduardo Habkost
2018-06-11 21:02 ` Moger, Babu
2018-06-11 21:02 ` [Qemu-devel] " Moger, Babu
2020-06-02 17:52 ` Eduardo Habkost [this message]
2020-06-02 17:52 ` Eduardo Habkost
2020-06-03 23:57 ` Babu Moger
2020-06-03 23:57 ` Babu Moger
2020-06-04 14:06 ` Babu Moger
2020-06-04 14:06 ` Babu Moger
2020-06-04 20:54 ` Eduardo Habkost
2020-06-04 20:54 ` Eduardo Habkost
2020-06-05 16:21 ` Babu Moger
2020-06-05 16:21 ` Babu Moger
2018-06-08 22:56 ` [PATCH v13 2/5] i386: Introduce auto_topoext bit to manage topoext Babu Moger
2018-06-08 22:56 ` [Qemu-devel] " Babu Moger
2018-06-11 20:25 ` Moger, Babu
2018-06-11 20:25 ` [Qemu-devel] " Moger, Babu
2018-06-11 20:46 ` Eduardo Habkost
2018-06-11 20:46 ` [Qemu-devel] " Eduardo Habkost
2018-06-11 20:59 ` Moger, Babu
2018-06-11 20:59 ` [Qemu-devel] " Moger, Babu
2018-06-11 21:05 ` Eduardo Habkost
2018-06-11 21:05 ` [Qemu-devel] " Eduardo Habkost
2018-06-11 21:20 ` Moger, Babu
2018-06-11 21:20 ` [Qemu-devel] " Moger, Babu
2018-06-08 22:56 ` [PATCH v13 3/5] i386: Enable TOPOEXT feature on AMD EPYC CPU Babu Moger
2018-06-08 22:56 ` [Qemu-devel] " Babu Moger
2018-06-11 20:50 ` Eduardo Habkost
2018-06-11 20:50 ` [Qemu-devel] " Eduardo Habkost
2018-06-11 21:01 ` Moger, Babu
2018-06-11 21:01 ` [Qemu-devel] " Moger, Babu
2018-06-11 21:10 ` Eduardo Habkost
2018-06-11 21:10 ` [Qemu-devel] " Eduardo Habkost
2018-06-12 16:29 ` Moger, Babu
2018-06-12 16:29 ` [Qemu-devel] " Moger, Babu
2018-06-12 17:40 ` Eduardo Habkost
2018-06-12 17:40 ` [Qemu-devel] " Eduardo Habkost
2018-06-12 18:38 ` Moger, Babu
2018-06-12 18:38 ` [Qemu-devel] " Moger, Babu
2018-06-12 19:05 ` Eduardo Habkost
2018-06-12 19:05 ` [Qemu-devel] " Eduardo Habkost
2018-06-12 19:46 ` Babu Moger
2018-06-12 19:46 ` [Qemu-devel] " Babu Moger
2018-06-13 16:52 ` Moger, Babu
2018-06-13 16:52 ` [Qemu-devel] " Moger, Babu
2018-06-13 17:18 ` Eduardo Habkost
2018-06-13 17:18 ` [Qemu-devel] " Eduardo Habkost
2018-06-13 18:10 ` Moger, Babu
2018-06-13 18:10 ` [Qemu-devel] " Moger, Babu
2018-06-13 18:12 ` Moger, Babu
2018-06-13 18:12 ` [Qemu-devel] " Moger, Babu
2018-06-13 18:17 ` Eduardo Habkost
2018-06-13 18:17 ` [Qemu-devel] " Eduardo Habkost
2018-06-13 18:21 ` Moger, Babu
2018-06-13 18:21 ` [Qemu-devel] " Moger, Babu
2018-06-13 18:49 ` Eduardo Habkost
2018-06-13 18:49 ` [Qemu-devel] " Eduardo Habkost
2018-06-14 0:58 ` Moger, Babu
2018-06-14 0:58 ` [Qemu-devel] " Moger, Babu
2018-06-08 22:56 ` [PATCH v13 4/5] i386: Verify and enable topoext feature if supported Babu Moger
2018-06-08 22:56 ` [Qemu-devel] " Babu Moger
2018-06-11 20:51 ` Eduardo Habkost
2018-06-11 20:51 ` [Qemu-devel] " Eduardo Habkost
2018-06-11 21:01 ` Moger, Babu
2018-06-11 21:01 ` [Qemu-devel] " Moger, Babu
2018-06-08 22:56 ` [PATCH v13 5/5] i386: Remove generic SMT thread check Babu Moger
2018-06-08 22:56 ` [Qemu-devel] " 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=20200602175212.GH577771@habkost.net \
--to=ehabkost@redhat.com \
--cc=babu.moger@amd.com \
--cc=dgilbert@redhat.com \
--cc=geoff@hostfission.com \
--cc=kash@tripleback.net \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.