From: Jan Kiszka Subject: Re: [PATCH 12/45] KVM: x86: Support for user space injected NMIs Date: Mon, 08 Dec 2008 13:07:38 +0100 Message-ID: <493D0E0A.2000400@siemens.com> References: <1228736216-15787-1-git-send-email-avi@redhat.com> <1228736216-15787-13-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Avi Kivity Return-path: Received: from gecko.sbs.de ([194.138.37.40]:19622 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbYLHMII (ORCPT ); Mon, 8 Dec 2008 07:08:08 -0500 In-Reply-To: <1228736216-15787-13-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > From: Jan Kiszka > > Introduces the KVM_NMI IOCTL to the generic x86 part of KVM for > injecting NMIs from user space and also extends the statistic report > accordingly. > > Based on the original patch by Sheng Yang. > > Signed-off-by: Jan Kiszka > Signed-off-by: Sheng Yang > Signed-off-by: Avi Kivity > --- > arch/x86/include/asm/kvm_host.h | 2 + > arch/x86/kvm/x86.c | 46 +++++++++++++++++++++++++++++++++++++- > include/linux/kvm.h | 11 +++++++- > 3 files changed, 55 insertions(+), 4 deletions(-) > ... > diff --git a/include/linux/kvm.h b/include/linux/kvm.h > index f18b86f..44fd7fa 100644 > --- a/include/linux/kvm.h > +++ b/include/linux/kvm.h > @@ -83,18 +83,22 @@ struct kvm_irqchip { > #define KVM_EXIT_S390_SIEIC 13 > #define KVM_EXIT_S390_RESET 14 > #define KVM_EXIT_DCR 15 > +#define KVM_EXIT_NMI 16 > +#define KVM_EXIT_NMI_WINDOW_OPEN 17 > > /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ > struct kvm_run { > /* in */ > __u8 request_interrupt_window; > - __u8 padding1[7]; > + __u8 request_nmi_window; > + __u8 padding1[6]; > > /* out */ > __u32 exit_reason; > __u8 ready_for_interrupt_injection; > __u8 if_flag; > - __u8 padding2[2]; > + __u8 ready_for_nmi_injection; > + __u8 padding2; > > /* in (pre_kvm_run), out (post_kvm_run) */ > __u64 cr8; Avi, please consider [1] again. You've already merged the related user space cleanup, and I was just waiting for your comment on how to deal with the kernel part, ideally _before_ merging the superfluous ready_for/request NMI interface into mainline. Thanks, Jan [1] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/25016 -- Siemens AG, Corporate Technology, CT SE 26 Corporate Competence Center Embedded Linux