diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2017-12-15 16:23:26 +1100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-02-05 13:54:38 +0100 |
commit | fe29141bee3e8603a39838897698d8349c3daef0 (patch) | |
tree | 8e7b4e8142d03a0a5d788a340966b4e05a3df671 /accel/kvm/kvm-all.c | |
parent | bf853881690db8bbd1de39e4be580310a9cb0ebc (diff) | |
download | qemu-fe29141bee3e8603a39838897698d8349c3daef0.zip qemu-fe29141bee3e8603a39838897698d8349c3daef0.tar.gz qemu-fe29141bee3e8603a39838897698d8349c3daef0.tar.bz2 |
kvm: Add kvm_set_user_memory tracepoint
This adds a tracepoint to trace the KVM_SET_USER_MEMORY_REGION ioctl
parameters which is quite useful for debugging VFIO memory regions
being actually registered with KVM.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-Id: <20171215052326.21386-1-aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/kvm/kvm-all.c')
-rw-r--r-- | accel/kvm/kvm-all.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f290f48..b91fcb7 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -235,6 +235,7 @@ static int kvm_set_user_memory_region(KVMMemoryListener *kml, KVMSlot *slot) { KVMState *s = kvm_state; struct kvm_userspace_memory_region mem; + int ret; mem.slot = slot->slot | (kml->as_id << 16); mem.guest_phys_addr = slot->start_addr; @@ -248,7 +249,10 @@ static int kvm_set_user_memory_region(KVMMemoryListener *kml, KVMSlot *slot) kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, &mem); } mem.memory_size = slot->memory_size; - return kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, &mem); + ret = kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, &mem); + trace_kvm_set_user_memory(mem.slot, mem.flags, mem.guest_phys_addr, + mem.memory_size, mem.userspace_addr, ret); + return ret; } int kvm_destroy_vcpu(CPUState *cpu) |