[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c4a69ce-595e-d5a1-7b4e-e6ce1afe1252@redhat.com>
Date: Wed, 23 Jun 2021 23:50:35 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Maxim Levitsky <mlevitsk@...hat.com>, kvm@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Sean Christopherson <seanjc@...gle.com>,
Wanpeng Li <wanpengli@...cent.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Joerg Roedel <joro@...tes.org>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@...r.kernel.org>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Jim Mattson <jmattson@...gle.com>
Subject: Re: [PATCH 02/10] KVM: x86: APICv: fix race in
kvm_request_apicv_update on SVM
On 23/06/21 13:29, Maxim Levitsky wrote:
> + kvm_block_guest_entries(kvm);
> +
> trace_kvm_apicv_update_request(activate, bit);
> if (kvm_x86_ops.pre_update_apicv_exec_ctrl)
> static_call(kvm_x86_pre_update_apicv_exec_ctrl)(kvm, activate);
> @@ -9243,6 +9245,8 @@ void kvm_request_apicv_update(struct kvm *kvm, bool activate, ulong bit)
> except = kvm_get_running_vcpu();
> kvm_make_all_cpus_request_except(kvm, KVM_REQ_APICV_UPDATE,
> except);
> +
> + kvm_allow_guest_entries(kvm);
Doesn't this cause a busy loop during synchronize_rcu? It should be
possible to request the vmexit of other CPUs from
avic_update_access_page, and do a lock/unlock of kvm->slots_lock to wait
for the memslot to be updated.
(As an aside, I'd like to get rid of KVM_REQ_MCLOCK_IN_PROGRESS in 5.15...).
Paolo
Powered by blists - more mailing lists