All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: linux-kernel@vger.kernel.org, Nicholas Piggin <npiggin@gmail.com>,
	linux-mm@kvack.org, Peter Xu <peterx@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH v2 15/20] powerpc/85xx: Switch to 64 bits PGD
Date: Sat, 25 May 2024 06:54:46 +0200	[thread overview]
Message-ID: <ZlFvFk6QmyD-ieS5@localhost.localdomain> (raw)
In-Reply-To: <a1d92dd7c390672c163ce0611600dde8cb0eaab4.1715971869.git.christophe.leroy@csgroup.eu>

On Fri, May 17, 2024 at 09:00:09PM +0200, Christophe Leroy wrote:
> In order to allow leaf PMD entries, switch the PGD to 64 bits entries.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

I do not quite understand this change.
Are not powerE500 and power85xx two different things?
You are changing making it 64 for PPC_E500_64bits, but you are updating head_85xx.
Are they sharing this code?

Also, we would benefit from a slightly bigger changelog, explaining why
do we need this change in some more detail.

 
> diff --git a/arch/powerpc/include/asm/pgtable-types.h b/arch/powerpc/include/asm/pgtable-types.h
> index 082c85cc09b1..db965d98e0ae 100644
> --- a/arch/powerpc/include/asm/pgtable-types.h
> +++ b/arch/powerpc/include/asm/pgtable-types.h
> @@ -49,7 +49,11 @@ static inline unsigned long pud_val(pud_t x)
>  #endif /* CONFIG_PPC64 */
>  
>  /* PGD level */
> +#if defined(CONFIG_PPC_E500) && defined(CONFIG_PTE_64BIT)
> +typedef struct { unsigned long long pgd; } pgd_t;
> +#else
>  typedef struct { unsigned long pgd; } pgd_t;
> +#endif
>  #define __pgd(x)	((pgd_t) { (x) })
>  static inline unsigned long pgd_val(pgd_t x)
>  {
> diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S
> index 39724ff5ae1f..a305244afc9f 100644
> --- a/arch/powerpc/kernel/head_85xx.S
> +++ b/arch/powerpc/kernel/head_85xx.S
> @@ -307,8 +307,9 @@ set_ivor:
>  #ifdef CONFIG_PTE_64BIT
>  #ifdef CONFIG_HUGETLB_PAGE
>  #define FIND_PTE	\
> -	rlwinm	r12, r10, 13, 19, 29;	/* Compute pgdir/pmd offset */	\
> -	lwzx	r11, r12, r11;		/* Get pgd/pmd entry */		\
> +	rlwinm	r12, r10, 14, 18, 28;	/* Compute pgdir/pmd offset */	\
> +	add	r12, r11, r12;

You add the offset to pgdir? 

> +	lwz	r11, 4(r12);		/* Get pgd/pmd entry */		\

What is i offset 4?


-- 
Oscar Salvador
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Oscar Salvador <osalvador@suse.de>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@nvidia.com>, Peter Xu <peterx@redhat.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH v2 15/20] powerpc/85xx: Switch to 64 bits PGD
Date: Sat, 25 May 2024 06:54:46 +0200	[thread overview]
Message-ID: <ZlFvFk6QmyD-ieS5@localhost.localdomain> (raw)
In-Reply-To: <a1d92dd7c390672c163ce0611600dde8cb0eaab4.1715971869.git.christophe.leroy@csgroup.eu>

On Fri, May 17, 2024 at 09:00:09PM +0200, Christophe Leroy wrote:
> In order to allow leaf PMD entries, switch the PGD to 64 bits entries.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

I do not quite understand this change.
Are not powerE500 and power85xx two different things?
You are changing making it 64 for PPC_E500_64bits, but you are updating head_85xx.
Are they sharing this code?

Also, we would benefit from a slightly bigger changelog, explaining why
do we need this change in some more detail.

 
> diff --git a/arch/powerpc/include/asm/pgtable-types.h b/arch/powerpc/include/asm/pgtable-types.h
> index 082c85cc09b1..db965d98e0ae 100644
> --- a/arch/powerpc/include/asm/pgtable-types.h
> +++ b/arch/powerpc/include/asm/pgtable-types.h
> @@ -49,7 +49,11 @@ static inline unsigned long pud_val(pud_t x)
>  #endif /* CONFIG_PPC64 */
>  
>  /* PGD level */
> +#if defined(CONFIG_PPC_E500) && defined(CONFIG_PTE_64BIT)
> +typedef struct { unsigned long long pgd; } pgd_t;
> +#else
>  typedef struct { unsigned long pgd; } pgd_t;
> +#endif
>  #define __pgd(x)	((pgd_t) { (x) })
>  static inline unsigned long pgd_val(pgd_t x)
>  {
> diff --git a/arch/powerpc/kernel/head_85xx.S b/arch/powerpc/kernel/head_85xx.S
> index 39724ff5ae1f..a305244afc9f 100644
> --- a/arch/powerpc/kernel/head_85xx.S
> +++ b/arch/powerpc/kernel/head_85xx.S
> @@ -307,8 +307,9 @@ set_ivor:
>  #ifdef CONFIG_PTE_64BIT
>  #ifdef CONFIG_HUGETLB_PAGE
>  #define FIND_PTE	\
> -	rlwinm	r12, r10, 13, 19, 29;	/* Compute pgdir/pmd offset */	\
> -	lwzx	r11, r12, r11;		/* Get pgd/pmd entry */		\
> +	rlwinm	r12, r10, 14, 18, 28;	/* Compute pgdir/pmd offset */	\
> +	add	r12, r11, r12;

You add the offset to pgdir? 

> +	lwz	r11, 4(r12);		/* Get pgd/pmd entry */		\

What is i offset 4?


-- 
Oscar Salvador
SUSE Labs


  reply	other threads:[~2024-05-25  5:01 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 18:59 [RFC PATCH v2 00/20] Reimplement huge pages without hugepd on powerpc (8xx, e500, book3s/64) Christophe Leroy
2024-05-17 18:59 ` Christophe Leroy
2024-05-17 18:59 ` [RFC PATCH v2 01/20] mm: Provide pagesize to pmd_populate() Christophe Leroy
2024-05-17 18:59   ` Christophe Leroy
2024-05-20  9:01   ` Oscar Salvador
2024-05-20  9:01     ` Oscar Salvador
2024-05-20 16:24     ` Christophe Leroy
2024-05-20 16:24       ` Christophe Leroy
2024-05-21 11:57       ` Oscar Salvador
2024-05-21 11:57         ` Oscar Salvador
2024-05-22  8:37         ` Christophe Leroy
2024-05-22  8:37           ` Christophe Leroy
2024-05-17 18:59 ` [RFC PATCH v2 02/20] mm: Provide page size to pte_alloc_huge() Christophe Leroy
2024-05-17 18:59   ` Christophe Leroy
2024-05-17 18:59 ` [RFC PATCH v2 03/20] mm: Provide pmd to pte_leaf_size() Christophe Leroy
2024-05-17 18:59   ` Christophe Leroy
2024-05-21  9:39   ` Oscar Salvador
2024-05-21  9:39     ` Oscar Salvador
2024-05-22 10:22     ` Christophe Leroy
2024-05-22 10:22       ` Christophe Leroy
2024-05-17 18:59 ` [RFC PATCH v2 04/20] mm: Provide mm_struct and address to huge_ptep_get() Christophe Leroy
2024-05-17 18:59   ` Christophe Leroy
2024-05-18 12:15   ` kernel test robot
2024-05-18 15:34   ` kernel test robot
2024-05-17 18:59 ` [RFC PATCH v2 05/20] powerpc/mm: Allow hugepages without hugepd Christophe Leroy
2024-05-17 18:59   ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 06/20] powerpc/8xx: Fix size given to set_huge_pte_at() Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-20  9:14   ` Oscar Salvador
2024-05-20  9:14     ` Oscar Salvador
2024-05-20 16:31     ` Christophe Leroy
2024-05-20 16:31       ` Christophe Leroy
2024-05-20 17:42       ` Oscar Salvador
2024-05-20 17:42         ` Oscar Salvador
2024-05-22  8:45         ` Christophe Leroy
2024-05-22  8:45           ` Christophe Leroy
2024-05-21  0:48       ` Michael Ellerman
2024-05-21  0:48         ` Michael Ellerman
2024-05-21  9:26         ` Oscar Salvador
2024-05-21  9:26           ` Oscar Salvador
2024-05-22  8:32           ` Christophe Leroy
2024-05-22  8:32             ` Christophe Leroy
2024-05-22 12:18             ` Christophe Leroy
2024-05-22 12:18               ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 07/20] powerpc/8xx: Rework support for 8M pages using contiguous PTE entries Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-24 10:02   ` Oscar Salvador
2024-05-24 10:02     ` Oscar Salvador
2024-05-24 11:47     ` Christophe Leroy
2024-05-24 11:47       ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 08/20] powerpc/8xx: Simplify struct mmu_psize_def Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-25  3:36   ` Oscar Salvador
2024-05-25  3:36     ` Oscar Salvador
2024-05-17 19:00 ` [RFC PATCH v2 09/20] powerpc/mm: Remove _PAGE_PSIZE Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-25  3:40   ` Oscar Salvador
2024-05-25  3:40     ` Oscar Salvador
2024-05-17 19:00 ` [RFC PATCH v2 10/20] powerpc/mm: Fix __find_linux_pte() on 32 bits with PMD leaf entries Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-25  4:12   ` Oscar Salvador
2024-05-25  4:12     ` Oscar Salvador
2024-05-25  6:41     ` Christophe Leroy
2024-05-25  6:41       ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 11/20] powerpc/mm: Complement huge_pte_alloc() for all non HUGEPD setups Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-25  4:29   ` Oscar Salvador
2024-05-25  4:29     ` Oscar Salvador
2024-05-25  6:44     ` Christophe Leroy
2024-05-25  6:44       ` Christophe Leroy
2024-05-25 10:33       ` Oscar Salvador
2024-05-25 10:33         ` Oscar Salvador
2024-05-17 19:00 ` [RFC PATCH v2 12/20] powerpc/64e: Remove unneeded #ifdef CONFIG_PPC_E500 Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-24  7:31   ` Michael Ellerman
2024-05-24  7:31     ` Michael Ellerman
2024-05-24  8:45     ` Christophe Leroy
2024-05-24  8:45       ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 13/20] powerpc/64e: Clean up impossible setups Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 14/20] powerpc/e500: Remove enc field from struct mmu_psize_def Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-25  4:35   ` Oscar Salvador
2024-05-25  4:35     ` Oscar Salvador
2024-05-17 19:00 ` [RFC PATCH v2 15/20] powerpc/85xx: Switch to 64 bits PGD Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-25  4:54   ` Oscar Salvador [this message]
2024-05-25  4:54     ` Oscar Salvador
2024-05-25  9:02     ` Christophe Leroy
2024-05-25  9:02       ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 16/20] powerpc/e500: Encode hugepage size in PTE bits Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 17/20] powerpc/e500: Use contiguous PMD instead of hugepd Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 18/20] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-20 12:54   ` Nicholas Piggin
2024-05-20 12:54     ` Nicholas Piggin
2024-05-20 16:43     ` Christophe Leroy
2024-05-20 16:43       ` Christophe Leroy
2024-05-22  1:13       ` Nicholas Piggin
2024-05-22  1:13         ` Nicholas Piggin
2024-05-22  9:32         ` Christophe Leroy
2024-05-22  9:32           ` Christophe Leroy
2024-05-22 12:23         ` Jason Gunthorpe
2024-05-22 12:23           ` Jason Gunthorpe
2024-05-17 19:00 ` [RFC PATCH v2 19/20] powerpc/mm: Remove hugepd leftovers Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-17 19:00 ` [RFC PATCH v2 20/20] mm: Remove CONFIG_ARCH_HAS_HUGEPD Christophe Leroy
2024-05-17 19:00   ` Christophe Leroy
2024-05-17 19:06 ` [RFC PATCH v2 00/20] Reimplement huge pages without hugepd on powerpc (8xx, e500, book3s/64) Jason Gunthorpe
2024-05-17 19:06   ` Jason Gunthorpe
2024-05-18  6:28   ` Christophe Leroy
2024-05-18  6:28     ` Christophe Leroy
2024-05-23 19:40 ` Peter Xu
2024-05-23 19:40   ` Peter Xu
2024-05-24  4:46   ` Michael Ellerman
2024-05-24  4:46     ` Michael Ellerman
2024-05-27 14:14     ` Peter Xu
2024-05-27 14:14       ` Peter Xu
2024-05-24  6:31   ` Oscar Salvador
2024-05-24  6:31     ` Oscar Salvador

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=ZlFvFk6QmyD-ieS5@localhost.localdomain \
    --to=osalvador@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jgg@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=peterx@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.