public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] lapic3: remove the union of user/kernel irq in struct vcpu
@ 2007-08-09 10:00 He, Qing
       [not found] ` <37E52D09333DE2469A03574C88DBF40FA9C1BB-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: He, Qing @ 2007-08-09 10:00 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel

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.

	How do you think?

Thanks,
Qing

-------------------------------------------------------------------------
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/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-10  2:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
     [not found]     ` <46BB2478.3050403-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-10  2:52       ` He, Qing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox