From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751373AbbG3Egu (ORCPT ); Thu, 30 Jul 2015 00:36:50 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:35204 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbbG3Egs (ORCPT ); Thu, 30 Jul 2015 00:36:48 -0400 Date: Wed, 29 Jul 2015 21:36:45 -0700 From: Steve Rutherford To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mtosatti@redhat.com, rkrcmar@redhat.com Subject: Re: [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check Message-ID: <20150730043645.GF15229@google.com> References: <1438176538-26191-1-git-send-email-pbonzini@redhat.com> <1438176538-26191-4-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438176538-26191-4-git-send-email-pbonzini@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 29, 2015 at 03:28:57PM +0200, Paolo Bonzini wrote: > The PIT is only created if irqchip_in_kernel returns true, so the > check is superfluous. I poked around. Looks to me like the existence of an IOAPIC is not checked on the creation of the in-kernel PIT. Userspace might limit itself to that scenario (PIT implies IOAPIC in-kernel), but that isn't enforced at PIT creation. It's worth adding that check in. > > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/i8254.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c > index f90952f64e79..f588eb7bdf45 100644 > --- a/arch/x86/kvm/i8254.c > +++ b/arch/x86/kvm/i8254.c > @@ -333,7 +333,7 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period) > struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state; > s64 interval; > > - if (!irqchip_in_kernel(kvm) || ps->flags & KVM_PIT_FLAGS_HPET_LEGACY) > + if (ps->flags & KVM_PIT_FLAGS_HPET_LEGACY) > return; > > interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ); > -- > 1.8.3.1 > >