Re: [PATCH v4 03/17] kvm: x86: Introduce APICv deactivate bits

From: Paolo Bonzini
Date: Sat Nov 02 2019 - 05:51:43 EST


On 01/11/19 23:41, Suthikulpanit, Suravee wrote:
> + unsigned long apicv_deact_msk;

No abbrev fld names. :) I can change this to something like
apicv_inhibit_reasons if there are no other issues (and likewise
s/APICV_DEACT_BIT_/APICV_INHIBIT_REASON_/).

>
> +bool kvm_apicv_activated(struct kvm *kvm)
> +{
> + return (READ_ONCE(kvm->arch.apicv_deact_msk) == 0);
> +}

Using READ_ONCE introduces a risk of races. I'll check during a more
thorough review if it's worth introducing separate kvm_apicv_active and
kvm_apicv_active_nolock functions.

Paolo