# HG changeset patch
# User Steven Smith <ssmith@xxxxxxxxxxxxx>
# Node ID ef8df1e5884ff55b68c24fae44deaa8507a00425
# Parent 509ff527c59d2ea8aca36f901d0f3fe67f4d52c8
[XEN][HVM] Arrange that we only consider sending a PV-on-HVM event channel
callback interrupt in vcpu 0. This avoids a race in SMP HVM domains
which could lead to interrupts never getting delivered. It is safe
because HVM domains always bind their event channels to vcpu 0.
Bug pointed out by Keir.
Signed-off-by: Steven Smith <sos22@xxxxxxxxx>
---
xen/arch/x86/hvm/svm/intr.c | 9 ++++++---
xen/arch/x86/hvm/vmx/io.c | 11 +++++++----
2 files changed, 13 insertions(+), 7 deletions(-)
diff -r 509ff527c59d -r ef8df1e5884f xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c Fri Sep 29 14:42:49 2006 +0100
+++ b/xen/arch/x86/hvm/svm/intr.c Fri Sep 29 15:40:19 2006 +0100
@@ -121,9 +121,12 @@ asmlinkage void svm_intr_assist(void)
pic_set_irq(pic, pt->irq, 1);
}
- callback_irq = v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
- if ( callback_irq != 0)
- pic_set_xen_irq(pic, callback_irq, local_events_need_delivery());
+ if (v->vcpu_id == 0) {
+ callback_irq =
+ v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
+ if ( callback_irq != 0)
+ pic_set_xen_irq(pic, callback_irq, local_events_need_delivery());
+ }
if ( cpu_has_pending_irq(v) )
intr_vector = cpu_get_interrupt(v, &intr_type);
diff -r 509ff527c59d -r ef8df1e5884f xen/arch/x86/hvm/vmx/io.c
--- a/xen/arch/x86/hvm/vmx/io.c Fri Sep 29 14:42:49 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/io.c Fri Sep 29 15:40:19 2006 +0100
@@ -78,7 +78,6 @@ asmlinkage void vmx_intr_assist(void)
struct hvm_domain *plat=&v->domain->arch.hvm_domain;
struct periodic_time *pt = &plat->pl_time.periodic_tm;
struct hvm_virpic *pic= &plat->vpic;
- int callback_irq;
unsigned int idtv_info_field;
unsigned long inst_len;
int has_ext_irq;
@@ -91,9 +90,13 @@ asmlinkage void vmx_intr_assist(void)
pic_set_irq(pic, pt->irq, 1);
}
- callback_irq = v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
- if ( callback_irq != 0 )
- pic_set_xen_irq(pic, callback_irq, local_events_need_delivery());
+ if (v->vcpu_id == 0) {
+ int callback_irq;
+ callback_irq =
+ v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
+ if ( callback_irq != 0 )
+ pic_set_xen_irq(pic, callback_irq, local_events_need_delivery());
+ }
has_ext_irq = cpu_has_pending_irq(v);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|