Re: [PATCH 3/3] KVM: x86: Trace all APICv inhibit changes and capture overall status

From: Chao Gao
Date: Tue Mar 15 2022 - 10:29:38 EST


On Fri, Mar 11, 2022 at 04:35:17AM +0000, Sean Christopherson wrote:
>--- a/arch/x86/kvm/x86.c
>+++ b/arch/x86/kvm/x86.c
>@@ -9053,15 +9053,29 @@ bool kvm_apicv_activated(struct kvm *kvm)
> }
> EXPORT_SYMBOL_GPL(kvm_apicv_activated);
>
>+

stray newline.

>+static void set_or_clear_apicv_inhibit(unsigned long *inhibits,
>+ enum kvm_apicv_inhibit reason, bool set)
>+{
>+ if (set)
>+ __set_bit(reason, inhibits);
>+ else
>+ __clear_bit(reason, inhibits);
>+
>+ trace_kvm_apicv_inhibit_changed(reason, set, *inhibits);

Note that some calls may not toggle any bit. Do you want to log them?
I am afraid that a VM with many vCPUs may get a lot of traces that actually
doesn't change inhibits.

Anyway, this series looks good to me.