aboutsummaryrefslogtreecommitdiff
path: root/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-10-29 16:05:38 +0200
committerAvi Kivity <avi@redhat.com>2009-10-29 16:05:38 +0200
commit8ba2882e4e833ccd46db3c37833f76b2f22b8d2b (patch)
tree460d25810e7b1a67f2556863b6dc0ede15dbe0d3 /kvm
parentUpdate bios.bin (vapic removal) (diff)
downloadqemu-kvm-8ba2882e4e833ccd46db3c37833f76b2f22b8d2b.tar.gz
qemu-kvm-8ba2882e4e833ccd46db3c37833f76b2f22b8d2b.tar.bz2
qemu-kvm-8ba2882e4e833ccd46db3c37833f76b2f22b8d2b.zip
vmxcap: support msrs with numerical subfields
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'kvm')
-rwxr-xr-xkvm/scripts/vmxcap23
1 files changed, 23 insertions, 0 deletions
diff --git a/kvm/scripts/vmxcap b/kvm/scripts/vmxcap
index 50fb86eeb..93051c68e 100755
--- a/kvm/scripts/vmxcap
+++ b/kvm/scripts/vmxcap
@@ -59,6 +59,29 @@ class Control(object):
s = 'yes'
print ' %-40s %s' % (self.bits[bit], s)
+class Misc(object):
+ def __init__(self, name, bits, msr):
+ self.name = name
+ self.bits = bits
+ self.msr = msr
+ def show(self):
+ print self.name
+ value = msr().read(self.msr, 0)
+ def first_bit(key):
+ if type(key) is tuple:
+ return key[0]
+ else:
+ return key
+ for bits in sorted(self.bits.keys(), key = first_bit):
+ if type(bits) is tuple:
+ lo, hi = bits
+ fmt = int
+ else:
+ lo = hi = bits
+ fmt = bool
+ v = (value >> lo) & ((1 << (hi - lo + 1)) - 1)
+ print ' %-40s %s' % (self.bits[bits], fmt(v))
+
controls = [
Control(
name = 'pin-based controls',