[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21bdde39-8d33-6aae-e729-476ce11406a3@redhat.com>
Date: Mon, 5 Aug 2019 18:03:00 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Anup Patel <Anup.Patel@....com>,
Palmer Dabbelt <palmer@...ive.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Radim K <rkrcmar@...hat.com>
Cc: 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>,
Anup Patel <anup@...infault.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 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".
Paolo
Powered by blists - more mailing lists