From patchwork Sat Feb 13 09:51:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 79174 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1D9prWa023904 for ; Sat, 13 Feb 2010 09:51:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751438Ab0BMJvr (ORCPT ); Sat, 13 Feb 2010 04:51:47 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:56565 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067Ab0BMJvq (ORCPT ); Sat, 13 Feb 2010 04:51:46 -0500 Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate03.web.de (Postfix) with ESMTP id 57DF513DF3DEA; Sat, 13 Feb 2010 10:51:45 +0100 (CET) Received: from [88.65.42.158] (helo=[192.168.1.10]) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1NgEfB-0003kY-00; Sat, 13 Feb 2010 10:51:45 +0100 Message-ID: <4B76762C.10107@web.de> Date: Sat, 13 Feb 2010 10:51:40 +0100 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Avi Kivity , Marcelo Tosatti CC: kvm Subject: [PATCH] KVM: x86: Add instruction length to VCPU event state X-Enigmail-Version: 0.95.7 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1/thTgxE5xip564EUGY92dHk75cX6OrmXT5ixWL k9+nvShq1BhPGiHqWdgms8svzH+GMYwi+0QASzcRstT1G2AHSg LQQF89psA= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 13 Feb 2010 09:51:55 +0000 (UTC) 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;