From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/3] Make kvm_cpu_(has|get)_interrupt() work for userspace irqchip too. Date: Sat, 11 Apr 2009 14:24:43 +0300 Message-ID: <49E07DFB.8010108@redhat.com> References: <20090407090811.2074.19043.stgit@trex.usersys.redhat.com> <200904071756.13864.sheng@linux.intel.com> <20090407100708.GA25543@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Sheng Yang , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:35792 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754257AbZDKLYz (ORCPT ); Sat, 11 Apr 2009 07:24:55 -0400 In-Reply-To: <20090407100708.GA25543@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Gleb Natapov wrote: >>> * check if there are pending timer events >>> @@ -48,14 +49,17 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *v) >>> { >>> struct kvm_pic *s; >>> >>> - if (kvm_apic_has_interrupt(v) == -1) { /* LAPIC */ >>> - if (kvm_apic_accept_pic_intr(v)) { >>> - s = pic_irqchip(v->kvm); /* PIC */ >>> - return s->output; >>> - } else >>> - return 0; >>> + if (irqchip_in_kernel(v->kvm)) { >>> + if (kvm_apic_has_interrupt(v) == -1) { /* LAPIC */ >>> + if (kvm_apic_accept_pic_intr(v)) { >>> + s = pic_irqchip(v->kvm); /* PIC */ >>> + return s->output; >>> + } else >>> + return 0; >>> + } >>> + return 1; >>> } >>> - return 1; >>> + return v->arch.irq_summary; >>> } >>> >> Use if (!irqchip_in_kernel(v->kvm)) for userspace seems more simple(rather >> than a series of indention...). >> >> > As long as lines are smaller then 80 chars I don't care much :) If new > version of the patch will be needed I'll change this. > Please change it, the less indentation levels the better. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.