On Thu, Oct 08, 2009 at 05:58:22PM +0200, Avi Kivity wrote:
On 10/08/2009 12:03 PM, Joerg Roedel wrote:Hmm, struct vcpu_svm is defined in svm.c and local to that file. It is
This patch adds a dedicated kvm tracepoint for a nestedIt's better to pass only 'svm' as argument and have the tracepoint
vmrun.
Signed-off-by: Joerg Roedel<joerg.roedel@xxxxxxx>
---
arch/x86/kvm/svm.c | 6 ++++++
arch/x86/kvm/trace.h | 33 +++++++++++++++++++++++++++++++++
arch/x86/kvm/x86.c | 1 +
3 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 884bffc..907af3f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1726,6 +1726,12 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
/* nested_vmcb is our indicator if nested SVM is activated */
svm->nested.vmcb = svm->vmcb->save.rax;
+ trace_kvm_nested_vmrun(svm->vmcb->save.rip - 3, svm->nested.vmcb,
+ nested_vmcb->save.rip,
+ nested_vmcb->control.int_ctl,
+ nested_vmcb->control.event_inj,
+ nested_vmcb->control.nested_ctl);
+
code derive everything else, since (I think) argument setup is done
unconditionally, and only the actual trace_kvm call is patched out.
It may not work out due to where the trace code is compiled, but
it's worth trying.
not known in x86.c, where the tracepoints are compiled, or in svm.c
where trace.h is included. Is this tracepoint it worth it to move the
definition of vcpu_svm into a (x86-)global header?