[PATCH 0/2] Decoding of kvm ioctl using struct kvm_cpuid2

Pierre Marsais pierre.marsais at lse.epita.fr
Sat Jun 23 00:10:12 UTC 2018


Hi,

This patchset add decoding of the following ioctl:
 - KVM_SET_CPUID2
 - KVM_GET_SUPPORTED_CPUID
 - KVM_GET_EMULATED_CPUID

Example output:
$ strace -yy -e ioctl qemu-system-x86_64 -enable-kvm $IMAGE
[...]
ioctl(12</dev/kvm<char 10:232>>, KVM_GET_SUPPORTED_CPUID,
0x7fa3a3ea9000) = -1 E2BIG (Argument list too long)
ioctl(12</dev/kvm<char 10:232>>, KVM_GET_SUPPORTED_CPUID, {nent=33,
entries=[...]}) = 0
[...]
$ strace -yy -e -v ioctl ./my-kvm $KERNEL # Cut for briefness
[...]
ioctl(4</dev/kvm<char 10:232>>, KVM_GET_SUPPORTED_CPUID, {nent=33,
entries=[{function=0, index=0, flags=0, eax=0xd, ebx=0x756e6547,
ecx=0x6c65746e, edx=0x49656e69}, ... ]}) = 0
ioctl(6<anon_inode:kvm-vcpu:0>, KVM_SET_CPUID2, {nent=33,
entries=[{function=0, index=0, flags=0, eax=0xd, ebx=0x756e6547,
ecx=0x6c65746e, edx=0x49656e69}, ... ]}) = 0
[...]

Pierre Marsais (2):
  kvm: decode the argument of KVM_SET_CPUID2 and KVM_GET_*_CPUID ioctl
    command
  kvm: add tests for KVM_SET_CPUID2 and KVM_GET_SUPPORTED_CPUID ioctl

 configure.ac            |  1 +
 kvm.c                   | 60 +++++++++++++++++++++++++++++++++++++++++
 tests/ioctl_kvm_run.c   | 28 +++++++++++++++++++
 xlat/kvm_cpuid_flags.in |  3 +++
 4 files changed, 92 insertions(+)
 create mode 100644 xlat/kvm_cpuid_flags.in

-- 
2.17.1



More information about the Strace-devel mailing list