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]
Date:   Tue, 16 Nov 2021 19:47:08 +0530
From:   Anup Patel <anup@...infault.org>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     Anup Patel <anup.patel@....com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Atish Patra <atish.patra@....com>,
        KVM General <kvm@...r.kernel.org>,
        kvm-riscv@...ts.infradead.org,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] KVM: RISC-V: Unmap stage2 mapping when
 deleting/moving a memslot

On Thu, Nov 4, 2021 at 10:11 PM Sean Christopherson <seanjc@...gle.com> wrote:
>
> Unmap stage2 page tables when a memslot is being deleted or moved.  It's
> the architectures' responsibility to ensure existing mappings are removed
> when kvm_arch_flush_shadow_memslot() returns.
>
> Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support")
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>

The Fixes tag should be
Fixes: 9d05c1fee837 ("RISC-V: KVM: Implement stage2 page table programming")

Otherwise it looks good to me.

I have queued this patch for fixes.

Thanks,
Anup

> ---
>  arch/riscv/kvm/mmu.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c
> index d81bae8eb55e..fc058ff5f4b6 100644
> --- a/arch/riscv/kvm/mmu.c
> +++ b/arch/riscv/kvm/mmu.c
> @@ -453,6 +453,12 @@ void kvm_arch_flush_shadow_all(struct kvm *kvm)
>  void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
>                                    struct kvm_memory_slot *slot)
>  {
> +       gpa_t gpa = slot->base_gfn << PAGE_SHIFT;
> +       phys_addr_t size = slot->npages << PAGE_SHIFT;
> +
> +       spin_lock(&kvm->mmu_lock);
> +       stage2_unmap_range(kvm, gpa, size, false);
> +       spin_unlock(&kvm->mmu_lock);
>  }
>
>  void kvm_arch_commit_memory_region(struct kvm *kvm,
> --
> 2.34.0.rc0.344.g81b53c2807-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ