kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: srutherford@google.com, kvm@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH] KVM: x86: don't hold kvm->lock in KVM_SET_GSI_ROUTING
Date: Wed, 26 Apr 2017 22:47:08 +0200	[thread overview]
Message-ID: <20170426204707.GA7177@potion> (raw)
In-Reply-To: <8c4b1717-cf45-bfa3-e3a7-e6968465d4be@redhat.com>

2017-04-26 17:21+0200, David Hildenbrand:
> On 26.04.2017 16:27, Radim Krčmář wrote:
> > 2017-04-26 10:40+0200, David Hildenbrand:
> >> On 25.04.2017 21:59, Radim Krčmář wrote:
> >>> 2017-04-25 21:03+0200, David Hildenbrand:
> >>>> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> >>>> @@ -504,6 +504,7 @@ void vcpu_put(struct kvm_vcpu *vcpu);
> >>>>  #ifdef __KVM_HAVE_IOAPIC
> >>>>  void kvm_arch_post_irq_ack_notifier_list_update(struct kvm *kvm);
> >>>>  void kvm_arch_post_irq_routing_update(struct kvm *kvm);
> >>>> +bool kvm_arch_can_set_irq_routing(struct kvm *kvm);
> >>>
> >>> (A nitpick: it might be useful even without __KVM_HAVE_IOAPIC so weak
> >>>  linking would probably be cleaner for a slow path.)
> >>>
> >>>>  #else
> >>>>  static inline void kvm_arch_post_irq_ack_notifier_list_update(struct kvm *kvm)
> >>>>  {
> >>>> @@ -511,6 +512,10 @@ static inline void kvm_arch_post_irq_ack_notifier_list_update(struct kvm *kvm)
> >>>>  static inline void kvm_arch_post_irq_routing_update(struct kvm *kvm)
> >>>>  {
> >>>>  }
> >>>> +static bool kvm_arch_can_set_irq_routing(struct kvm *kvm)
> >>>> +{
> >>>> +	return true;
> >>>> +}
> >>>>  #endif
> >>>>  
> >>
> >> Makes sense, shall I resend or can you fix that up when applying?
> > 
> > Please send a v2, it's going to be automatically compile-tested on all
> > arches that way. :)
> > 
> 
> Using a weak symbol for the first time... Is the following what you had in mind?
> 
> ---- snip ----
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 397b7b5..b725d4e 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -1009,6 +1009,7 @@ static inline int mmu_notifier_retry(struct kvm *kvm, unsigned long mmu_seq)
>  #define KVM_MAX_IRQ_ROUTES 1024
>  #endif
>  
> +bool kvm_arch_can_set_irq_routing(struct kvm *kvm);
>  int kvm_set_irq_routing(struct kvm *kvm,
>                         const struct kvm_irq_routing_entry *entries,
>                         unsigned nr,
> diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c
> index cc30d01..a080659 100644
> --- a/virt/kvm/irqchip.c
> +++ b/virt/kvm/irqchip.c
> @@ -172,6 +172,11 @@ void __attribute__((weak)) kvm_arch_irq_routing_update(struct kvm *kvm)
>  {
>  }
>  
> +bool __attribute__((weak)) kvm_arch_can_set_irq_routing(struct kvm *kvm)

Yes, exactly what I had in mind.
(I'd just write "__weak" to make it shorter. :])

> +{
> +       return true;
> +}
> +
>  int kvm_set_irq_routing(struct kvm *kvm,
>                         const struct kvm_irq_routing_entry *ue,
>                         unsigned nr,
> ---- snip ----
> 
> -- 
> 
> Thanks,
> 
> David

  reply	other threads:[~2017-04-26 20:47 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07  8:50 [PATCH v3 00/24] pic/ioapic/irqchip cleanups + minor fixes David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 01/24] KVM: x86: race between KVM_SET_GSI_ROUTING and KVM_CREATE_IRQCHIP David Hildenbrand
2017-04-24 22:39   ` Steve Rutherford
2017-04-25 12:34     ` David Hildenbrand
2017-04-25 14:58       ` Radim Krčmář
2017-04-25 19:03     ` [PATCH] KVM: x86: don't hold kvm->lock in KVM_SET_GSI_ROUTING David Hildenbrand
2017-04-25 19:38       ` Steve Rutherford
2017-04-25 19:59       ` Radim Krčmář
2017-04-26  8:40         ` David Hildenbrand
2017-04-26 14:27           ` Radim Krčmář
2017-04-26 15:21             ` David Hildenbrand
2017-04-26 20:47               ` Radim Krčmář [this message]
2017-04-26 12:33       ` kbuild test robot
2017-04-26 14:24         ` Radim Krčmář
2017-04-07  8:50 ` [PATCH v3 02/24] KVM: x86: new irqchip mode KVM_IRQCHIP_INIT_IN_PROGRESS David Hildenbrand
2017-04-12 18:26   ` Radim Krčmář
2017-04-12 19:55     ` David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 03/24] KVM: x86: check against irqchip_mode in kvm_set_routing_entry() David Hildenbrand
2017-04-12 18:36   ` Radim Krčmář
2017-04-12 19:56     ` David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 04/24] KVM: x86: check against irqchip_mode in pic_in_kernel() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 05/24] KVM: x86: check against irqchip_mode in ioapic_in_kernel() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 06/24] KVM: x86: get rid of pic_irqchip() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 07/24] KVM: x86: get rid of ioapic_irqchip() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 08/24] KVM: x86: use ioapic_in_kernel() to check for ioapic existence David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 09/24] KVM: x86: remove duplicate checks for ioapic David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 10/24] KVM: x86: convert kvm_(set|get)_ioapic() into void David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 11/24] KVM: x86: don't take kvm->irq_lock when creating IRQCHIP David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 12/24] KVM: x86: push usage of slots_lock down David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 13/24] KVM: x86: KVM_IRQCHIP_PIC_MASTER only has 8 pins David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 14/24] KVM: x86: remove all-vcpu request from kvm_ioapic_init() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 15/24] KVM: x86: directly call kvm_make_scan_ioapic_request() in ioapic.c David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 16/24] KVM: x86: rename kvm_vcpu_request_scan_ioapic() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 17/24] KVM: x86: drop goto label in kvm_set_routing_entry() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 18/24] KVM: x86: cleanup return handling in setup_routing_entry() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 19/24] KVM: x86: simplify pic_unlock() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 20/24] KVM: x86: make kvm_pic_reset() static David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 21/24] KVM: x86: drop picdev_in_range() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 22/24] KVM: x86: set data directly in picdev_read() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 23/24] KVM: x86: simplify pic_ioport_read() David Hildenbrand
2017-04-07  8:50 ` [PATCH v3 24/24] KVM: x86: use irqchip_kernel() to check for pic+ioapic David Hildenbrand
2017-04-12 18:58 ` [PATCH v3 00/24] pic/ioapic/irqchip cleanups + minor fixes Radim Krčmář
2017-04-12 19:59   ` David Hildenbrand

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=20170426204707.GA7177@potion \
    --to=rkrcmar@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=srutherford@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).