diff mbox

KVM: x86: Add instruction length to VCPU event state

Message ID 4B76762C.10107@web.de (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Feb. 13, 2010, 9:51 a.m. UTC
None
diff mbox

Patch

diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt
index c6416a3..aa11d70 100644
--- a/Documentation/kvm/api.txt
+++ b/Documentation/kvm/api.txt
@@ -686,6 +686,8 @@  struct kvm_vcpu_events {
 	} nmi;
 	__u32 sipi_vector;
 	__u32 flags;
+	__u32 instruction_length; /* used by VMX */
+	__u32 reserved[9];
 };
 
 4.30 KVM_SET_VCPU_EVENTS
diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h
index f46b79f..570b6cc 100644
--- a/arch/x86/include/asm/kvm.h
+++ b/arch/x86/include/asm/kvm.h
@@ -281,7 +281,8 @@  struct kvm_vcpu_events {
 	} nmi;
 	__u32 sipi_vector;
 	__u32 flags;
-	__u32 reserved[10];
+	__u32 instruction_length; /* used by VMX */
+	__u32 reserved[9];
 };
 
 #endif /* _ASM_X86_KVM_H */
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 86b739f..0cc6cfb 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2134,6 +2134,8 @@  static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
 	events->nmi.pending = vcpu->arch.nmi_pending;
 	events->nmi.masked = kvm_x86_ops->get_nmi_mask(vcpu);
 
+	events->instruction_length = vcpu->arch.event_exit_inst_len;
+
 	events->sipi_vector = vcpu->arch.sipi_vector;
 
 	events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING
@@ -2170,6 +2172,8 @@  static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
 	if (events->flags & KVM_VCPUEVENT_VALID_SIPI_VECTOR)
 		vcpu->arch.sipi_vector = events->sipi_vector;
 
+	vcpu->arch.event_exit_inst_len = events->instruction_length;
+
 	vcpu_put(vcpu);
 
 	return 0;