Skip to contentSkip to conversation

KVM: arm/arm64: Output Guest cntvoff value

PATCH In review [email protected] 2 participants 5 messages Jan 1, 2016 – Jan 11, 2016 KVM arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: arm/arm64: Output Guest cntvoff value

From: Amit Tomar <[email protected]>

This provides an easy access to guest's CVTVOFF value, somewhat similar to how x86 outputs TSC offset value.

---
 virt/kvm/arm/arch_timer.c |    1 +
 virt/kvm/arm/trace.h      |   15 +++++++++++++++
 2 files changed, 16 insertions(+)
virt/kvm/arm/arch_timer.c +1 -0
index 69bca18..b0800fe 100644
@@ -466,4 +466,5 @@ void kvm_timer_enable(struct kvm *kvm)
 void kvm_timer_init(struct kvm *kvm)
 {
 	kvm->arch.timer.cntvoff = kvm_phys_timer_read();
+	trace_kvm_timer_init(kvm->arch.timer.cntvoff);
 }
virt/kvm/arm/trace.h +15 -0
index 37d8b98..c7e1c2f 100644
@@ -52,6 +52,21 @@ TRACE_EVENT(kvm_timer_update_irq,
 		  __entry->vcpu_id, __entry->irq, __entry->level)
 );
 
+TRACE_EVENT(kvm_timer_init,
+	TP_PROTO(unsigned long long cntvoff),
+	TP_ARGS(cntvoff),
+
+	TP_STRUCT__entry(
+		__field(	unsigned long long, cntvoff)
+	),
+
+	TP_fast_assign(
+		__entry->cntvoff	= cntvoff;
+	),
+
+	TP_printk("CNTVOFF: %llx", __entry->cntvoff)
+);
+
 #endif /* _TRACE_KVM_H */
 
 #undef TRACE_INCLUDE_PATH
Signature · 1 line
1.7.9.5
author
#2 lore raw
Quoted 1 line

Out of curiosity, what is the value of having this?

As we know that host and guest clocks are not in sync(Running at a difference of CNTVOFF value initialized in guest). This value can be used to correlate the trace event between host and guest.

Thanks,
Amit.

#3 lore raw
Quoted 6 lines · Amit Tomer
Quoted 1 line

Out of curiosity, what is the value of having this?

As we know that host and guest clocks are not in sync(Running at a difference of CNTVOFF value initialized in guest). This value can be used to correlate the trace event between host and guest.

ok, I'm fine with this patch.

-Christoffer

author
#4 lore raw
Quoted 1 line

ok, I'm fine with this patch.

ok, Thanks.