[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32d5c485-7ee8-fffd-a461-4c01101a2396@amd.com>
Date: Mon, 4 Nov 2019 19:22:43 +0000
From: "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@....com>
To: Paolo Bonzini <pbonzini@...hat.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
Paolo,
On 11/2/19 4:52 AM, Paolo Bonzini wrote:
> 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.
Currently, I have a comment in the svm_request_update_avic(), where it
calls kvm_request_apicv_update. I'll move it here instead and enhance
the comment.
Thanks,
Suravee
Powered by blists - more mailing lists