From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Rutherford Subject: Re: [RFC PATCH 3/4] KVM: x86: Add EOI exit bitmap inference Date: Wed, 13 May 2015 15:24:06 -0700 Message-ID: <20150513222406.GA24121@google.com> References: <1431481652-27268-1-git-send-email-srutherford@google.com> <1431481652-27268-3-git-send-email-srutherford@google.com> <5553028F.1010204@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, ahonig@google.com To: Paolo Bonzini Return-path: Received: from mail-ig0-f172.google.com ([209.85.213.172]:35311 "EHLO mail-ig0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932417AbbEMWYQ (ORCPT ); Wed, 13 May 2015 18:24:16 -0400 Received: by igbyr2 with SMTP id yr2so152134699igb.0 for ; Wed, 13 May 2015 15:24:16 -0700 (PDT) Content-Disposition: inline In-Reply-To: <5553028F.1010204@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, May 13, 2015 at 09:51:43AM +0200, Paolo Bonzini wrote: > > > On 13/05/2015 03:47, Steve Rutherford wrote: > > @@ -205,6 +205,8 @@ int kvm_set_irq_routing(struct kvm *kvm, > > > > synchronize_srcu_expedited(&kvm->irq_srcu); > > > > + kvm_vcpu_request_scan_userspace_ioapic(kvm); > > + > > new = old; > > r = 0; > > > > This can be done before synchronize_srcu_expedited, so that changes > ripple to the VCPUs faster. > > > +void kvm_vcpu_request_scan_userspace_ioapic(struct kvm *kvm) > > +{ > > + struct kvm_ioapic *ioapic = kvm->arch.vioapic; > > + > > + if (ioapic) > > + return; > > + if (!lapic_in_kernel(kvm)) > > + return; > > + kvm_make_scan_ioapic_request(kvm); > > +} > > This is okay for use in kvm_set_irq_routing (perhaps renamed to > kvm_arch_irq_routing_update), but when it is used here: > > > if (!irqchip_split(kvm)) > > kvm_vcpu_request_scan_ioapic(kvm); > > + else > > + kvm_vcpu_request_scan_userspace_ioapic(kvm); > > ... you can simply do this: > > - if (!irqchip_split(kvm)) > - kvm_vcpu_request_scan_ioapic(kvm); > + kvm_make_scan_ioapic_request(kvm); > > Paolo Seems reasonable. While we're on the topic of scanning the IOAPIC, should this also scan the IOAPIC when (un)registering irq ack notifiers? [Which is currently done for the in-kernel IOAPIC.]