From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Zhang Subject: [PATCH v9 0/7] KVM: VMX: Add Posted Interrupt supporting Date: Wed, 10 Apr 2013 21:22:50 +0800 Message-ID: <1365600177-8506-1-git-send-email-yang.z.zhang@intel.com> Cc: gleb@redhat.com, mtosatti@redhat.com, xiantao.zhang@intel.com, jun.nakajima@intel.com, Yang Zhang To: kvm@vger.kernel.org Return-path: Received: from mga01.intel.com ([192.55.52.88]:42184 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755470Ab3DJN1Y (ORCPT ); Wed, 10 Apr 2013 09:27:24 -0400 Sender: kvm-owner@vger.kernel.org List-ID: From: Yang Zhang The follwoing patches are adding the Posted Interrupt supporting to KVM: The first patch enables the feature 'acknowledge interrupt on vmexit'.Since it is required by Posted interrupt, we need to enable it firstly. And the subsequent patches are adding the posted interrupt supporting: Posted Interrupt allows APIC interrupts to inject into guest directly without any vmexit. - When delivering a interrupt to guest, if target vcpu is running, update Posted-interrupt requests bitmap and send a notification event to the vcpu. Then the vcpu will handle this interrupt automatically, without any software involvemnt. - If target vcpu is not running or there already a notification event pending in the vcpu, do nothing. The interrupt will be handled by next vm entry Changes from v8 to v9: * Add tracing in PI case when deliver interrupt. * Scan ioapic when updating SPIV register. * Rebase on top of KVM upstream + RTC eoi tracking patch. Changes from v7 to v8: * Remove unused memeber 'on' from struct pi_desc. * Register a dummy function to sync_pir_to_irr is apicv is disabled. * Minor fixup. * Rebase on top of KVM upstream + RTC eoi tracking patch. Yang Zhang (7): KVM: VMX: Enable acknowledge interupt on vmexit KVM: VMX: Register a new IPI for posted interrupt KVM: VMX: Check the posted interrupt capability KVM: Call common update function when ioapic entry changed. KVM: Set TMR when programming ioapic entry KVM: VMX: Add the algorithm of deliver posted interrupt KVM: VMX: Use posted interrupt to deliver virtual interrupt arch/ia64/kvm/lapic.h | 6 - arch/x86/include/asm/entry_arch.h | 4 + arch/x86/include/asm/hardirq.h | 3 + arch/x86/include/asm/hw_irq.h | 1 + arch/x86/include/asm/irq_vectors.h | 5 + arch/x86/include/asm/kvm_host.h | 3 + arch/x86/include/asm/vmx.h | 4 + arch/x86/kernel/entry_64.S | 5 + arch/x86/kernel/irq.c | 22 ++++ arch/x86/kernel/irqinit.c | 4 + arch/x86/kvm/lapic.c | 66 ++++++++---- arch/x86/kvm/lapic.h | 7 ++ arch/x86/kvm/svm.c | 12 ++ arch/x86/kvm/vmx.c | 207 +++++++++++++++++++++++++++++++----- arch/x86/kvm/x86.c | 19 +++- include/linux/kvm_host.h | 4 +- virt/kvm/ioapic.c | 32 ++++-- virt/kvm/ioapic.h | 7 +- virt/kvm/irq_comm.c | 4 +- virt/kvm/kvm_main.c | 5 +- 20 files changed, 341 insertions(+), 79 deletions(-)