Re: [PATCH v3 15/16] kvm: x86: ioapic: Lazy update IOAPIC EOI

From: Paolo Bonzini
Date: Thu Oct 31 2019 - 19:09:05 EST


On 31/10/19 16:17, Suthikulpanit, Suravee wrote:
> What if we change kvm->arch.apicv_state to kvm->arch.apicv_disable_mask
> and have each bit representing the reason for deactivating APICv.
>
> For example:
> #define APICV_DISABLE_MASK_IRQWIN 0
> #define APICV_DISABLE_MASK_HYPERV 1
> #define APICV_DISABLE_MASK_PIT_REINJ 2
> #define APICV_DISABLE_MASK_NESTED 3
>
> In this case, we activate APICv only if kvm->arch.apicv_disable_mask ==
> 0. This way, we can find out why APICv is deactivated on a particular VM
> at a particular point in time.

Yes, that also works for me if it makes for an easier implementation.

Paolo