From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH v4 0/6] Nonatomic interrupt injection Date: Mon, 30 Aug 2010 14:36:56 +0300 Message-ID: <1283168222-2242-1-git-send-email-avi@redhat.com> To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755204Ab0H3LhE (ORCPT ); Mon, 30 Aug 2010 07:37:04 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7UBb4SJ012765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Aug 2010 07:37:04 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7UBb3Ga010639 for ; Mon, 30 Aug 2010 07:37:04 -0400 Sender: kvm-owner@vger.kernel.org List-ID: This patchset changes interrupt injection to be done from normal process context instead of interrupts disabled context. This is useful for real mode interrupt injection on Intel without the current hacks (injecting as a software interrupt of a vm86 task), reducing latencies, and later, for allowing nested virtualization code to use kvm_read_guest()/kvm_write_guest() instead of kmap() to access the guest vmcb/vmcs. Seems to survive a hack that cancels every 16th entry, after injection has already taken place. With the PIC reset fix posted earlier, this passes autotest on both AMD and Intel, with in-kernel irqchip. I'll run -no-kvm-irqchip tests shortly. Please review carefully, esp. the first patch. Any missing kvm_make_request() there may result in a hung guest. v4: add KVM_REQ_EVENT after lapic restore v3: close new race between injection and entry fix Intel real-mode injection cancellation v2: svm support (easier than expected) fix silly vmx warning Avi Kivity (6): KVM: Check for pending events before attempting injection KVM: VMX: Split up vmx_complete_interrupts() KVM: VMX: Move real-mode interrupt injection fixup to vmx_complete_interrupts() KVM: VMX: Parameterize vmx_complete_interrupts() for both exit and entry KVM: Non-atomic interrupt injection KVM: VMX: Move fixup_rmode_irq() to avoid forward declaration arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/i8259.c | 1 + arch/x86/kvm/lapic.c | 13 ++++- arch/x86/kvm/svm.c | 20 ++++++- arch/x86/kvm/vmx.c | 116 ++++++++++++++++++++++++++------------ arch/x86/kvm/x86.c | 44 ++++++++++---- include/linux/kvm_host.h | 1 + 7 files changed, 143 insertions(+), 53 deletions(-)