Skip to content

Support configurable CPU Model-Specific Registers (MSRs) in cpudefs

Josh Triplett qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Add cpudef option to GPF on unknown MSRsqemu-config.c target-i386/cpu.h target-i386/cpuid.c +1 more+25 -40 replies
2/3Support arbitrary additional MSRs in cpu definitionsqemu-config.c target-i386/cpu.h target-i386/cpuid.c +1 more+73 -00 replies
3/3Handle parse failures in CPU definitions, and avoid adding a partial cpudeftarget-i386/cpuid.c+4 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] Support configurable CPU Model-Specific Registers (MSRs) in cpudefs

This patch series adds configuration options allowing CPU definitions to support rdmsr on arbitrary MSRs with corresponding values, and to GPF on unknown MSRs. This allows better emulation of CPU-specific behavior. I plan to use this to allow testing many of the CPU-specific tests in BITS
(http://biosbits.org/) via qemu/kvm rather than always via real systems with the CPUs in question.

I've attached a sample configuration file for these new options, created by copying the "Nehalem" CPU definition from the standard configuration file and adding "NehalemGPF" and "NehalemMSR" definitions which take advantage of the first and the first two patches, respectively. This sample configuration makes it easy to validate the behavior added by the first two patches.

I used a QDict to store the map from MSR numbers to values. Unfortunately, QDict only supports strings as keys, so I had to format the MSR as a hex string before looking it up.

The third patch in the series provides a bugfix for CPU definition parsing, which will otherwise add a partial CPU definition (up to the parse failure) to the list of CPU definitions.

Written on the plane to linux.conf.au.

Josh Triplett (3):
Add cpudef option to GPF on unknown MSRs
Support arbitrary additional MSRs in cpu definitions Handle parse failures in CPU definitions, and avoid adding a partial
cpudef

 qemu-config.c           |    6 ++++
 target-i386/cpu.h       |    6 ++++
 target-i386/cpuid.c     |   59 ++++++++++++++++++++++++++++++++++++++++++++++-
 target-i386/op_helper.c |   36 +++++++++++++++++++++++++---
 4 files changed, 102 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.8.3