[PATCH v4 19/21] KVM: arm64: Remove unused page-table code

Marc Zyngier maz at kernel.org
Tue Sep 8 06:33:35 EDT 2020


Hi Will,

On 2020-09-07 16:23, Will Deacon wrote:
> Now that KVM is using the generic page-table code to manage the guest
> stage-2 page-tables, we can remove a bunch of unused macros, #defines
> and static inline functions from the old implementation.
> 
> Cc: Marc Zyngier <maz at kernel.org>
> Cc: Quentin Perret <qperret at google.com>
> Reviewed-by: Gavin Shan <gshan at redhat.com>
> Signed-off-by: Will Deacon <will at kernel.org>
> ---
>  arch/arm64/include/asm/kvm_mmu.h        | 171 ------
>  arch/arm64/include/asm/pgtable-hwdef.h  |  17 -
>  arch/arm64/include/asm/pgtable-prot.h   |  13 -
>  arch/arm64/include/asm/stage2_pgtable.h | 215 -------
>  arch/arm64/kvm/mmu.c                    | 755 ------------------------
>  5 files changed, 1171 deletions(-)
> 

[...]

> diff --git a/arch/arm64/include/asm/pgtable-hwdef.h
> b/arch/arm64/include/asm/pgtable-hwdef.h
> index 1a989353144e..bb97d464f42b 100644
> --- a/arch/arm64/include/asm/pgtable-hwdef.h
> +++ b/arch/arm64/include/asm/pgtable-hwdef.h
> @@ -172,23 +172,6 @@
>  #define PTE_ATTRINDX(t)		(_AT(pteval_t, (t)) << 2)
>  #define PTE_ATTRINDX_MASK	(_AT(pteval_t, 7) << 2)
> 
> -/*
> - * 2nd stage PTE definitions
> - */
> -#define PTE_S2_RDONLY		(_AT(pteval_t, 1) << 6)   /* HAP[2:1] */
> -#define PTE_S2_RDWR		(_AT(pteval_t, 3) << 6)   /* HAP[2:1] */
> -#define PTE_S2_XN		(_AT(pteval_t, 2) << 53)  /* XN[1:0] */
> -#define PTE_S2_SW_RESVD		(_AT(pteval_t, 15) << 55) /* Reserved for SW 
> */
> -
> -#define PMD_S2_RDONLY		(_AT(pmdval_t, 1) << 6)   /* HAP[2:1] */
> -#define PMD_S2_RDWR		(_AT(pmdval_t, 3) << 6)   /* HAP[2:1] */
> -#define PMD_S2_XN		(_AT(pmdval_t, 2) << 53)  /* XN[1:0] */
> -#define PMD_S2_SW_RESVD		(_AT(pmdval_t, 15) << 55) /* Reserved for SW 
> */
> -
> -#define PUD_S2_RDONLY		(_AT(pudval_t, 1) << 6)   /* HAP[2:1] */
> -#define PUD_S2_RDWR		(_AT(pudval_t, 3) << 6)   /* HAP[2:1] */
> -#define PUD_S2_XN		(_AT(pudval_t, 2) << 53)  /* XN[1:0] */
> -
>  /*
>   * Memory Attribute override for Stage-2 (MemAttr[3:0])
>   */

This breaks the (still out of tree) NV patches, which use some of
these definitions as part of the architectural S2 PTW.

I can either keep a KVM-private copy, or revert this hunk. What do
you think?

         M.
-- 
Jazz is not dead. It just smells funny...



More information about the linux-arm-kernel mailing list