* [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection()
@ 2022-11-01 5:38 Bo Liu
2022-11-02 8:14 ` Andrew Jones
2022-11-27 12:04 ` Anup Patel
0 siblings, 2 replies; 3+ messages in thread
From: Bo Liu @ 2022-11-01 5:38 UTC (permalink / raw)
To: anup, atishp, paul.walmsley, palmer, aou
Cc: kvm, kvm-riscv, linux-riscv, linux-kernel, Bo Liu
vma_lookup() finds the vma of a specific address with a cleaner interface
and is more readable.
Signed-off-by: Bo Liu <liubo03@inspur.com>
---
arch/riscv/kvm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c
index 3620ecac2fa1..5942d10c9736 100644
--- a/arch/riscv/kvm/mmu.c
+++ b/arch/riscv/kvm/mmu.c
@@ -632,7 +632,7 @@ int kvm_riscv_gstage_map(struct kvm_vcpu *vcpu,
mmap_read_lock(current->mm);
- vma = find_vma_intersection(current->mm, hva, hva + 1);
+ vma = vma_lookup(current->mm, hva);
if (unlikely(!vma)) {
kvm_err("Failed to find VMA for hva 0x%lx\n", hva);
mmap_read_unlock(current->mm);
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection()
2022-11-01 5:38 [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection() Bo Liu
@ 2022-11-02 8:14 ` Andrew Jones
2022-11-27 12:04 ` Anup Patel
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Jones @ 2022-11-02 8:14 UTC (permalink / raw)
To: Bo Liu
Cc: anup, atishp, paul.walmsley, palmer, aou, kvm, kvm-riscv,
linux-riscv, linux-kernel
On Tue, Nov 01, 2022 at 01:38:11AM -0400, Bo Liu wrote:
> vma_lookup() finds the vma of a specific address with a cleaner interface
> and is more readable.
>
> Signed-off-by: Bo Liu <liubo03@inspur.com>
> ---
> arch/riscv/kvm/mmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c
> index 3620ecac2fa1..5942d10c9736 100644
> --- a/arch/riscv/kvm/mmu.c
> +++ b/arch/riscv/kvm/mmu.c
> @@ -632,7 +632,7 @@ int kvm_riscv_gstage_map(struct kvm_vcpu *vcpu,
>
> mmap_read_lock(current->mm);
>
> - vma = find_vma_intersection(current->mm, hva, hva + 1);
> + vma = vma_lookup(current->mm, hva);
> if (unlikely(!vma)) {
> kvm_err("Failed to find VMA for hva 0x%lx\n", hva);
> mmap_read_unlock(current->mm);
> --
> 2.27.0
>
>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection()
2022-11-01 5:38 [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection() Bo Liu
2022-11-02 8:14 ` Andrew Jones
@ 2022-11-27 12:04 ` Anup Patel
1 sibling, 0 replies; 3+ messages in thread
From: Anup Patel @ 2022-11-27 12:04 UTC (permalink / raw)
To: Bo Liu
Cc: atishp, paul.walmsley, palmer, aou, kvm, kvm-riscv, linux-riscv,
linux-kernel
On Tue, Nov 1, 2022 at 11:08 AM Bo Liu <liubo03@inspur.com> wrote:
>
> vma_lookup() finds the vma of a specific address with a cleaner interface
> and is more readable.
>
> Signed-off-by: Bo Liu <liubo03@inspur.com>
Looks good to me.
Queued this patch for Linux-6.2
Thanks,
Anup
> ---
> arch/riscv/kvm/mmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c
> index 3620ecac2fa1..5942d10c9736 100644
> --- a/arch/riscv/kvm/mmu.c
> +++ b/arch/riscv/kvm/mmu.c
> @@ -632,7 +632,7 @@ int kvm_riscv_gstage_map(struct kvm_vcpu *vcpu,
>
> mmap_read_lock(current->mm);
>
> - vma = find_vma_intersection(current->mm, hva, hva + 1);
> + vma = vma_lookup(current->mm, hva);
> if (unlikely(!vma)) {
> kvm_err("Failed to find VMA for hva 0x%lx\n", hva);
> mmap_read_unlock(current->mm);
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-27 12:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 5:38 [PATCH] RISC-V: KVM: use vma_lookup() instead of find_vma_intersection() Bo Liu
2022-11-02 8:14 ` Andrew Jones
2022-11-27 12:04 ` Anup Patel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).