Skip to content

Commit 2023a29

Browse files
matosattiavikivity
authored andcommitted
KVM: remove old KVMTRACE support code
Return EOPNOTSUPP for KVM_TRACE_ENABLE/PAUSE/DISABLE ioctls. Signed-off-by: Marcelo Tosatti <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent 46f43c6 commit 2023a29

File tree

10 files changed

+2
-380
lines changed

10 files changed

+2
-380
lines changed

arch/ia64/kvm/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ config KVM_INTEL
4747
Provides support for KVM on Itanium 2 processors equipped with the VT
4848
extensions.
4949

50-
config KVM_TRACE
51-
bool
52-
5350
source drivers/virtio/Kconfig
5451

5552
endif # VIRTUALIZATION

arch/powerpc/kvm/Kconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@ config KVM_E500
5858

5959
If unsure, say N.
6060

61-
config KVM_TRACE
62-
bool "KVM trace support"
63-
depends on KVM && MARKERS && SYSFS
64-
select RELAY
65-
select DEBUG_FS
66-
default n
67-
---help---
68-
This option allows reading a trace of kvm-related events through
69-
relayfs. Note the ABI is not considered stable and will be
70-
modified in future updates.
71-
7261
source drivers/virtio/Kconfig
7362

7463
endif # VIRTUALIZATION

arch/powerpc/kvm/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm
88

99
common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
1010

11-
common-objs-$(CONFIG_KVM_TRACE) += $(addprefix ../../../virt/kvm/, kvm_trace.o)
12-
1311
CFLAGS_44x_tlb.o := -I.
1412
CFLAGS_e500_tlb.o := -I.
1513
CFLAGS_emulate.o := -I.

arch/s390/kvm/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ config KVM
3434

3535
If unsure, say N.
3636

37-
config KVM_TRACE
38-
bool
39-
4037
# OK, it's a little counter-intuitive to do this, but it puts it neatly under
4138
# the virtualization menu.
4239
source drivers/virtio/Kconfig

arch/x86/kvm/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ config KVM_AMD
6262
To compile this as a module, choose M here: the module
6363
will be called kvm-amd.
6464

65-
config KVM_TRACE
66-
bool "KVM trace support"
67-
depends on KVM && SYSFS
68-
select MARKERS
69-
select RELAY
70-
select DEBUG_FS
71-
default n
72-
---help---
73-
This option allows reading a trace of kvm-related events through
74-
relayfs. Note the ABI is not considered stable and will be
75-
modified in future updates.
76-
7765
# OK, it's a little counter-intuitive to do this, but it puts it neatly under
7866
# the virtualization menu.
7967
source drivers/lguest/Kconfig

arch/x86/kvm/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ CFLAGS_vmx.o := -I.
77

88
kvm-y += $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \
99
coalesced_mmio.o irq_comm.o eventfd.o)
10-
kvm-$(CONFIG_KVM_TRACE) += $(addprefix ../../../virt/kvm/, kvm_trace.o)
1110
kvm-$(CONFIG_IOMMU_API) += $(addprefix ../../../virt/kvm/, iommu.o)
1211

1312
kvm-y += x86.o mmu.o x86_emulate.o i8259.o irq.o lapic.o \

include/linux/kvm.h

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#define KVM_API_VERSION 12
1616

17-
/* for KVM_TRACE_ENABLE */
17+
/* for KVM_TRACE_ENABLE, deprecated */
1818
struct kvm_user_trace_setup {
1919
__u32 buf_size; /* sub_buffer size of each per-cpu */
2020
__u32 buf_nr; /* the number of sub_buffers of each per-cpu */
@@ -325,35 +325,6 @@ struct kvm_guest_debug {
325325
#define KVM_TRC_CYCLE_SIZE 8
326326
#define KVM_TRC_EXTRA_MAX 7
327327

328-
/* This structure represents a single trace buffer record. */
329-
struct kvm_trace_rec {
330-
/* variable rec_val
331-
* is split into:
332-
* bits 0 - 27 -> event id
333-
* bits 28 -30 -> number of extra data args of size u32
334-
* bits 31 -> binary indicator for if tsc is in record
335-
*/
336-
__u32 rec_val;
337-
__u32 pid;
338-
__u32 vcpu_id;
339-
union {
340-
struct {
341-
__u64 timestamp;
342-
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
343-
} __attribute__((packed)) timestamp;
344-
struct {
345-
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
346-
} notimestamp;
347-
} u;
348-
};
349-
350-
#define TRACE_REC_EVENT_ID(val) \
351-
(0x0fffffff & (val))
352-
#define TRACE_REC_NUM_DATA_ARGS(val) \
353-
(0x70000000 & ((val) << 28))
354-
#define TRACE_REC_TCS(val) \
355-
(0x80000000 & ((val) << 31))
356-
357328
#define KVMIO 0xAE
358329

359330
/*

include/linux/kvm_host.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -482,37 +482,6 @@ struct kvm_stats_debugfs_item {
482482
extern struct kvm_stats_debugfs_item debugfs_entries[];
483483
extern struct dentry *kvm_debugfs_dir;
484484

485-
#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
486-
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
487-
vcpu, 5, d1, d2, d3, d4, d5)
488-
#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
489-
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
490-
vcpu, 4, d1, d2, d3, d4, 0)
491-
#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
492-
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
493-
vcpu, 3, d1, d2, d3, 0, 0)
494-
#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
495-
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
496-
vcpu, 2, d1, d2, 0, 0, 0)
497-
#define KVMTRACE_1D(evt, vcpu, d1, name) \
498-
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
499-
vcpu, 1, d1, 0, 0, 0, 0)
500-
#define KVMTRACE_0D(evt, vcpu, name) \
501-
trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
502-
vcpu, 0, 0, 0, 0, 0, 0)
503-
504-
#ifdef CONFIG_KVM_TRACE
505-
int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg);
506-
void kvm_trace_cleanup(void);
507-
#else
508-
static inline
509-
int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg)
510-
{
511-
return -EINVAL;
512-
}
513-
#define kvm_trace_cleanup() ((void)0)
514-
#endif
515-
516485
#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
517486
static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
518487
{

virt/kvm/kvm_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,7 @@ static long kvm_dev_ioctl(struct file *filp,
23982398
case KVM_TRACE_ENABLE:
23992399
case KVM_TRACE_PAUSE:
24002400
case KVM_TRACE_DISABLE:
2401-
r = kvm_trace_ioctl(ioctl, arg);
2401+
r = -EOPNOTSUPP;
24022402
break;
24032403
default:
24042404
return kvm_arch_dev_ioctl(filp, ioctl, arg);
@@ -2748,7 +2748,6 @@ EXPORT_SYMBOL_GPL(kvm_init);
27482748

27492749
void kvm_exit(void)
27502750
{
2751-
kvm_trace_cleanup();
27522751
tracepoint_synchronize_unregister();
27532752
misc_deregister(&kvm_dev);
27542753
kmem_cache_destroy(kvm_vcpu_cache);

0 commit comments

Comments
 (0)