]> xenbits.xensource.com Git - libvirt.git/commit
cputest: Add support for MSR features to cpu-gather.sh
authorJiri Denemark <jdenemar@redhat.com>
Tue, 26 Mar 2019 09:18:10 +0000 (10:18 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 12 Apr 2019 20:53:39 +0000 (22:53 +0200)
commitab3d6ea0da59b32f7fa9103a219f6565b1964212
tree47c2780b0d940c648e4d9e3c3682ca9780ff3a65
parent4dbb82a967b839d2cc2acd7e069bcd0333af1d50
cputest: Add support for MSR features to cpu-gather.sh

This patch adds an inline python code for reading MSR features. Since
reading MSRs is a privileged operation, we have to read them from
/dev/cpu/*/msr if it is readable (i.e., the script runs as root) or
fallback to using KVM ioctl which can be done by any user that can start
virtual machines.

The python code is inlined rather than provided in a separate script
because whenever there's an issue with proper detection of CPU features,
we ask the reporter to run cpu-gather.sh script to give us all data we
need to know about the host CPU. Asking them to run several scripts
would likely result in one of them being ignored or forgotten.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/cputestdata/cpu-gather.sh