Skip to content

xl: add cpuid config file option

Andre Przywara xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5libxl: introduce cpuid interface to domain buildtools/libxl/libxl.c tools/libxl/libxl.h tools/libxl/libxl.idl +3 more+43 -01 reply
2/5libxl: add xlu_cfg_get_type functiontools/libxl/libxlu_cfg.c tools/libxl/libxlutil.h+24 -03 replies
3/5xl: implement parsing of cpuid parameter and translate to Xen interfacetools/libxl/libxl.c tools/libxl/libxl.h tools/libxl/xl_cmdimpl.c+231 -02 replies
4/5libxl: implementating legacy xm cpuid parsertools/libxl/libxl.c tools/libxl/libxl.h+62 -00 replies
5/5xl: enable parser switch for both legacy and new cpuid parserstools/libxl/xl_cmdimpl.c+74 -90 replies

Reviews trailers per patch

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

PatchIan Campbell
1/5A-b
2/5
3/5
4/5
5/5

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

Read the v1 thread

Cover letter [PATCH 0/5 -v3] xl: add cpuid config file option

Hi,

again an updated version of the patch series to introduce a cpuid parameter in xl. Changes from v2:
- fix the IDL part to use pass-by-reference and to make the type opaque
- use strtok_r instead of strtok to avoid interference with other strtoks.
- fix 3DNow bit numbers (swapped 3dnow and 3dnowext)
- fix bug with cpuid=""
- fix bug with comparison of flag names
- make one error message more verbose

Hope that this is the final version.

Regards,
Andre.

--------------
xl is currently ignoring the cpuid= variable in the config file. As I don't like the current interface xm exposes (basically because it is complicated, unintuitive and very error prone), I implemented a new scheme for specifying CPUID flags policy, combining QEMU's and Xen's approach:
cpuid = "<base>,<feature_name>=[01xks]*,...
The patch includes a (preliminary) list of feature names along with their bit positions. The value for each feature bit copies the current meaning is Xen:
0: clear, 1: set, x: don't care/use default, k: keep from host, s: use host but preserve across migration
The value can also be a number (either in hex or decimal), so things like "stepping=3" can be easily specified.
To show you the advantage, I quote the example config file:

Quoted 4 lines

#cpuid=[ '1:ecx=xxxxxxxxxxx00xxxxxxxxxxxxxxxxxxx,
# eax=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ]
# - Unset the SSE4 features (CPUID.1[ECX][20-19])
# - Default behaviour for all other bits in ECX And EAX registers.

new version: cpuid = "host,sse4.1=0,sse4.2=0"

Quoted 9 lines

# Expose to the guest multi-core cpu instead of multiple processors # Example for intel, expose a 8-core processor :
#cpuid=['1:edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
# ebx=xxxxxxxx00010000xxxxxxxxxxxxxxxx',
# '4,0:eax=001111xxxxxxxxxxxxxxxxxxxxxxxxxx']

#  - CPUID.1[EDX][HT] : Enable HT
#  - CPUID.1[EBX] : Number of vcpus * 2
#  - CPUID.4,0[EAX] : Number of vcpus * 2 - 1

#vcpus=8

new version: cpuid = "host,htt=1,proccount=16,maxcores=15"

Quoted 9 lines

# Example for amd, expose a 5-core processor :

# cpuid = ['1:ebx=xxxxxxxx00001010xxxxxxxxxxxxxxxx,
#             edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
# '0x80000001:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1x',
# '0x80000008:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx001001']
#  - CPUID.1[EBX] : Threads per Core * Cores per Socket (2 * #vcpus)
#  - CPUID.1[EDX][HT] : Enable HT
#  - CPUID.0x80000001[CmpLegacy] : Use legacy method
#  - CPUID.0x80000008[ECX] : #vcpus * 2 - 1

new version: cpuid="host,htt=1,cmplegacy=1,proccount=10,nc=9"

Signature · 3 lines
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448-3567-12