public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Yang Zhang <yang.z.zhang@intel.com>
To: kvm@vger.kernel.org
Cc: gleb@redhat.com, mtosatti@redhat.com, avi.kivity@gmail.com,
	xiantao.zhang@intel.com, Yang Zhang <yang.z.zhang@Intel.com>
Subject: [PATCH v4 0/2]  KVM: VMX: Add Posted Interrupt supporting
Date: Fri, 22 Feb 2013 21:42:30 +0800	[thread overview]
Message-ID: <1361540552-2016-1-git-send-email-yang.z.zhang@intel.com> (raw)

From: Yang Zhang <yang.z.zhang@Intel.com>

The two 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 second patch is adding the posted interrupt supporting.

Please see the comments in the two patch to get more details.

Changes from v3 to v4:
* Clear up the vmx_handle_external_interrupt() to make the code more cleanliness
  and clear.
* Use lock to protect the access of pir.
* Check pending interrupt in pir firstly in vmx_deliver_posted_interrupt().
  Since hardware will sync pir->irr, if check irr firstly, then the irr may
  be modified after the checking, and we also cannot see it in the following
  check of pir.
* Wrap the operation of sync pir to irr to a function kvm_apic_update_irr(),
  and call it from vmx_sync_pir_to_irr.
* Use irr |= pir directly instead using cmpxchg. Since hardware cannot perform
  pir->irr at this point, so it is safe to use 'or' to sync pir to irr.

Changes from v2 to v3:
* Add CONFIG_HAVE_KVM check when calling BUILD_INTERRUPT for posted interrupt.
* Rename send_notification_event() to deliver_posted_interrupt().
* Modify the algorithm of calculating interrupt coalescence: interrupt will be
  considered as delivered only when there is no previous interrupt pending in
  both irr and pir.
* Remove using new request to sync pir to irr, use KVM_REQ_EVENT for instead.
* Remove the optimization of checking outsanding notification bit after sending
  posted interrupt to remote cpu.
* Embed pi_desc inside struct vmx instead allocating it dynamically.
* Rebase on top of KVM upstream.



Yang Zhang (2):
  KVM: VMX: enable acknowledge interupt on vmexit
  KVM: VMX: Add Posted Interrupt supporting

 arch/x86/include/asm/entry_arch.h  |    4 +
 arch/x86/include/asm/hw_irq.h      |    1 +
 arch/x86/include/asm/irq_vectors.h |    5 +
 arch/x86/include/asm/kvm_host.h    |    4 +
 arch/x86/include/asm/vmx.h         |    4 +
 arch/x86/kernel/entry_64.S         |    5 +
 arch/x86/kernel/irq.c              |   20 ++++
 arch/x86/kernel/irqinit.c          |    4 +
 arch/x86/kvm/lapic.c               |   32 +++++-
 arch/x86/kvm/lapic.h               |    2 +
 arch/x86/kvm/svm.c                 |   19 +++
 arch/x86/kvm/vmx.c                 |  219 ++++++++++++++++++++++++++++++++----
 arch/x86/kvm/x86.c                 |    5 +-
 13 files changed, 296 insertions(+), 28 deletions(-)


             reply	other threads:[~2013-02-22 13:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 13:42 Yang Zhang [this message]
2013-02-22 13:42 ` [PATCH v4 1/2] KVM: VMX: enable acknowledge interupt on vmexit Yang Zhang
2013-02-22 13:42 ` [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting Yang Zhang
2013-02-23 13:43   ` Marcelo Tosatti
2013-02-23 14:05     ` Zhang, Yang Z
2013-02-23 14:35       ` Gleb Natapov
2013-02-23 14:48         ` Marcelo Tosatti
2013-02-23 15:31           ` Gleb Natapov
2013-02-23 17:05             ` Marcelo Tosatti
2013-02-23 19:42               ` Gleb Natapov
2013-02-23 19:52                 ` Marcelo Tosatti
2013-02-23 19:59                   ` Gleb Natapov
2013-02-24 13:55                 ` Zhang, Yang Z
2013-02-24 14:19                   ` Gleb Natapov
2013-02-24 14:26                     ` Zhang, Yang Z
2013-02-24 14:39                       ` Gleb Natapov
2013-02-24 18:08                     ` Marcelo Tosatti
2013-02-24 18:59                       ` Avi Kivity
2013-02-25  8:42                         ` Zhang, Yang Z
2013-02-25 11:01                           ` Gleb Natapov
2013-02-25 11:04                             ` Zhang, Yang Z
2013-02-25 11:07                               ` Gleb Natapov
2013-02-25 11:13                                 ` Zhang, Yang Z
2013-02-25 12:49                                   ` Marcelo Tosatti
2013-02-25 12:52                                     ` Zhang, Yang Z
2013-02-25 13:34                                   ` Gleb Natapov
2013-02-25 14:00                                     ` Marcelo Tosatti
2013-02-25 14:17                                       ` Marcelo Tosatti
2013-02-25 17:40                                         ` Gleb Natapov
2013-02-25 22:29                                           ` Marcelo Tosatti
2013-02-25 16:50                                     ` Avi Kivity
2013-02-25 17:43                                       ` Gleb Natapov
2013-02-25 18:56                                         ` Avi Kivity
2013-02-25 19:01                                           ` Gleb Natapov
2013-02-26  8:12                                             ` Gleb Natapov
2013-02-26 16:13                                               ` Avi Kivity
2013-02-24 17:44                   ` Marcelo Tosatti
2013-02-25  7:24                     ` Zhang, Yang Z
2013-02-23 14:44       ` Marcelo Tosatti
2013-02-23 15:16         ` Zhang, Yang Z
2013-02-23 16:50           ` Marcelo Tosatti
2013-02-24 13:17             ` Zhang, Yang Z
2013-02-24 17:39               ` Marcelo Tosatti
2013-02-25  6:55                 ` Zhang, Yang Z
2013-02-25 13:01                   ` Marcelo Tosatti
2013-02-25 14:32                     ` Zhang, Yang Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361540552-2016-1-git-send-email-yang.z.zhang@intel.com \
    --to=yang.z.zhang@intel.com \
    --cc=avi.kivity@gmail.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiantao.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox