* [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint
@ 2017-12-15 5:23 Alexey Kardashevskiy
2017-12-15 9:46 ` Darren Kenny
2018-01-15 12:07 ` Paolo Bonzini
0 siblings, 2 replies; 5+ messages in thread
From: Alexey Kardashevskiy @ 2017-12-15 5:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Kardashevskiy
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>
---
Changes:
v2:
* added forgotten change to trace-events
---
accel/kvm/kvm-all.c | 6 +++++-
accel/kvm/trace-events | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
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)
diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events
index f89ba55..58e98ef 100644
--- a/accel/kvm/trace-events
+++ b/accel/kvm/trace-events
@@ -12,4 +12,5 @@ kvm_irqchip_commit_routes(void) ""
kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s vector %d virq %d"
kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d"
kvm_irqchip_release_virq(int virq) "virq %d"
+kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t guest_phys_addr, uint64_t memory_size, uint64_t userspace_addr, int ret) "Slot#%d flags=0x%x gpa=0x%"PRIx64 " size=0x%"PRIx64 " ua=0x%"PRIx64 " ret=%d"
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint
2017-12-15 5:23 [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint Alexey Kardashevskiy
@ 2017-12-15 9:46 ` Darren Kenny
2018-01-02 3:40 ` Alexey Kardashevskiy
2018-01-15 12:07 ` Paolo Bonzini
1 sibling, 1 reply; 5+ messages in thread
From: Darren Kenny @ 2017-12-15 9:46 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: qemu-devel
On Fri, Dec 15, 2017 at 04:23:26PM +1100, Alexey Kardashevskiy wrote:
>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>
>---
>Changes:
>v2:
>* added forgotten change to trace-events
>---
> accel/kvm/kvm-all.c | 6 +++++-
> accel/kvm/trace-events | 1 +
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
>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)
>diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events
>index f89ba55..58e98ef 100644
>--- a/accel/kvm/trace-events
>+++ b/accel/kvm/trace-events
>@@ -12,4 +12,5 @@ kvm_irqchip_commit_routes(void) ""
> kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s vector %d virq %d"
> kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d"
> kvm_irqchip_release_virq(int virq) "virq %d"
>+kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t guest_phys_addr, uint64_t memory_size, uint64_t userspace_addr, int ret) "Slot#%d flags=0x%x gpa=0x%"PRIx64 " size=0x%"PRIx64 " ua=0x%"PRIx64 " ret=%d"
Should the slot not be %u?:
"Slot#%u ...
Otherwise,
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Thanks,
Darren.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint
2017-12-15 9:46 ` Darren Kenny
@ 2018-01-02 3:40 ` Alexey Kardashevskiy
2018-01-15 4:06 ` Alexey Kardashevskiy
0 siblings, 1 reply; 5+ messages in thread
From: Alexey Kardashevskiy @ 2018-01-02 3:40 UTC (permalink / raw)
To: qemu-devel
On 15/12/17 20:46, Darren Kenny wrote:
> On Fri, Dec 15, 2017 at 04:23:26PM +1100, Alexey Kardashevskiy wrote:
>> 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>
>> ---
>> Changes:
>> v2:
>> * added forgotten change to trace-events
>> ---
>> accel/kvm/kvm-all.c | 6 +++++-
>> accel/kvm/trace-events | 1 +
>> 2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> 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)
>> diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events
>> index f89ba55..58e98ef 100644
>> --- a/accel/kvm/trace-events
>> +++ b/accel/kvm/trace-events
>> @@ -12,4 +12,5 @@ kvm_irqchip_commit_routes(void) ""
>> kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s
>> vector %d virq %d"
>> kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d"
>> kvm_irqchip_release_virq(int virq) "virq %d"
>> +kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t
>> guest_phys_addr, uint64_t memory_size, uint64_t userspace_addr, int ret)
>> "Slot#%d flags=0x%x gpa=0x%"PRIx64 " size=0x%"PRIx64 " ua=0x%"PRIx64 "
>> ret=%d"
>
> Should the slot not be %u?:
>
> "Slot#%u ...
Could be, repost?
>
> Otherwise,
>
> Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
>
> Thanks,
>
> Darren.
>
--
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint
2018-01-02 3:40 ` Alexey Kardashevskiy
@ 2018-01-15 4:06 ` Alexey Kardashevskiy
0 siblings, 0 replies; 5+ messages in thread
From: Alexey Kardashevskiy @ 2018-01-15 4:06 UTC (permalink / raw)
To: qemu-devel, Paolo Bonzini
Ping? It is quite simple...
On 02/01/18 14:40, Alexey Kardashevskiy wrote:
> On 15/12/17 20:46, Darren Kenny wrote:
>> On Fri, Dec 15, 2017 at 04:23:26PM +1100, Alexey Kardashevskiy wrote:
>>> 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>
>>> ---
>>> Changes:
>>> v2:
>>> * added forgotten change to trace-events
>>> ---
>>> accel/kvm/kvm-all.c | 6 +++++-
>>> accel/kvm/trace-events | 1 +
>>> 2 files changed, 6 insertions(+), 1 deletion(-)
>>>
>>> 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)
>>> diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events
>>> index f89ba55..58e98ef 100644
>>> --- a/accel/kvm/trace-events
>>> +++ b/accel/kvm/trace-events
>>> @@ -12,4 +12,5 @@ kvm_irqchip_commit_routes(void) ""
>>> kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s
>>> vector %d virq %d"
>>> kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d"
>>> kvm_irqchip_release_virq(int virq) "virq %d"
>>> +kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t
>>> guest_phys_addr, uint64_t memory_size, uint64_t userspace_addr, int ret)
>>> "Slot#%d flags=0x%x gpa=0x%"PRIx64 " size=0x%"PRIx64 " ua=0x%"PRIx64 "
>>> ret=%d"
>>
>> Should the slot not be %u?:
>>
>> "Slot#%u ...
>
>
> Could be, repost?
>
>
>>
>> Otherwise,
>>
>> Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
>>
>> Thanks,
>>
>> Darren.
>>
>
>
--
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint
2017-12-15 5:23 [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint Alexey Kardashevskiy
2017-12-15 9:46 ` Darren Kenny
@ 2018-01-15 12:07 ` Paolo Bonzini
1 sibling, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2018-01-15 12:07 UTC (permalink / raw)
To: Alexey Kardashevskiy, qemu-devel
On 15/12/2017 06:23, Alexey Kardashevskiy wrote:
> 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>
> ---
> Changes:
> v2:
> * added forgotten change to trace-events
> ---
> accel/kvm/kvm-all.c | 6 +++++-
> accel/kvm/trace-events | 1 +
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> 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)
> diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events
> index f89ba55..58e98ef 100644
> --- a/accel/kvm/trace-events
> +++ b/accel/kvm/trace-events
> @@ -12,4 +12,5 @@ kvm_irqchip_commit_routes(void) ""
> kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s vector %d virq %d"
> kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d"
> kvm_irqchip_release_virq(int virq) "virq %d"
> +kvm_set_user_memory(uint32_t slot, uint32_t flags, uint64_t guest_phys_addr, uint64_t memory_size, uint64_t userspace_addr, int ret) "Slot#%d flags=0x%x gpa=0x%"PRIx64 " size=0x%"PRIx64 " ua=0x%"PRIx64 " ret=%d"
>
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-15 12:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-15 5:23 [Qemu-devel] [PATCH qemu v2] kvm: Add kvm_set_user_memory tracepoint Alexey Kardashevskiy
2017-12-15 9:46 ` Darren Kenny
2018-01-02 3:40 ` Alexey Kardashevskiy
2018-01-15 4:06 ` Alexey Kardashevskiy
2018-01-15 12:07 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).