Re: [PATCH v4 04/17] kvm: x86: Add support for activate/de-activate APICv at runtime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/11/19 23:41, Suthikulpanit, Suravee wrote:
> +void kvm_request_apicv_update(struct kvm *kvm, bool activate, ulong bit)
> +{
> +	if (activate) {
> +		if (!test_and_clear_bit(bit, &kvm->arch.apicv_deact_msk) ||
> +		    !kvm_apicv_activated(kvm))
> +			return;
> +	} else {
> +		if (test_and_set_bit(bit, &kvm->arch.apicv_deact_msk) ||
> +		    kvm_apicv_activated(kvm))
> +			return;
> +	}
> +
> +	kvm_make_all_cpus_request(kvm, KVM_REQ_APICV_UPDATE);
> +}
> +EXPORT_SYMBOL_GPL(kvm_request_apicv_update);
> +

It's worth documenting the locking requirements of
kvm_request_apicv_update (it can also be negative requirements, such as
"don't hold any lock"), because kvm_make_all_cpus_request is a somewhat
deadlock-prone API.

Again, something I'll check after a more thorough review.

Paolo



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux