All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Yang Zhang <yang.zhang.wz@gmail.com>,
	rkrcmar@redhat.com, Feng Wu <feng.wu@intel.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: VMX: check apicv is active before using VT-d posted interrupt
Date: Mon, 23 May 2016 16:23:27 +0200	[thread overview]
Message-ID: <f1df63da-16ff-d35c-1c17-dca6ed1f58dc@redhat.com> (raw)
In-Reply-To: <7fec7586-a7c6-59dd-7653-2f88de75fbe4@gmail.com>

On 20/05/2016 09:50, Yang Zhang wrote:
> VT-d posted interrupt is relying on the CPU side's posted interrupt.
> Need to check whether VCPU's APICv is active before enabing VT-d posted
> interrupt.
> 
> Signed-off-by: Yang Zhang <yang.zhang.wz@gmail.com>
> Signed-off-by: Shengge Ding <shengge.dsg@alibaba-inc.com>

Please resend this patch without format=flowed (just use
git-send-email), as it cannot be applied otherwise.

Thanks,

Paolo

> ---
>  arch/x86/kvm/vmx.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 7ebf27b..8ba87f3 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -2072,7 +2072,8 @@ static void vmx_vcpu_pi_load(struct kvm_vcpu
> *vcpu, int cpu)
>      unsigned int dest;
> 
>      if (!kvm_arch_has_assigned_device(vcpu->kvm) ||
> -        !irq_remapping_cap(IRQ_POSTING_CAP))
> +        !irq_remapping_cap(IRQ_POSTING_CAP)  ||
> +        !kvm_vcpu_apicv_active(vcpu))
>          return;
> 
>      do {
> @@ -2180,7 +2181,8 @@ static void vmx_vcpu_pi_put(struct kvm_vcpu *vcpu)
>      struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu);
> 
>      if (!kvm_arch_has_assigned_device(vcpu->kvm) ||
> -        !irq_remapping_cap(IRQ_POSTING_CAP))
> +        !irq_remapping_cap(IRQ_POSTING_CAP)  ||
> +        !kvm_vcpu_apicv_active(vcpu))
>          return;
> 
>      /* Set SN when the vCPU is preempted */
> @@ -10698,7 +10700,8 @@ static int vmx_pre_block(struct kvm_vcpu *vcpu)
>      struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu);
> 
>      if (!kvm_arch_has_assigned_device(vcpu->kvm) ||
> -        !irq_remapping_cap(IRQ_POSTING_CAP))
> +        !irq_remapping_cap(IRQ_POSTING_CAP)  ||
> +        !kvm_vcpu_apicv_active(vcpu))
>          return 0;
> 
>      vcpu->pre_pcpu = vcpu->cpu;
> @@ -10764,7 +10767,8 @@ static void vmx_post_block(struct kvm_vcpu *vcpu)
>      unsigned long flags;
> 
>      if (!kvm_arch_has_assigned_device(vcpu->kvm) ||
> -        !irq_remapping_cap(IRQ_POSTING_CAP))
> +        !irq_remapping_cap(IRQ_POSTING_CAP)  ||
> +        !kvm_vcpu_apicv_active(vcpu))
>          return;
> 
>      do {
> @@ -10817,7 +10821,8 @@ static int vmx_update_pi_irte(struct kvm *kvm,
> unsigned int host_irq,
>      int idx, ret = -EINVAL;
> 
>      if (!kvm_arch_has_assigned_device(kvm) ||
> -        !irq_remapping_cap(IRQ_POSTING_CAP))
> +        !irq_remapping_cap(IRQ_POSTING_CAP) ||
> +        !kvm_vcpu_apicv_active(kvm->vcpus[0]))
>          return 0;
> 
>      idx = srcu_read_lock(&kvm->irq_srcu);

  parent reply	other threads:[~2016-05-23 14:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20  7:50 [PATCH] KVM: VMX: check apicv is active before using VT-d posted interrupt Yang Zhang
2016-05-20  8:22 ` Wu, Feng
2016-05-23  1:10   ` Yang Zhang
2016-05-23 14:23 ` Paolo Bonzini [this message]
2016-05-24  1:26   ` Yang Zhang

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=f1df63da-16ff-d35c-1c17-dca6ed1f58dc@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=feng.wu@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=yang.zhang.wz@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.