[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c83eb23c-2d4f-fd22-ed9f-d4eeffa8bcd6@redhat.com>
Date: Sat, 2 Nov 2019 10:52:18 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>
Cc: "rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"joro@...tes.org" <joro@...tes.org>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"rkagan@...tuozzo.com" <rkagan@...tuozzo.com>,
"graf@...zon.com" <graf@...zon.com>,
"jschoenh@...zon.de" <jschoenh@...zon.de>,
"karahmed@...zon.de" <karahmed@...zon.de>,
"rimasluk@...zon.com" <rimasluk@...zon.com>,
"Grimm, Jon" <Jon.Grimm@....com>
Subject: Re: [PATCH v4 04/17] kvm: x86: Add support for activate/de-activate
APICv at runtime
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
Powered by blists - more mailing lists