[libvirt PATCH 0/3] Add missing feature detection to sync tool in cpu_map

sync_qemu_i386.py in src/cpu_map is a tool to sync CPU models from qemu with libvirt. It currently has no provisions for detecting new features that are not implemented in libvirt yet. This series changes that. See also https://www.redhat.com/archives/libvir-list/2020-November/msg00271.html. libvirt is currently missing three x86 CPU models: Denverton, KnightsMill, and Snowridge; and seven features: core-capability, fsrm, perfctr-core, split-lock-detect, vmx-eptp-switching, vmx-pml, and vmx-rdseed-exit. For the Snowridge CPU model and the core-capability and split-lock-detect features, see also https://www.redhat.com/archives/libvir-list/2020-November/msg00924.html. Tim Wiederhake (3): cpu_map: sync_qemu_i386: Detect features missing in translation table cpu_map: sync_qemu_i386: Add features missing in translation table cpu_map: sync_qemu_i386: Detect features missing in libvirt src/cpu_map/sync_qemu_i386.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) -- 2.26.2

Signed-off-by: Tim Wiederhake <twiederh@redhat.com> --- src/cpu_map/sync_qemu_i386.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py index 8deda869df..fb4eea101b 100755 --- a/src/cpu_map/sync_qemu_i386.py +++ b/src/cpu_map/sync_qemu_i386.py @@ -364,6 +364,16 @@ def main(): with open(name, "wt") as f: output_model(f, model) + features = set() + for model in models: + features.update(model["features"]) + + untranslated = [x for x in features if x not in T.values()] + if untranslated: + print( + "Features not in the translation table:", + ", ".join(sorted(untranslated))) + if __name__ == "__main__": main() -- 2.26.2

Signed-off-by: Tim Wiederhake <twiederh@redhat.com> --- src/cpu_map/sync_qemu_i386.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py index fb4eea101b..684fc96dc0 100755 --- a/src/cpu_map/sync_qemu_i386.py +++ b/src/cpu_map/sync_qemu_i386.py @@ -142,6 +142,14 @@ T = { "MSR_ARCH_CAP_TAA_NO": "taa-no", "MSR_CORE_CAP_SPLIT_LOCK_DETECT": "split-lock-detect", + # identically named features + "avx512ifma": "avx512ifma", + "fsrm": "fsrm", + "perfctr-core": "perfctr-core", + "vmx-eptp-switching": "vmx-eptp-switching", + "vmx-pml": "vmx-pml", + "vmx-rdseed-exit": "vmx-rdseed-exit", + # always disabled features "CPUID_EXT_MONITOR": None, "0": None, -- 2.26.2

Signed-off-by: Tim Wiederhake <twiederh@redhat.com> --- src/cpu_map/sync_qemu_i386.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py index 684fc96dc0..8844aa00cd 100755 --- a/src/cpu_map/sync_qemu_i386.py +++ b/src/cpu_map/sync_qemu_i386.py @@ -5,6 +5,7 @@ import copy import lark import os import re +import xml.etree.ElementTree T = { @@ -382,6 +383,15 @@ def main(): "Features not in the translation table:", ", ".join(sorted(untranslated))) + filename = os.path.join(args.outdir, "x86_features.xml") + DOMTree = xml.etree.ElementTree.parse(filename) + known = [x.attrib["name"] for x in DOMTree.getroot().iter("feature")] + unknown = [x for x in features if x not in known] + if unknown: + print( + "Features not in libvirt:", + ", ".join(sorted(unknown))) + if __name__ == "__main__": main() -- 2.26.2

On Wed, 2020-11-18 at 12:19 +0100, Tim Wiederhake wrote:
sync_qemu_i386.py in src/cpu_map is a tool to sync CPU models from qemu with libvirt. It currently has no provisions for detecting new features that are not implemented in libvirt yet. This series changes that.
See also https://www.redhat.com/archives/libvir-list/2020-November/msg00271.html.
libvirt is currently missing three x86 CPU models: Denverton, KnightsMill, and Snowridge; and seven features: core-capability, fsrm, perfctr-core, split-lock-detect, vmx-eptp-switching, vmx-pml, and vmx-rdseed-exit.
For the Snowridge CPU model and the core-capability and split-lock- detect features, see also https://www.redhat.com/archives/libvir-list/2020-November/msg00924.html.
Tim Wiederhake (3): cpu_map: sync_qemu_i386: Detect features missing in translation table cpu_map: sync_qemu_i386: Add features missing in translation table cpu_map: sync_qemu_i386: Detect features missing in libvirt
src/cpu_map/sync_qemu_i386.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
-- 2.26.2
"Ohnosecond", Noun, /ˈoʊnoʊˌsɛkənd/: The fraction of time between making a mistake and realizing it. Disregard this series. There is a bug in the sync_qemu_i386.py script that needs adressing first. Will send out v2 later. Tim

On Wed, 2020-11-18 at 12:19 +0100, Tim Wiederhake wrote:
sync_qemu_i386.py in src/cpu_map is a tool to sync CPU models from qemu with libvirt. It currently has no provisions for detecting new features that are not implemented in libvirt yet. This series changes that.
See also https://www.redhat.com/archives/libvir-list/2020-November/msg00271.html.
libvirt is currently missing three x86 CPU models: Denverton, KnightsMill, and Snowridge; and seven features: core-capability, fsrm, perfctr-core, split-lock-detect, vmx-eptp-switching, vmx-pml, and vmx-rdseed-exit.
For the Snowridge CPU model and the core-capability and split-lock- detect features, see also https://www.redhat.com/archives/libvir-list/2020-November/msg00924.html.
Tim Wiederhake (3): cpu_map: sync_qemu_i386: Detect features missing in translation table cpu_map: sync_qemu_i386: Add features missing in translation table cpu_map: sync_qemu_i386: Detect features missing in libvirt
src/cpu_map/sync_qemu_i386.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
-- 2.26.2
Superseded by https://www.redhat.com/archives/libvir-list/2020-November/msg01267.html
participants (1)
-
Tim Wiederhake