linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Hao Peng <flyingpenghao@gmail.com>
Cc: kvm@vger.kernel.org, Sean Christopherson <seanjc@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: use unified srcu interface function
Date: Tue, 27 Dec 2022 12:14:00 +0100	[thread overview]
Message-ID: <4500b24d-8ac0-c7a8-dd8d-bbb660752c71@redhat.com> (raw)
In-Reply-To: <CAPm50aKYh-qXt_MmQvbSH6Tye=yxrwAp_x_jcJHh=8ZoA=1P_A@mail.gmail.com>

On 12/25/22 13:48, Hao Peng wrote:
> From: Peng Hao <flyingpeng@tencent.com>
> 
> kvm->irq_routing is protected by kvm->irq_srcu.
> 
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>

Please use the same email to send your message from, for the author, and 
for the Signed-off-by.

Perhaps you can do

git config user.name "Peng Hao (Tencent)"
git config user.email flyingpenghao@gmail.com

?  This is a common set up for people that do not use the company email 
to write to mailing lists.

Paolo

> ---
>   virt/kvm/irqchip.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c
> index 1e567d1f6d3d..d3ccfe922880 100644
> --- a/virt/kvm/irqchip.c
> +++ b/virt/kvm/irqchip.c
> @@ -18,6 +18,10 @@
>   #include <linux/export.h>
>   #include <trace/events/kvm.h>
> 
> +#define kvm_get_irq_routing(kvm) \
> +       srcu_dereference_check((kvm)->irq_routing, &(kvm)->irq_srcu,    \
> +                               lockdep_is_held(&(kvm)->irq_lock))
> +
>   int kvm_irq_map_gsi(struct kvm *kvm,
>                      struct kvm_kernel_irq_routing_entry *entries, int gsi)
>   {
> @@ -25,8 +29,7 @@ int kvm_irq_map_gsi(struct kvm *kvm,
>          struct kvm_kernel_irq_routing_entry *e;
>          int n = 0;
> 
> -       irq_rt = srcu_dereference_check(kvm->irq_routing, &kvm->irq_srcu,
> -                                       lockdep_is_held(&kvm->irq_lock));
> +       irq_rt = kvm_get_irq_routing(kvm);
>          if (irq_rt && gsi < irq_rt->nr_rt_entries) {
>                  hlist_for_each_entry(e, &irq_rt->map[gsi], link) {
>                          entries[n] = *e;
> @@ -216,7 +219,7 @@ int kvm_set_irq_routing(struct kvm *kvm,
>          }
> 
>          mutex_lock(&kvm->irq_lock);
> -       old = rcu_dereference_protected(kvm->irq_routing, 1);
> +       old = kvm_get_irq_routing(kvm);
>          rcu_assign_pointer(kvm->irq_routing, new);
>          kvm_irq_routing_update(kvm);
>          kvm_arch_irq_routing_update(kvm);
> --
> 2.27.0


      reply	other threads:[~2022-12-27 11:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-25 12:48 [PATCH v2] KVM: use unified srcu interface function Hao Peng
2022-12-27 11:14 ` Paolo Bonzini [this message]

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=4500b24d-8ac0-c7a8-dd8d-bbb660752c71@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=flyingpenghao@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.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).