From: Jason Wang <jasowang@redhat.com>
To: Zhenzhong Duan <zhenzhong.duan@gmail.com>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, kvm@vger.kernel.org
Cc: netdev@vger.kernel.org, pbonzini@redhat.com,
sean.j.christopherson@intel.com, vkuznets@redhat.com,
wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
mst@redhat.com
Subject: Re: [PATCH 2/2] KVM: not link irqfd with a fake IRQ bypass producer
Date: Tue, 20 Oct 2020 14:32:12 +0800 [thread overview]
Message-ID: <7eec99d5-e36b-ee5b-5b6c-1486e453a083@redhat.com> (raw)
In-Reply-To: <20201019090657.131-2-zhenzhong.duan@gmail.com>
On 2020/10/19 下午5:06, Zhenzhong Duan wrote:
> In case failure to setup Post interrupt for an IRQ, it make no sense
> to assign irqfd->producer to the producer.
>
> This change makes code more robust.
It's better to describe what issue we will get without this patch.
Thanks
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
> ---
> arch/x86/kvm/x86.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index ce856e0..277e961 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -10683,13 +10683,14 @@ int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons,
> container_of(cons, struct kvm_kernel_irqfd, consumer);
> int ret;
>
> - irqfd->producer = prod;
> kvm_arch_start_assignment(irqfd->kvm);
> ret = kvm_x86_ops.update_pi_irte(irqfd->kvm,
> prod->irq, irqfd->gsi, 1);
>
> if (ret)
> kvm_arch_end_assignment(irqfd->kvm);
> + else
> + irqfd->producer = prod;
>
> return ret;
> }
next prev parent reply other threads:[~2020-10-20 6:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 9:06 [PATCH 1/2] KVM: not register a IRQ bypass producer if unsupported or disabled Zhenzhong Duan
2020-10-19 9:06 ` [PATCH 2/2] KVM: not link irqfd with a fake IRQ bypass producer Zhenzhong Duan
2020-10-20 6:32 ` Jason Wang [this message]
2020-10-20 10:12 ` Zhenzhong Duan
2020-10-20 6:23 ` [PATCH 1/2] KVM: not register a IRQ bypass producer if unsupported or disabled Jason Wang
2020-10-20 10:05 ` Zhenzhong Duan
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=7eec99d5-e36b-ee5b-5b6c-1486e453a083@redhat.com \
--to=jasowang@redhat.com \
--cc=bp@alien8.de \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=zhenzhong.duan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).