Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
aec51dc4
Commit
aec51dc4
authored
Jul 01, 2009
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: Trace mmio
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
c323c0e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
arch/x86/kvm/x86.c
arch/x86/kvm/x86.c
+10
-1
include/trace/events/kvm.h
include/trace/events/kvm.h
+33
-0
No files found.
arch/x86/kvm/x86.c
View file @
aec51dc4
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
#include <linux/iommu.h>
#include <linux/iommu.h>
#include <linux/intel-iommu.h>
#include <linux/intel-iommu.h>
#include <linux/cpufreq.h>
#include <linux/cpufreq.h>
#include <trace/events/kvm.h>
#undef TRACE_INCLUDE_FILE
#define CREATE_TRACE_POINTS
#define CREATE_TRACE_POINTS
#include "trace.h"
#include "trace.h"
...
@@ -2425,6 +2427,8 @@ static int emulator_read_emulated(unsigned long addr,
...
@@ -2425,6 +2427,8 @@ static int emulator_read_emulated(unsigned long addr,
if
(
vcpu
->
mmio_read_completed
)
{
if
(
vcpu
->
mmio_read_completed
)
{
memcpy
(
val
,
vcpu
->
mmio_data
,
bytes
);
memcpy
(
val
,
vcpu
->
mmio_data
,
bytes
);
trace_kvm_mmio
(
KVM_TRACE_MMIO_READ
,
bytes
,
vcpu
->
mmio_phys_addr
,
*
(
u64
*
)
val
);
vcpu
->
mmio_read_completed
=
0
;
vcpu
->
mmio_read_completed
=
0
;
return
X86EMUL_CONTINUE
;
return
X86EMUL_CONTINUE
;
}
}
...
@@ -2445,8 +2449,12 @@ static int emulator_read_emulated(unsigned long addr,
...
@@ -2445,8 +2449,12 @@ static int emulator_read_emulated(unsigned long addr,
/*
/*
* Is this MMIO handled locally?
* Is this MMIO handled locally?
*/
*/
if
(
!
vcpu_mmio_read
(
vcpu
,
gpa
,
bytes
,
val
))
if
(
!
vcpu_mmio_read
(
vcpu
,
gpa
,
bytes
,
val
))
{
trace_kvm_mmio
(
KVM_TRACE_MMIO_READ
,
bytes
,
gpa
,
*
(
u64
*
)
val
);
return
X86EMUL_CONTINUE
;
return
X86EMUL_CONTINUE
;
}
trace_kvm_mmio
(
KVM_TRACE_MMIO_READ_UNSATISFIED
,
bytes
,
gpa
,
0
);
vcpu
->
mmio_needed
=
1
;
vcpu
->
mmio_needed
=
1
;
vcpu
->
mmio_phys_addr
=
gpa
;
vcpu
->
mmio_phys_addr
=
gpa
;
...
@@ -2490,6 +2498,7 @@ static int emulator_write_emulated_onepage(unsigned long addr,
...
@@ -2490,6 +2498,7 @@ static int emulator_write_emulated_onepage(unsigned long addr,
return
X86EMUL_CONTINUE
;
return
X86EMUL_CONTINUE
;
mmio:
mmio:
trace_kvm_mmio
(
KVM_TRACE_MMIO_WRITE
,
bytes
,
gpa
,
*
(
u64
*
)
val
);
/*
/*
* Is this MMIO handled locally?
* Is this MMIO handled locally?
*/
*/
...
...
include/trace/events/kvm.h
View file @
aec51dc4
...
@@ -56,6 +56,39 @@ TRACE_EVENT(kvm_ack_irq,
...
@@ -56,6 +56,39 @@ TRACE_EVENT(kvm_ack_irq,
#endif
/* defined(__KVM_HAVE_IOAPIC) */
#endif
/* defined(__KVM_HAVE_IOAPIC) */
#define KVM_TRACE_MMIO_READ_UNSATISFIED 0
#define KVM_TRACE_MMIO_READ 1
#define KVM_TRACE_MMIO_WRITE 2
#define kvm_trace_symbol_mmio \
{ KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \
{ KVM_TRACE_MMIO_READ, "read" }, \
{ KVM_TRACE_MMIO_WRITE, "write" }
TRACE_EVENT
(
kvm_mmio
,
TP_PROTO
(
int
type
,
int
len
,
u64
gpa
,
u64
val
),
TP_ARGS
(
type
,
len
,
gpa
,
val
),
TP_STRUCT__entry
(
__field
(
u32
,
type
)
__field
(
u32
,
len
)
__field
(
u64
,
gpa
)
__field
(
u64
,
val
)
),
TP_fast_assign
(
__entry
->
type
=
type
;
__entry
->
len
=
len
;
__entry
->
gpa
=
gpa
;
__entry
->
val
=
val
;
),
TP_printk
(
"mmio %s len %u gpa 0x%llx val 0x%llx"
,
__print_symbolic
(
__entry
->
type
,
kvm_trace_symbol_mmio
),
__entry
->
len
,
__entry
->
gpa
,
__entry
->
val
)
);
#endif
/* _TRACE_KVM_MAIN_H */
#endif
/* _TRACE_KVM_MAIN_H */
/* This part must be outside protection */
/* This part must be outside protection */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment