From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC] lapic3: remove the union of user/kernel irq in struct vcpu Date: Thu, 09 Aug 2007 17:28:08 +0300 Message-ID: <46BB2478.3050403@qumranet.com> References: <37E52D09333DE2469A03574C88DBF40FA9C1BB@pdsmsx414.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: "He, Qing" Return-path: In-Reply-To: <37E52D09333DE2469A03574C88DBF40FA9C1BB-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org He, Qing wrote: > Avi, > We have found a new bug about irqchip_in_kernel checking, as > addressed by the following patch: > > diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c > index 88b0b89..69518f8 100644 > --- a/drivers/kvm/kvm_main.c > +++ b/drivers/kvm/kvm_main.c > @@ -283,7 +283,8 @@ EXPORT_SYMBOL_GPL(kvm_vcpu_init); > void kvm_vcpu_uninit(struct kvm_vcpu *vcpu) > { > kvm_mmu_destroy(vcpu); > - kvm_free_apic(vcpu->apic); > + if (irqchip_in_kernel(vcpu->kvm)) > + kvm_free_apic(vcpu->apic); > free_page((unsigned long)vcpu->pio_data); > free_page((unsigned long)vcpu->run); > } > > This is similar with what we try to fix several days ago. We > could certainly fix them as they appear, however, I'm beginning to > wonder, is the union of user/kernel irq really worthwhile? With this > union, we may save some space, but there is cost. We have to do run-time > checking which is time consuming, and there are potentially more bugs > which will eventually bite us someday. If we remove it, making > irq_summary and kernel apic not disturbing each other, the checking is > saved, and we don't have to worry about future bugs caused by > irq_summary, apic sharing any more. > > I'm not opposed to the removal of the union (the space savings are hardly significant). But will it really remove a source of bugs or just hide them deeper? You'll need the tests most of the time anyway. I'll apply a union-removing patch if you send one. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/