qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Generate x86 cpu features
@ 2024-02-06 13:47 Tim Wiederhake
  2024-02-06 13:47 ` [PATCH v3 1/5] target/i386: Split out feature_word_info Tim Wiederhake
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Tim Wiederhake @ 2024-02-06 13:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Igor Mammedov, Philippe Mathieu-Daudé, Paolo Bonzini,
	Daniel P . Berrangé, Michael S . Tsirkin, Tim Wiederhake

Synchronizing the list of cpu features and models with qemu is a recurring
task in libvirt. For x86, this is done by reading qom-list-properties for
max-x86_64-cpu and manually filtering out everthing that does not look like
a feature name, as well as parsing target/i386/cpu.c for cpu models.

This is a flawed, tedious and error-prone procedure. Ideally, qemu
and libvirt would query a common source for cpu feature and model
related information. Meanwhile, converting this information into an easier
to parse format would help libvirt a lot.

This patch series converts the cpu feature information present in
target/i386/cpu.c (`feature_word_info`) into a yaml file and adds a
script to generate the c code from this data.

v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-08/msg02005.html
v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-09/msg01773.html

Changes since v2:
* Rebased on top of current master
* Removed all "drive-by" changes to feature names ("vmx-ept-uc", "vmx-ept-wb",
  "kvmclock", "vmx-invept-single-context", and
  "vmx-invept-single-context-noglobals") as these needed further discussion.
* Changes to the generator script reduce the changes in formatting to the
  current feature_word_info even further to address the concern about code
  legibility. See Patch 5, "target/i386: Generate feature_word_info.c.inc" for
  all non-whitespace changes.

Tim Wiederhake (5):
  target/i386: Split out feature_word_info
  target/i386: Translate feature_word_info to yaml
  target/i386: Remove comments from feature_word_info.c.inc
  target/i386: Fix feature_word_info.c.inc formatting
  target/i386: Generate feature_word_info.c.inc

 target/i386/cpu.c                   | 679 +-------------------------
 target/i386/feature_word_info.c.inc | 710 ++++++++++++++++++++++++++++
 target/i386/feature_word_info.py    |  71 +++
 target/i386/feature_word_info.yaml  | 701 +++++++++++++++++++++++++++
 4 files changed, 1483 insertions(+), 678 deletions(-)
 create mode 100644 target/i386/feature_word_info.c.inc
 create mode 100755 target/i386/feature_word_info.py
 create mode 100644 target/i386/feature_word_info.yaml

-- 
2.43.0



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

end of thread, other threads:[~2024-03-11 11:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06 13:47 [PATCH v3 0/5] Generate x86 cpu features Tim Wiederhake
2024-02-06 13:47 ` [PATCH v3 1/5] target/i386: Split out feature_word_info Tim Wiederhake
2024-02-06 13:47 ` [PATCH v3 2/5] target/i386: Translate feature_word_info to yaml Tim Wiederhake
2024-02-06 13:47 ` [PATCH v3 3/5] target/i386: Remove comments from feature_word_info.c.inc Tim Wiederhake
2024-02-06 13:47 ` [PATCH v3 4/5] target/i386: Fix feature_word_info.c.inc formatting Tim Wiederhake
2024-02-06 13:47 ` [PATCH v3 5/5] target/i386: Generate feature_word_info.c.inc Tim Wiederhake
2024-03-04 12:04 ` [PATCH v3 0/5] Generate x86 cpu features Tim Wiederhake
2024-03-05 14:17 ` Daniel P. Berrangé
2024-03-11 11:32   ` Tim Wiederhake
2024-03-11 11:58     ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).