lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhSdy03G-8S0y7kg96PzC-4npdEFv+WCCuBvoCbEt9244kDOg@mail.gmail.com>
Date:   Tue, 6 Aug 2019 08:49:24 +0530
From:   Anup Patel <anup@...infault.org>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Anup Patel <Anup.Patel@....com>,
        Palmer Dabbelt <palmer@...ive.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Radim K <rkrcmar@...hat.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Atish Patra <Atish.Patra@....com>,
        Alistair Francis <Alistair.Francis@....com>,
        Damien Le Moal <Damien.LeMoal@....com>,
        Christoph Hellwig <hch@...radead.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 11/19] RISC-V: KVM: Implement VMID allocator

On Mon, Aug 5, 2019 at 9:33 PM Paolo Bonzini <pbonzini@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ