public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: "He, Qing" <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [RFC] lapic3: remove the union of user/kernel irq in struct vcpu
Date: Thu, 09 Aug 2007 17:28:08 +0300	[thread overview]
Message-ID: <46BB2478.3050403@qumranet.com> (raw)
In-Reply-To: <37E52D09333DE2469A03574C88DBF40FA9C1BB-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.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/

  parent reply	other threads:[~2007-08-09 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09 10:00 [RFC] lapic3: remove the union of user/kernel irq in struct vcpu He, Qing
     [not found] ` <37E52D09333DE2469A03574C88DBF40FA9C1BB-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-09 14:28   ` Avi Kivity [this message]
     [not found]     ` <46BB2478.3050403-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-10  2:52       ` He, Qing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46BB2478.3050403@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox