diff options
author | Avi Kivity <avi@redhat.com> | 2009-10-29 16:05:38 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-10-29 16:05:38 +0200 |
commit | 8ba2882e4e833ccd46db3c37833f76b2f22b8d2b (patch) | |
tree | 460d25810e7b1a67f2556863b6dc0ede15dbe0d3 /kvm | |
parent | Update bios.bin (vapic removal) (diff) | |
download | qemu-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-x | kvm/scripts/vmxcap | 23 |
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', |