Re: [PATCH v3 09/16] kvm: x86: hyperv: Use APICv deactivate request interface

From: Paolo Bonzini
Date: Wed Oct 09 2019 - 05:21:57 EST


On 13/09/19 21:01, Suthikulpanit, Suravee wrote:
> + *
> + * Since this requires updating
> + * APIC_ACCESS_PAGE_PRIVATE_MEMSLOT,
> + * also take srcu lock.

This comment is incorrect, it says you are entering a read-side critical
section to update the data structure. It's only needed because
kvm_make_apicv_deactivate_request expects that it needs to unlock and
relock kvm->srcu.

Paolo

> */
> - kvm_vcpu_deactivate_apicv(vcpu);
> + vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
> + kvm_make_apicv_deactivate_request(vcpu, true);
> + srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
> +