From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Rutherford Subject: Re: [PATCH v5 1/4] KVM: x86: Split the APIC from the rest of IRQCHIP. Date: Wed, 29 Jul 2015 20:04:53 -0700 Message-ID: <20150730030453.GA15229@google.com> References: <1438039062-3168-1-git-send-email-srutherford@google.com> <55B8CD8A.4030507@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mail-pa0-f41.google.com ([209.85.220.41]:34283 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752081AbbG3DFI (ORCPT ); Wed, 29 Jul 2015 23:05:08 -0400 Received: by pacan13 with SMTP id an13so15835173pac.1 for ; Wed, 29 Jul 2015 20:05:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: <55B8CD8A.4030507@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jul 29, 2015 at 02:56:42PM +0200, Paolo Bonzini wrote: > > > + kvm_rtc_eoi_tracking_restore_one(vcpu); > > } > > > > void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu) > > @@ -1921,7 +1923,8 @@ static void apic_sync_pv_eoi_to_guest(struct kvm_vcpu *vcpu, > > /* Cache not set: could be safe but we don't bother. */ > > apic->highest_isr_cache == -1 || > > /* Need EOI to update ioapic. */ > > - kvm_ioapic_handles_vector(vcpu->kvm, apic->highest_isr_cache)) { > > + kvm_ioapic_handles_vector(vcpu->kvm, apic->highest_isr_cache) || > > + irqchip_split(vcpu->kvm)) { > > This is ugly (and if anything irqchip_split should be done before > kvm_ioapic_handles_vector). Could this just test the EOI exit bitmap > instead? > That could be done. The EOI exit bitmap write paths for split and !split would need to be consolidated. (We can't pull them from the VMCS, so we'd need to fetch them from the one stored in kvm_vcpu). > Also, who sets TMR in the split irqchip case? I'll post a patch roday > or tomorrow to compute TMR in __apic_accept_irq and to do the > aforementioned EOI exit bitmap test. Another option would be to compute the TMR in vcpu_scan_ioapic, by extracting it from the EOI exit bitmaps (which would be most similar to how it had been done previously), but I prefer computing it in __apic_accept_irq.