Skip to content

x86: Expose consistent topology to guests

Alejandro Vallejo xen-devel 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest10 patches 16 repliesIn review
  2. v611 patches 25 repliesSuperseded
  3. v510 patches 2 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v410 patches6 repliesSuperseded
v36 patches8 repliesSuperseded
v28 patches31 repliesSuperseded
v16 patches25 repliesSuperseded

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10lib/x86: Bump max basic leaf in {pv,hvm}_max_policyxen/arch/x86/cpu-policy.c+6 -01 reply
2/10xen/x86: Add initial x2APIC ID to the per-vLAPIC save areaxen/arch/x86/cpuid.c xen/arch/x86/hvm/vlapic.c xen/arch/x86/include/asm/hvm/vlapic.h +1 more+30 -136 replies
3/10xen/x86: Add supporting code for uploading LAPIC contexts during domain createxen/arch/x86/hvm/vlapic.c+20 -01 reply
4/10tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselvestools/firmware/hvmloader/config.h tools/firmware/hvmloader/hvmloader.c tools/firmware/hvmloader/mp_tables.c +3 more+63 -165 replies
5/10tools/libacpi: Use LUT of APIC IDs rather than function pointertools/firmware/hvmloader/util.c tools/include/xenguest.h tools/libacpi/build.c +3 more+16 -162 replies
6/10tools/libguest: Always set vCPU context in vcpu_hvm()tools/libs/guest/xg_dom_x86.c+44 -400 replies
7/10xen/lib: Add topology generator for x86tools/tests/cpu-policy/test-cpu-policy.c xen/include/xen/lib/x86/cpu-policy.h xen/lib/x86/policy.c +1 more+246 -00 replies
8/10xen/x86: Derive topologically correct x2APIC IDs from the policytools/tests/cpu-policy/test-cpu-policy.c xen/include/xen/lib/x86/cpu-policy.h xen/lib/x86/policy.c+155 -00 replies
9/10tools/libguest: Set distinct x2APIC IDs for each vCPUtools/libs/guest/xg_dom_x86.c+18 -10 replies
10/10tools/x86: Synthesise domain topologiestools/include/xenguest.h tools/libs/guest/xg_cpuid_x86.c tools/libs/light/libxl_dom.c +1 more+58 -51 reply

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchJan Beulich
1/10
2/10
3/10R-b
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 00/10] x86: Expose consistent topology to guests

Current topology handling is close to non-existent. As things stand, APIC IDs are allocated through the apic_id=vcpu_id*2 relation without giving any hints to the OS on how to parse the x2APIC ID of a given CPU and assuming the guest will assume 2 threads per core.

This series involves bringing x2APIC IDs into the migration stream, so older guests keep operating as they used to and enhancing Xen+toolstack so new guests get topology information consistent with their x2APIC IDs. As a side effect of this, x2APIC IDs are now packed and don't have (unless under a pathological case) gaps.

Further work ought to allow combining this topology configurations with gang-scheduling of guest hyperthreads into affine physical hyperthreads. For the time being it purposefully keeps the configuration of "1 socket" + "1 thread per core" + "1 core per vCPU".

===

Other minor changes highlighted in each individual patch.

Hypervisor prerequisites:

patch 1: lib/x86: Bump max basic leaf in {pv,hvm}_max_policy
* Conceptually similar to v6/patch1 ("Relax checks about policy compatibility"), but operates on the max policies instead.
patch 2: xen/x86: Add initial x2APIC ID to the per-vLAPIC save area patch 3: xen/x86: Add supporting code for uploading LAPIC contexts during
domain create

hvmloader prerequisites

patch 4: tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

Toolstack prerequisites:

patch 5: tools/libacpi: Use LUT of APIC IDs rather than function pointer patch 6: tools/libguest: Always set vCPU context in vcpu_hvm()

No functional changes:

patch 7: xen/lib: Add topology generator for x86
* Tweaked the behaviour of the cache leaves on overflow and added stronger checks.
patch 8: xen/x86: Derive topologically correct x2APIC IDs from the policy

Final toolstack/xen stitching:

patch 9: tools/libguest: Set distinct x2APIC IDs for each vCPU patch 10: xen/x86: Synthesise domain topologies

v6: https://lore.kernel.org/xen-devel/[email protected]
v5: https://lore.kernel.org/xen-devel/[email protected]/
v4: https://lore.kernel.org/xen-devel/[email protected]/
v3: https://lore.kernel.org/xen-devel/[email protected]/
v2: https://lore.kernel.org/xen-devel/[email protected]/
v1: https://lore.kernel.org/xen-devel/[email protected]/

Alejandro Vallejo (10):
lib/x86: Bump max basic leaf in {pv,hvm}_max_policy xen/x86: Add initial x2APIC ID to the per-vLAPIC save area xen/x86: Add supporting code for uploading LAPIC contexts during
domain create
tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves tools/libacpi: Use LUT of APIC IDs rather than function pointer tools/libguest: Always set vCPU context in vcpu_hvm() xen/lib: Add topology generator for x86
xen/x86: Derive topologically correct x2APIC IDs from the policy tools/libguest: Set distinct x2APIC IDs for each vCPU tools/x86: Synthesise domain topologies

 tools/firmware/hvmloader/config.h        |   5 +-
 tools/firmware/hvmloader/hvmloader.c     |   6 +-
 tools/firmware/hvmloader/mp_tables.c     |   4 +-
 tools/firmware/hvmloader/smp.c           |  57 +++++--
 tools/firmware/hvmloader/util.c          |   7 +-
 tools/include/xen-tools/common-macros.h  |   5 +
 tools/include/xenguest.h                 |   8 +
 tools/libacpi/build.c                    |   6 +-
 tools/libacpi/libacpi.h                  |   2 +-
 tools/libs/guest/xg_cpuid_x86.c          |  29 +++-
 tools/libs/guest/xg_dom_x86.c            |  93 +++++++----
 tools/libs/light/libxl_dom.c             |  25 +++
 tools/libs/light/libxl_x86_acpi.c        |   7 +-
 tools/tests/cpu-policy/test-cpu-policy.c | 201 +++++++++++++++++++++++
 xen/arch/x86/cpu-policy.c                |  15 +-
 xen/arch/x86/cpuid.c                     |  18 +-
 xen/arch/x86/hvm/vlapic.c                |  42 ++++-
 xen/arch/x86/include/asm/hvm/vlapic.h    |   1 +
 xen/include/public/arch-x86/hvm/save.h   |   2 +
 xen/include/xen/lib/x86/cpu-policy.h     |  27 +++
 xen/lib/x86/policy.c                     | 169 +++++++++++++++++++
 xen/lib/x86/private.h                    |   4 +
 22 files changed, 649 insertions(+), 84 deletions(-)

base-commit: 081683ea578da56dd20b9dc22a64d03c893b47ba

Signature · 1 line
2.47.0