aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-10-22 10:50:39 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 11:01:20 -0500
commitb209749f528488c4c0d20a42c0fbcbf49e6933b3 (patch)
tree0e0a24225a5c6bca1c1986cc0daaf8753424cfe6 /include/linux/kvm.h
parent565f1fbd9d2f766dcfed5db90b89ef80afe8b49a (diff)
KVM: local APIC TPR access reporting facility
Add a facility to report on accesses to the local apic tpr even if the local apic is emulated in the kernel. This is basically a hack that allows userspace to patch Windows which tends to bang on the tpr a lot. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r--include/linux/kvm.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index de9f28d96ced..850f5ef76636 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -72,6 +72,7 @@ struct kvm_irqchip {
72#define KVM_EXIT_FAIL_ENTRY 9 72#define KVM_EXIT_FAIL_ENTRY 9
73#define KVM_EXIT_INTR 10 73#define KVM_EXIT_INTR 10
74#define KVM_EXIT_SET_TPR 11 74#define KVM_EXIT_SET_TPR 11
75#define KVM_EXIT_TPR_ACCESS 12
75 76
76/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 77/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
77struct kvm_run { 78struct kvm_run {
@@ -130,6 +131,12 @@ struct kvm_run {
130 __u32 longmode; 131 __u32 longmode;
131 __u32 pad; 132 __u32 pad;
132 } hypercall; 133 } hypercall;
134 /* KVM_EXIT_TPR_ACCESS */
135 struct {
136 __u64 rip;
137 __u32 is_write;
138 __u32 pad;
139 } tpr_access;
133 /* Fix the size of the union. */ 140 /* Fix the size of the union. */
134 char padding[256]; 141 char padding[256];
135 }; 142 };
@@ -202,6 +209,13 @@ struct kvm_signal_mask {
202 __u8 sigset[0]; 209 __u8 sigset[0];
203}; 210};
204 211
212/* for KVM_TPR_ACCESS_REPORTING */
213struct kvm_tpr_access_ctl {
214 __u32 enabled;
215 __u32 flags;
216 __u32 reserved[8];
217};
218
205#define KVMIO 0xAE 219#define KVMIO 0xAE
206 220
207/* 221/*
@@ -229,6 +243,7 @@ struct kvm_signal_mask {
229#define KVM_CAP_USER_MEMORY 3 243#define KVM_CAP_USER_MEMORY 3
230#define KVM_CAP_SET_TSS_ADDR 4 244#define KVM_CAP_SET_TSS_ADDR 4
231#define KVM_CAP_EXT_CPUID 5 245#define KVM_CAP_EXT_CPUID 5
246#define KVM_CAP_VAPIC 6
232 247
233/* 248/*
234 * ioctls for VM fds 249 * ioctls for VM fds
@@ -274,5 +289,7 @@ struct kvm_signal_mask {
274#define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state) 289#define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state)
275#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2) 290#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2)
276#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2) 291#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2)
292/* Available with KVM_CAP_VAPIC */
293#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl)
277 294
278#endif 295#endif