All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] Add guest CPU topology support
@ 2018-01-08  4:01 Chao Gao
  2018-01-08  4:01 ` [RFC PATCH 1/8] x86/domctl: introduce a pair of hypercall to set and get cpu topology Chao Gao
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Chao Gao @ 2018-01-08  4:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, Daniel De Graaf, Chao Gao

This series of patches add guest CPU topology support for hvm.

CPU topology here means the number of sockets, the number of cores in
each socket and the number of threads in each core. Currently, guest CPU
topology cannot be specified except the number of sockets through virtual
numa. For Intel CPU, CPU topology is exposed to software via extended topology
leaf (CPUID.0xb). However, it isn't emulated. Without this CPUID leaf, the
x2APIC ID cannot be exposed to guest. At this end, it would limit the number
of vcpus. Although guest virtual NUMA is configurable, it isn't complete
because it isn't consistent with NUMA information exposed by guest CPUID. For
more information about how software should get CPU topology, please refer to
"PROGRAMMING CONSIDERATIONS FOR HARDWARE MULTI-THREADING CAPABLE PROCESSORS".

This series of patches make following contributions:
1. complete guest's virtual NUMA emulation
2. make guest CPU topology configurable
3. add guest CPUID.0xb emulation, which also removes the number of vcpus
limitation.

With this series, guest CPU topology can be specified in the guest
configuration. When creating guest, libxl would assign an APIC_ID to each
vCPU and pass these APIC_IDs down to Xen via hypercall before creating vCPUs
so that vCPUs can be initilized with correct APIC_IDs. Then, when setting up
guest CPUID policy, guest CPU topology is obtained from Xen via hypercall and
then part of the return values of CPUID.0xb, CPUID.4 are emulated accordingly.
In hvmloader, guest CPU topology is retrieved from Xen in order to build
ACPI and boot APs.

Chao Gao (8):
  x86/domctl: introduce a pair of hypercall to set and get cpu topology
  x86/vlapic: use apic_id array to set initial (x2)APIC ID
  xl/parse: introduce cpu_topology to guest config
  libxl: calculate and set vcpu topology
  xen/mem: handle XENMEM_get_cpu_topology in compat_memory_op
  hvmloader: get CPU topology information from hypervisor
  libacpi: build madt/srat according cpu topology
  x86/cpuid: emulate extended topology enumeration leaf

 docs/man/xl.cfg.pod.5.in             | 21 +++++++++
 tools/firmware/hvmloader/Makefile    |  2 +-
 tools/firmware/hvmloader/hvmloader.c |  8 ++++
 tools/firmware/hvmloader/smp.c       |  3 +-
 tools/firmware/hvmloader/topology.c  | 57 ++++++++++++++++++++++++
 tools/firmware/hvmloader/topology.h  | 36 +++++++++++++++
 tools/firmware/hvmloader/util.c      |  8 +++-
 tools/libacpi/build.c                |  4 +-
 tools/libacpi/libacpi.h              |  5 ++-
 tools/libxc/include/xenctrl.h        | 15 +++++++
 tools/libxc/xc_cpuid_x86.c           | 86 +++++++++++++++++++++++++++++++++---
 tools/libxc/xc_domain.c              | 71 +++++++++++++++++++++++++++++
 tools/libxl/libxl_arch.h             |  4 ++
 tools/libxl/libxl_arm.c              |  6 +++
 tools/libxl/libxl_dom.c              |  4 ++
 tools/libxl/libxl_types.idl          |  8 ++++
 tools/libxl/libxl_x86.c              | 70 +++++++++++++++++++++++++++++
 tools/libxl/libxl_x86_acpi.c         |  6 ++-
 tools/xl/xl_parse.c                  | 19 ++++++++
 xen/arch/x86/cpuid.c                 | 32 +++++++++++++-
 xen/arch/x86/domctl.c                | 35 +++++++++++++++
 xen/arch/x86/hvm/hvm.c               |  7 +++
 xen/arch/x86/hvm/vlapic.c            | 10 ++---
 xen/arch/x86/mm.c                    | 45 +++++++++++++++++++
 xen/common/compat/memory.c           | 21 +++++++++
 xen/include/asm-x86/cpuid.h          | 12 +++++
 xen/include/asm-x86/hvm/domain.h     | 18 ++++++++
 xen/include/public/domctl.h          | 22 +++++++++
 xen/include/public/memory.h          | 27 ++++++++++-
 xen/include/xlat.lst                 |  1 +
 xen/include/xsm/dummy.h              |  6 +++
 xen/xsm/dummy.c                      |  1 +
 xen/xsm/flask/hooks.c                | 10 +++++
 xen/xsm/flask/policy/access_vectors  |  4 ++
 34 files changed, 661 insertions(+), 23 deletions(-)
 create mode 100644 tools/firmware/hvmloader/topology.c
 create mode 100644 tools/firmware/hvmloader/topology.h

-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-04-24  8:26 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-08  4:01 [RFC PATCH 0/8] Add guest CPU topology support Chao Gao
2018-01-08  4:01 ` [RFC PATCH 1/8] x86/domctl: introduce a pair of hypercall to set and get cpu topology Chao Gao
2018-01-08 18:14   ` Daniel De Graaf
2018-01-09  9:06     ` Chao Gao
2018-01-09 17:18       ` Daniel De Graaf
2018-01-09 19:51         ` Chao Gao
2018-01-09 23:47   ` Andrew Cooper
2018-01-09 20:47     ` Chao Gao
2018-01-10  9:09       ` Andrew Cooper
2018-04-23 16:00   ` Jan Beulich
2018-01-08  4:01 ` [RFC PATCH 2/8] x86/vlapic: use apic_id array to set initial (x2)APIC ID Chao Gao
2018-04-23 16:04   ` Jan Beulich
2018-04-24  7:53     ` Chao Gao
2018-04-24  8:26       ` Jan Beulich
2018-01-08  4:01 ` [RFC PATCH 3/8] xl/parse: introduce cpu_topology to guest config Chao Gao
2018-01-08  4:01 ` [RFC PATCH 4/8] libxl: calculate and set vcpu topology Chao Gao
2018-01-08  4:01 ` [RFC PATCH 5/8] xen/mem: handle XENMEM_get_cpu_topology in compat_memory_op Chao Gao
2018-01-08  4:01 ` [RFC PATCH 6/8] hvmloader: get CPU topology information from hypervisor Chao Gao
2018-01-08  4:01 ` [RFC PATCH 7/8] libacpi: build madt/srat according cpu topology Chao Gao
2018-01-08  4:01 ` [RFC PATCH 8/8] x86/cpuid: emulate extended topology enumeration leaf Chao Gao

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.