From patchwork Thu Dec 9 06:58:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lai Jiangshan X-Patchwork-Id: 393032 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB96twPX016910 for ; Thu, 9 Dec 2010 06:55:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754879Ab0LIGz4 (ORCPT ); Thu, 9 Dec 2010 01:55:56 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:51973 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754849Ab0LIGzz (ORCPT ); Thu, 9 Dec 2010 01:55:55 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 711C2170CAD; Thu, 9 Dec 2010 14:55:50 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oB96p5Hb006025; Thu, 9 Dec 2010 14:51:06 +0800 Received: from [10.167.225.68] ([10.167.225.68]) by mailserver.fnst.cn.fujitus.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2010120914555407-195512 ; Thu, 9 Dec 2010 14:55:54 +0800 Message-ID: <4D007E2C.4070308@cn.fujitsu.com> Date: Thu, 09 Dec 2010 14:58:52 +0800 From: Lai Jiangshan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jan Kiszka , Avi Kivity , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH 1/6] qemu,kvm: Enable NMI support for user space irqchip X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-09 14:55:54, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-09 14:55:55, Serialize complete at 2010-12-09 14:55:55 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 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Dec 2010 06:55:59 +0000 (UTC) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 7dfc357..c4ebe28 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1417,6 +1417,14 @@ int kvm_arch_get_registers(CPUState *env) int kvm_arch_pre_run(CPUState *env, struct kvm_run *run) { +#ifdef KVM_CAP_USER_NMI + if (env->interrupt_request & CPU_INTERRUPT_NMI) { + env->interrupt_request &= ~CPU_INTERRUPT_NMI; + DPRINTF("injected NMI\n"); + kvm_vcpu_ioctl(env, KVM_NMI); + } +#endif + /* Try to inject an interrupt if the guest can accept it */ if (run->ready_for_interrupt_injection && (env->interrupt_request & CPU_INTERRUPT_HARD) &&