qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Like Xu <like.xu@linux.intel.com>
To: qemu-devel@nongnu.org
Cc: "Andrew Jones" <drjones@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Brice Goglin" <Brice.Goglin@inria.fr>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH v2 0/5] Introduce cpu die topology and enable CPUID.1F for i386
Date: Tue, 21 May 2019 00:50:51 +0800	[thread overview]
Message-ID: <20190520165056.175475-1-like.xu@linux.intel.com> (raw)

Multi-chip packaging technology allows integration of multi-cores in one die
and multi-dies in one single package, for example Intel CLX-AP or AMD EPYC.

This kind of integration can be enabled by high-performance, heterogeneous,
multi-dies interconnect technology, providing a more cost-effective manner. 
QEMU and guests may take advantages of multi-dies host for such as guest
placing or energy efficiency management...

This patch series extend the CPU topology to the socket/dies/core/thread model,
allowing the setting of dies number per one socket on -smp qemu command. For
i386, it upgrades APIC_IDs generation and reversion functions with a new exposed
leaf called CPUID.1F, which is a preferred superset to leaf 0BH. The CPUID.1F
spec is on https://software.intel.com/en-us/articles/intel-sdm, 3-190 Vol 2A.

E.g. we use -smp 4,dies=2,cores=2,threads=1 to run an MCP kvm-guest,
check raw cpuid data and the expected output from guest is following:
0x0000001f 0x00: eax=0x00000000 ebx=0x00000001 ecx=0x00000100 edx=0x00000002
0x0000001f 0x01: eax=0x00000001 ebx=0x00000002 ecx=0x00000201 edx=0x00000001
0x0000001f 0x02: eax=0x00000002 ebx=0x00000004 ecx=0x00000502 edx=0x00000003
0x0000001f 0x03: eax=0x00000000 ebx=0x00000000 ecx=0x00000003 edx=0x00000001

==changelog==

v2:

- Enable cpu die-level topolgy only for PCMachine and X86CPU
- Minimize cpuid.0.eax to the setting value actually used by guest
- Update cmd line -smps docs for die-level configurations
- Refactoring topo-bit tests for x86_apicid_from_cpu_idx() with nr_dies
- Based on "[PATCH v3 00/10] Refactor cpu topo into machine properties"
- Rebase to commit 2259637b95bef3116cc262459271de08e038cc66

v1: https://patchwork.kernel.org/cover/10876667/

Like Xu (5):
  target/i386: Add cpu die-level topology support for X86CPU
  i386/cpu: Consolidate die-id validity in smp context
  vl.c: Add -smp, dies=* command line support and update -smp doc
  i386/cpu: Update apicid parsing rules and topo-bit tests for dies
  target/i386: Add CPUID.1F generation support for multi-die PCMachine

 hmp.c                      |  3 ++
 hw/core/machine.c          | 12 +++++
 hw/i386/pc.c               | 52 +++++++++++++++++-----
 include/hw/i386/pc.h       |  2 +
 include/hw/i386/topology.h | 76 +++++++++++++++++++++++---------
 qapi/misc.json             |  6 ++-
 qemu-options.hx            | 17 ++++----
 target/i386/cpu.c          | 59 ++++++++++++++++++++++---
 target/i386/cpu.h          |  7 +++
 target/i386/kvm.c          | 30 ++++++++++++-
 tests/test-x86-cpuid.c     | 84 ++++++++++++++++++-----------------
 vl.c                       | 89 +++++++++++++++++++++++++++++++++++++-
 12 files changed, 347 insertions(+), 90 deletions(-)

-- 
2.21.0



             reply	other threads:[~2019-05-21  8:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 16:50 Like Xu [this message]
2019-05-20 16:50 ` [Qemu-devel] [PATCH v2 1/5] target/i386: Add cpu die-level topology support for X86CPU Like Xu
2019-06-06  3:24   ` Eduardo Habkost
2019-06-06  3:32   ` Eduardo Habkost
2019-06-10 13:42     ` Like Xu
2019-05-20 16:50 ` [Qemu-devel] [PATCH v2 2/5] i386/cpu: Consolidate die-id validity in smp context Like Xu
2019-05-21 17:12   ` Dr. David Alan Gilbert
2019-05-28  2:27     ` Like Xu
2019-05-20 16:50 ` [Qemu-devel] [PATCH v2 3/5] vl.c: Add -smp, dies=* command line support and update -smp doc Like Xu
2019-06-06  3:15   ` Eduardo Habkost
2019-05-20 16:50 ` [Qemu-devel] [PATCH v2 4/5] i386/cpu: Update apicid parsing rules and topo-bit tests for dies Like Xu
2019-05-20 16:50 ` [Qemu-devel] [PATCH v2 5/5] target/i386: Add CPUID.1F generation support for multi-die PCMachine Like Xu

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=20190520165056.175475-1-like.xu@linux.intel.com \
    --to=like.xu@linux.intel.com \
    --cc=Brice.Goglin@inria.fr \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@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).