linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Rohan McLure <rmclure@linux.ibm.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 1/3] powerpc: mm: move pud_pfn stub to common pgtable header
Date: Mon, 12 Sep 2022 05:30:49 +0000	[thread overview]
Message-ID: <d2b304f2-6d6b-fdcb-c852-24bcc11084dc@csgroup.eu> (raw)
In-Reply-To: <20220912014703.185471-1-rmclure@linux.ibm.com>



Le 12/09/2022 à 03:47, Rohan McLure a écrit :
> The pud_pfn inline call is only referenced on 64-bit Book3S systems,
> but its invocations are gated by pud_devmap() invocations, rendering the
> body of this function as dead code.
> 
> As such, this function is readily exportable to all platforms in the
> instance where kernel features depend on it at least being defined.

I don't understand. If this function is dead code, why move it to a 
larger scope ? Shouldn't you remove it instead ? Or are you planning to 
re-use it on other platforms ? In that case say it.

> 
> Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
> ---
>   arch/powerpc/include/asm/book3s/64/pgtable.h | 10 ----------
>   arch/powerpc/include/asm/pgtable.h           | 12 ++++++++++++
>   2 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index 392ff48f77df..8874f2a3661d 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -1411,16 +1411,6 @@ static inline int pgd_devmap(pgd_t pgd)
>   }
>   #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>   
> -static inline int pud_pfn(pud_t pud)
> -{
> -	/*
> -	 * Currently all calls to pud_pfn() are gated around a pud_devmap()
> -	 * check so this should never be used. If it grows another user we
> -	 * want to know about it.
> -	 */
> -	BUILD_BUG();
> -	return 0;
> -}
>   #define __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
>   pte_t ptep_modify_prot_start(struct vm_area_struct *, unsigned long, pte_t *);
>   void ptep_modify_prot_commit(struct vm_area_struct *, unsigned long,
> diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
> index 33f4bf8d22b0..522145b16a07 100644
> --- a/arch/powerpc/include/asm/pgtable.h
> +++ b/arch/powerpc/include/asm/pgtable.h
> @@ -158,6 +158,18 @@ struct seq_file;
>   void arch_report_meminfo(struct seq_file *m);
>   #endif /* CONFIG_PPC64 */
>   
> +#define pud_pfn pud_pfn

Why do you need to add that define ?

> +static inline int pud_pfn(pud_t pud)
> +{
> +	/*
> +	 * Currently all calls to pud_pfn() are gated around a pud_devmap()
> +	 * check so this should never be used. If it grows another user we
> +	 * want to know about it.
> +	 */
> +	BUILD_BUG();
> +	return 0;
> +}
> +
>   #endif /* __ASSEMBLY__ */
>   
>   #endif /* _ASM_POWERPC_PGTABLE_H */

      parent reply	other threads:[~2022-09-12  5:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  1:47 [PATCH 1/3] powerpc: mm: move pud_pfn stub to common pgtable header Rohan McLure
2022-09-12  1:47 ` [PATCH 2/3] powerpc: mm: add p{te,md,ud}_user_accessible_page helpers Rohan McLure
2022-09-12  5:40   ` Christophe Leroy
2022-09-12  8:38     ` Rohan McLure
2022-09-13 14:12   ` Christophe Leroy
2022-09-12  1:47 ` [PATCH 3/3] powerpc: mm: support page table check Rohan McLure
2022-09-12  6:11   ` Christophe Leroy
2022-09-13  1:21     ` Rohan McLure
2022-09-13 14:36       ` Christophe Leroy
2022-09-12  1:51 ` [PATCH 1/3] powerpc: mm: move pud_pfn stub to common pgtable header Rohan McLure
2022-09-12  5:30 ` Christophe Leroy [this message]

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=d2b304f2-6d6b-fdcb-c852-24bcc11084dc@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=rmclure@linux.ibm.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 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).