qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 08/20] kvm: arm/arm64: Abstract stage2 pgd ta


From: Auger Eric
Subject: Re: [Qemu-devel] [PATCH v3 08/20] kvm: arm/arm64: Abstract stage2 pgd table allocation
Date: Mon, 2 Jul 2018 17:01:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

Hi Suzuki

On 06/29/2018 01:15 PM, Suzuki K Poulose wrote:
> Abstract the allocation of stage2 entry level tables for
> given VM, so that later we can choose to fall back to the
> normal page table levels (i.e, avoid entry level table
> concatenation) on arm64.

the justification is not crystal clear to me but it does no harm I think.
> 
> Cc: Marc Zyngier <address@hidden>
> Cc: Christoffer Dall <address@hidden>
> Signed-off-by: Suzuki K Poulose <address@hidden>
> ---
> Changes since V2:
>  - New patch
> ---
>  arch/arm/include/asm/kvm_mmu.h   | 6 ++++++
>  arch/arm64/include/asm/kvm_mmu.h | 6 ++++++
>  virt/kvm/arm/mmu.c               | 2 +-
>  3 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
> index f36eb20..b2da5a4 100644
> --- a/arch/arm/include/asm/kvm_mmu.h
> +++ b/arch/arm/include/asm/kvm_mmu.h
> @@ -372,6 +372,12 @@ static inline int hyp_map_aux_data(void)
>       return 0;
>  }
>  
> +static inline void *stage2_alloc_pgd(struct kvm *kvm)
> +{
> +     return alloc_pages_exact(stage2_pgd_size(kvm),
> +                              GFP_KERNEL | __GFP_ZERO);
> +}
> +
>  #define kvm_phys_to_vttbr(addr)              (addr)
>  
>  #endif       /* !__ASSEMBLY__ */
> diff --git a/arch/arm64/include/asm/kvm_mmu.h 
> b/arch/arm64/include/asm/kvm_mmu.h
> index 5da8f52..dbaf513 100644
> --- a/arch/arm64/include/asm/kvm_mmu.h
> +++ b/arch/arm64/include/asm/kvm_mmu.h
> @@ -501,5 +501,11 @@ static inline int hyp_map_aux_data(void)
>  
>  #define kvm_phys_to_vttbr(addr)              phys_to_ttbr(addr)
>  
> +static inline void *stage2_alloc_pgd(struct kvm *kvm)
> +{
> +     return alloc_pages_exact(stage2_pgd_size(kvm),
> +                              GFP_KERNEL | __GFP_ZERO);
> +}
> +
>  #endif /* __ASSEMBLY__ */
>  #endif /* __ARM64_KVM_MMU_H__ */
> diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
> index 82dd571..a339e00 100644
> --- a/virt/kvm/arm/mmu.c
> +++ b/virt/kvm/arm/mmu.c
> @@ -868,7 +868,7 @@ int kvm_alloc_stage2_pgd(struct kvm *kvm)
>       }
>  
>       /* Allocate the HW PGD, making sure that each page gets its own 
> refcount */
> -     pgd = alloc_pages_exact(stage2_pgd_size(kvm), GFP_KERNEL | __GFP_ZERO);
> +     pgd = stage2_alloc_pgd(kvm);
>       if (!pgd)
>               return -ENOMEM;
>  
> 
Reviewed-by: Eric Auger <address@hidden>

Thanks

Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]