Skip to contentSkip to conversation

x86/HVM: limit upcall vector related verbosity

PATCH In review Jan Beulich 2 participants 2 messages Dec 18, 2023 – Feb 26, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/HVM: limit upcall vector related verbosity

Avoid logging all-identical messages for every vCPU, but make sure to log unusual events like the vector differing from vCPU 0's (note that the respective condition also makes sure vCPU 0 itself will have the vector setting logged), or it changing after it was once set. (Arguably a downside is that some vCPU not having its vector set would no longer be recognizable from the logs. But I think that's tolerable as sufficiently unlikely outside of people actively fiddling with related code.)

---
v2: Add comment.

xen/arch/x86/hvm/hvm.c +9 -1
@@ -4129,7 +4129,15 @@ static int hvmop_set_evtchn_upcall_vecto
     if ( (v = domain_vcpu(d, op.vcpu)) == NULL )
         return -ENOENT;
 
-    printk(XENLOG_G_INFO "%pv: upcall vector %02x\n", v, op.vector);
+    /*
+     * Avoid logging all-identical messages for every vCPU, but make sure to
+     * log unusual events like the vector differing from vCPU 0's, or it
+     * changing after it was once set
+     */
+    if ( op.vector != d->vcpu[0]->arch.hvm.evtchn_upcall_vector ||
+         (v->arch.hvm.evtchn_upcall_vector &&
+          op.vector != v->arch.hvm.evtchn_upcall_vector) )
+        printk(XENLOG_G_INFO "%pv: upcall vector %02x\n", v, op.vector);
 
     v->arch.hvm.evtchn_upcall_vector = op.vector;
     hvm_assert_evtchn_irq(v);
Acked-by on v2 1/1
#1 lore raw
Quoted 10 lines · Jan Beulich

Avoid logging all-identical messages for every vCPU, but make sure to log unusual events like the vector differing from vCPU 0's (note that the respective condition also makes sure vCPU 0 itself will have the vector setting logged), or it changing after it was once set. (Arguably a downside is that some vCPU not having its vector set would no longer be recognizable from the logs. But I think that's tolerable as sufficiently unlikely outside of people actively fiddling with related code.)