x86: make debug output consistent in hvm_set_callback_via
authorMalcolm Crossley <malcolm.crossley@citrix.com>
Mon, 21 Dec 2015 12:40:48 +0000 (13:40 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 21 Dec 2015 12:40:48 +0000 (13:40 +0100)
The unconditional printks in the switch statement of the
hvm_set_callback_via function results in Xen log spam in non debug
versions of Xen. The printks are for debug output only so conditionally
compile the entire switch statement on debug versions of Xen only.

This is XSA-169.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/x86/hvm/irq.c

index 0f3ab6c60c49c92217c0fbfbe0e7f6bf0adbc653..5323d7ce625203d6e4f68f48abf3a929d98af7ba 100644 (file)
@@ -386,7 +386,8 @@ void hvm_set_callback_via(struct domain *d, uint64_t via)
 
     spin_unlock(&d->arch.hvm_domain.irq_lock);
 
-    dprintk(XENLOG_G_INFO, "Dom%u callback via changed to ", d->domain_id);
+#ifndef NDEBUG
+    printk(XENLOG_G_INFO "Dom%u callback via changed to ", d->domain_id);
     switch ( via_type )
     {
     case HVMIRQ_callback_gsi:
@@ -402,6 +403,7 @@ void hvm_set_callback_via(struct domain *d, uint64_t via)
         printk("None\n");
         break;
     }
+#endif
 }
 
 struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v)