From: Roger Pau Monné Date: Thu, 3 Dec 2015 14:33:40 +0000 (+0100) Subject: x86: make sure the HVM callback vector is correctly set X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=aff9115de591304a2ae26061ad0ba77f6d674ac9;p=people%2Fjulieng%2Fxen-unstable.git x86: make sure the HVM callback vector is correctly set If certain devices (like the local or the io apic) are disabled some modes of operation of the HVM event channel callback cannot be used. Make sure Xen doesn't try to setup them. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index 990a2ca379..0f3ab6c60c 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -330,6 +330,10 @@ void hvm_set_callback_via(struct domain *d, uint64_t via) (via_type > HVMIRQ_callback_vector) ) via_type = HVMIRQ_callback_none; + if ( via_type != HVMIRQ_callback_vector && + (!has_vlapic(d) || !has_vioapic(d) || !has_vpic(d)) ) + return; + spin_lock(&d->arch.hvm_domain.irq_lock); /* Tear down old callback via. */