[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC PATCH 0/8] Add guest CPU topology support



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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.