lkml.org 
[lkml]   [2019]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 11/19] RISC-V: KVM: Implement VMID allocator
On Mon, Aug 5, 2019 at 9:33 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 05/08/19 15:43, Anup Patel wrote:
> > + spin_lock(&vmid_lock);
> > +
> > + /*
> > + * We need to re-check the vmid_version here to ensure that if
> > + * another vcpu already allocated a valid vmid for this vm.
> > + */
> > + if (!kvm_riscv_stage2_vmid_ver_changed(vmid)) {
> > + spin_unlock(&vmid_lock);
> > + return;
> > + }
> > +
> > + /* First user of a new VMID version? */
> > + if (unlikely(vmid_next == 0)) {
> > + WRITE_ONCE(vmid_version, READ_ONCE(vmid_version) + 1);
> > + vmid_next = 1;
> > +
> > + /*
> > + * On SMP, we know no other CPUs can use this CPU's or
> > + * each other's VMID after forced exit returns since the
> > + * vmid_lock blocks them from re-entry to the guest.
> > + */
> > + spin_unlock(&vmid_lock);
> > + kvm_flush_remote_tlbs(vcpu->kvm);
> > + spin_lock(&vmid_lock);
>
> This comment is not true anymore, so this "if" should become a "while".

Sure, I will update in v4.

Regards,
Anup

\
 
 \ /
  Last update: 2019-08-06 05:25    [W:0.070 / U:1.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site