linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: peterx@redhat.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	x86@kernel.org, "Kirill A . Shutemov" <kirill@shutemov.name>,
	Jason Gunthorpe <jgg@nvidia.com>, Yang Shi <shy828301@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org,
	Muchun Song <muchun.song@linux.dev>
Subject: Re: [PATCH v3 09/10] mm/treewide: Drop pXd_large()
Date: Wed, 6 Mar 2024 08:34:35 +0200	[thread overview]
Message-ID: <ZegOe5XEsLl9vu3E@kernel.org> (raw)
In-Reply-To: <20240305043750.93762-10-peterx@redhat.com>

On Tue, Mar 05, 2024 at 12:37:49PM +0800, peterx@redhat.com wrote:
> From: Peter Xu <peterx@redhat.com>
> 
> They're not used anymore, drop all of them.
> 
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>

> ---
>  arch/arm/include/asm/pgtable-2level.h        |  1 -
>  arch/arm/include/asm/pgtable-3level.h        |  1 -
>  arch/loongarch/kvm/mmu.c                     |  2 +-
>  arch/powerpc/include/asm/book3s/64/pgtable.h |  4 +---
>  arch/powerpc/include/asm/pgtable.h           |  4 ----
>  arch/s390/include/asm/pgtable.h              |  8 ++++----
>  arch/sparc/include/asm/pgtable_64.h          |  8 ++++----
>  arch/x86/include/asm/pgtable.h               | 19 +++++++------------
>  arch/x86/kvm/mmu/mmu.c                       |  2 +-
>  9 files changed, 18 insertions(+), 31 deletions(-)
> 
> diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
> index ce543cd9380c..b0a262566eb9 100644
> --- a/arch/arm/include/asm/pgtable-2level.h
> +++ b/arch/arm/include/asm/pgtable-2level.h
> @@ -213,7 +213,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
>  
>  #define pmd_pfn(pmd)		(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
>  
> -#define pmd_large(pmd)		(pmd_val(pmd) & 2)
>  #define pmd_leaf(pmd)		(pmd_val(pmd) & 2)
>  #define pmd_bad(pmd)		(pmd_val(pmd) & 2)
>  #define pmd_present(pmd)	(pmd_val(pmd))
> diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
> index 71c3add6417f..4b1d9eb3908a 100644
> --- a/arch/arm/include/asm/pgtable-3level.h
> +++ b/arch/arm/include/asm/pgtable-3level.h
> @@ -118,7 +118,6 @@
>  						 PMD_TYPE_TABLE)
>  #define pmd_sect(pmd)		((pmd_val(pmd) & PMD_TYPE_MASK) == \
>  						 PMD_TYPE_SECT)
> -#define pmd_large(pmd)		pmd_sect(pmd)
>  #define pmd_leaf(pmd)		pmd_sect(pmd)
>  
>  #define pud_clear(pudp)			\
> diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c
> index 50a6acd7ffe4..a556cff35740 100644
> --- a/arch/loongarch/kvm/mmu.c
> +++ b/arch/loongarch/kvm/mmu.c
> @@ -723,7 +723,7 @@ static int host_pfn_mapping_level(struct kvm *kvm, gfn_t gfn,
>  	/*
>  	 * Read each entry once.  As above, a non-leaf entry can be promoted to
>  	 * a huge page _during_ this walk.  Re-reading the entry could send the
> -	 * walk into the weeks, e.g. p*d_large() returns false (sees the old
> +	 * walk into the weeks, e.g. p*d_leaf() returns false (sees the old
>  	 * value) and then p*d_offset() walks into the target huge page instead
>  	 * of the old page table (sees the new value).
>  	 */
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index 3e99e409774a..df66dce8306f 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -1437,17 +1437,15 @@ static inline bool is_pte_rw_upgrade(unsigned long old_val, unsigned long new_va
>  }
>  
>  /*
> - * Like pmd_huge() and pmd_large(), but works regardless of config options
> + * Like pmd_huge(), but works regardless of config options
>   */
>  #define pmd_leaf pmd_leaf
> -#define pmd_large pmd_leaf
>  static inline bool pmd_leaf(pmd_t pmd)
>  {
>  	return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE));
>  }
>  
>  #define pud_leaf pud_leaf
> -#define pud_large pud_leaf
>  static inline bool pud_leaf(pud_t pud)
>  {
>  	return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PTE));
> diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
> index e6edf1cdbc5b..239709a2f68e 100644
> --- a/arch/powerpc/include/asm/pgtable.h
> +++ b/arch/powerpc/include/asm/pgtable.h
> @@ -101,10 +101,6 @@ void poking_init(void);
>  extern unsigned long ioremap_bot;
>  extern const pgprot_t protection_map[16];
>  
> -#ifndef pmd_large
> -#define pmd_large(pmd)		0
> -#endif
> -
>  /* can we use this in kvm */
>  unsigned long vmalloc_to_phys(void *vmalloc_addr);
>  
> diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
> index a5f16a244a64..9e08af5b9247 100644
> --- a/arch/s390/include/asm/pgtable.h
> +++ b/arch/s390/include/asm/pgtable.h
> @@ -705,16 +705,16 @@ static inline int pud_none(pud_t pud)
>  	return pud_val(pud) == _REGION3_ENTRY_EMPTY;
>  }
>  
> -#define pud_leaf	pud_large
> -static inline int pud_large(pud_t pud)
> +#define pud_leaf pud_leaf
> +static inline int pud_leaf(pud_t pud)
>  {
>  	if ((pud_val(pud) & _REGION_ENTRY_TYPE_MASK) != _REGION_ENTRY_TYPE_R3)
>  		return 0;
>  	return !!(pud_val(pud) & _REGION3_ENTRY_LARGE);
>  }
>  
> -#define pmd_leaf	pmd_large
> -static inline int pmd_large(pmd_t pmd)
> +#define pmd_leaf pmd_leaf
> +static inline int pmd_leaf(pmd_t pmd)
>  {
>  	return (pmd_val(pmd) & _SEGMENT_ENTRY_LARGE) != 0;
>  }
> diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
> index 652af9d63fa2..6ff0a28d5fd1 100644
> --- a/arch/sparc/include/asm/pgtable_64.h
> +++ b/arch/sparc/include/asm/pgtable_64.h
> @@ -680,8 +680,8 @@ static inline unsigned long pte_special(pte_t pte)
>  	return pte_val(pte) & _PAGE_SPECIAL;
>  }
>  
> -#define pmd_leaf	pmd_large
> -static inline unsigned long pmd_large(pmd_t pmd)
> +#define pmd_leaf pmd_leaf
> +static inline unsigned long pmd_leaf(pmd_t pmd)
>  {
>  	pte_t pte = __pte(pmd_val(pmd));
>  
> @@ -867,8 +867,8 @@ static inline pmd_t *pud_pgtable(pud_t pud)
>  /* only used by the stubbed out hugetlb gup code, should never be called */
>  #define p4d_page(p4d)			NULL
>  
> -#define pud_leaf	pud_large
> -static inline unsigned long pud_large(pud_t pud)
> +#define pud_leaf pud_leaf
> +static inline unsigned long pud_leaf(pud_t pud)
>  {
>  	pte_t pte = __pte(pud_val(pud));
>  
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index 9db7a38a0e9f..cfc84c55d0e6 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -251,8 +251,8 @@ static inline unsigned long pgd_pfn(pgd_t pgd)
>  	return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT;
>  }
>  
> -#define p4d_leaf	p4d_large
> -static inline int p4d_large(p4d_t p4d)
> +#define p4d_leaf p4d_leaf
> +static inline int p4d_leaf(p4d_t p4d)
>  {
>  	/* No 512 GiB pages yet */
>  	return 0;
> @@ -260,14 +260,14 @@ static inline int p4d_large(p4d_t p4d)
>  
>  #define pte_page(pte)	pfn_to_page(pte_pfn(pte))
>  
> -#define pmd_leaf	pmd_large
> -static inline int pmd_large(pmd_t pte)
> +#define pmd_leaf pmd_leaf
> +static inline int pmd_leaf(pmd_t pte)
>  {
>  	return pmd_flags(pte) & _PAGE_PSE;
>  }
>  
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> -/* NOTE: when predicate huge page, consider also pmd_devmap, or use pmd_large */
> +/* NOTE: when predicate huge page, consider also pmd_devmap, or use pmd_leaf */
>  static inline int pmd_trans_huge(pmd_t pmd)
>  {
>  	return (pmd_val(pmd) & (_PAGE_PSE|_PAGE_DEVMAP)) == _PAGE_PSE;
> @@ -1085,8 +1085,8 @@ static inline pmd_t *pud_pgtable(pud_t pud)
>   */
>  #define pud_page(pud)	pfn_to_page(pud_pfn(pud))
>  
> -#define pud_leaf	pud_large
> -static inline int pud_large(pud_t pud)
> +#define pud_leaf pud_leaf
> +static inline int pud_leaf(pud_t pud)
>  {
>  	return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
>  		(_PAGE_PSE | _PAGE_PRESENT);
> @@ -1096,11 +1096,6 @@ static inline int pud_bad(pud_t pud)
>  {
>  	return (pud_flags(pud) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
>  }
> -#else
> -static inline int pud_large(pud_t pud)
> -{
> -	return 0;
> -}
>  #endif	/* CONFIG_PGTABLE_LEVELS > 2 */
>  
>  #if CONFIG_PGTABLE_LEVELS > 3
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index 5cb5bc4a72c4..58f5e6b637b4 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -3110,7 +3110,7 @@ static int host_pfn_mapping_level(struct kvm *kvm, gfn_t gfn,
>  	/*
>  	 * Read each entry once.  As above, a non-leaf entry can be promoted to
>  	 * a huge page _during_ this walk.  Re-reading the entry could send the
> -	 * walk into the weeks, e.g. p*d_large() returns false (sees the old
> +	 * walk into the weeks, e.g. p*d_leaf() returns false (sees the old
>  	 * value) and then p*d_offset() walks into the target huge page instead
>  	 * of the old page table (sees the new value).
>  	 */
> -- 
> 2.44.0
> 
> 

-- 
Sincerely yours,
Mike.


  reply	other threads:[~2024-03-06  6:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05  4:37 [PATCH v3 00/10] mm/treewide: Replace pXd_large() with pXd_leaf() peterx
2024-03-05  4:37 ` [PATCH v3 01/10] mm/ppc: Define " peterx
2024-03-05 17:29   ` Christophe Leroy
2024-03-06  6:15   ` Mike Rapoport
2024-03-05  4:37 ` [PATCH v3 02/10] mm/ppc: Replace pXd_is_leaf() " peterx
2024-03-05 17:31   ` Christophe Leroy
2024-03-06  6:20   ` Mike Rapoport
2024-03-05  4:37 ` [PATCH v3 03/10] mm/x86: Replace p4d_large() with p4d_leaf() peterx
2024-03-06  6:23   ` Mike Rapoport
2024-03-05  4:37 ` [PATCH v3 04/10] mm/x86: Replace pgd_large() with pgd_leaf() peterx
2024-03-05 16:05   ` Jason Gunthorpe
2024-03-06  6:23   ` Mike Rapoport
2024-03-05  4:37 ` [PATCH v3 05/10] mm/x86: Drop two unnecessary pud_leaf() definitions peterx
2024-03-06  6:27   ` Mike Rapoport
2024-03-05  4:37 ` [PATCH v3 06/10] mm/kasan: Use pXd_leaf() in shadow_mapped() peterx
2024-03-06  6:28   ` Mike Rapoport
2024-03-05  4:37 ` [PATCH v3 07/10] mm/treewide: Replace pmd_large() with pmd_leaf() peterx
2024-03-06  6:31   ` Mike Rapoport
2024-03-05  4:37 ` [PATCH v3 08/10] mm/treewide: Replace pud_large() with pud_leaf() peterx
2024-03-05  4:37 ` [PATCH v3 09/10] mm/treewide: Drop pXd_large() peterx
2024-03-06  6:34   ` Mike Rapoport [this message]
2024-03-05  4:37 ` [PATCH v3 10/10] mm/treewide: Align up pXd_leaf() retval across archs peterx
2024-03-05 14:33   ` Jason Gunthorpe
2024-03-06  6:35   ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZegOe5XEsLl9vu3E@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jgg@nvidia.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=muchun.song@linux.dev \
    --cc=peterx@redhat.com \
    --cc=shy828301@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox