* [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS
@ 2016-04-21 3:37 Michael Ellerman
2016-04-21 4:15 ` Balbir Singh
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Michael Ellerman @ 2016-04-21 3:37 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, aneesh.kumar, linux-mm
Testing done by Paul Mackerras has shown that with a modern compiler
there is no negative effect on code generation from enabling
STRICT_MM_TYPECHECKS.
So remove the option, and always use the strict type definitions.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/Kconfig.debug | 8 ------
arch/powerpc/include/asm/pgtable-types.h | 46 --------------------------------
2 files changed, 54 deletions(-)
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 638f9ce740f5..d3fcf7e64e3a 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -19,14 +19,6 @@ config PPC_WERROR
depends on !PPC_DISABLE_WERROR
default y
-config STRICT_MM_TYPECHECKS
- bool "Do extra type checking on mm types"
- default n
- help
- This option turns on extra type checking for some mm related types.
-
- If you don't know what this means, say N.
-
config PRINT_STACK_DEPTH
int "Stack depth to print" if DEBUG_KERNEL
default 64
diff --git a/arch/powerpc/include/asm/pgtable-types.h b/arch/powerpc/include/asm/pgtable-types.h
index 43140f8b0592..1464e74178d8 100644
--- a/arch/powerpc/include/asm/pgtable-types.h
+++ b/arch/powerpc/include/asm/pgtable-types.h
@@ -1,9 +1,6 @@
#ifndef _ASM_POWERPC_PGTABLE_TYPES_H
#define _ASM_POWERPC_PGTABLE_TYPES_H
-#ifdef CONFIG_STRICT_MM_TYPECHECKS
-/* These are used to make use of C type-checking. */
-
/* PTE level */
typedef struct { pte_basic_t pte; } pte_t;
#define __pte(x) ((pte_t) { (x) })
@@ -48,49 +45,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
#define pgprot_val(x) ((x).pgprot)
#define __pgprot(x) ((pgprot_t) { (x) })
-#else
-
-/*
- * .. while these make it easier on the compiler
- */
-
-typedef pte_basic_t pte_t;
-#define __pte(x) (x)
-static inline pte_basic_t pte_val(pte_t pte)
-{
- return pte;
-}
-
-#ifdef CONFIG_PPC64
-typedef unsigned long pmd_t;
-#define __pmd(x) (x)
-static inline unsigned long pmd_val(pmd_t pmd)
-{
- return pmd;
-}
-
-#if defined(CONFIG_PPC_BOOK3S_64) || !defined(CONFIG_PPC_64K_PAGES)
-typedef unsigned long pud_t;
-#define __pud(x) (x)
-static inline unsigned long pud_val(pud_t pud)
-{
- return pud;
-}
-#endif /* CONFIG_PPC_BOOK3S_64 || !CONFIG_PPC_64K_PAGES */
-#endif /* CONFIG_PPC64 */
-
-typedef unsigned long pgd_t;
-#define __pgd(x) (x)
-static inline unsigned long pgd_val(pgd_t pgd)
-{
- return pgd;
-}
-
-typedef unsigned long pgprot_t;
-#define pgprot_val(x) (x)
-#define __pgprot(x) (x)
-
-#endif /* CONFIG_STRICT_MM_TYPECHECKS */
/*
* With hash config 64k pages additionally define a bigger "real PTE" type that
* gathers the "second half" part of the PTE for pseudo 64k pages
--
2.5.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS
2016-04-21 3:37 [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS Michael Ellerman
@ 2016-04-21 4:15 ` Balbir Singh
2016-04-21 6:36 ` Michael Ellerman
2016-04-21 9:56 ` Arnd Bergmann
2016-04-28 5:13 ` Paul Mackerras
2 siblings, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2016-04-21 4:15 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: Paul Mackerras, aneesh.kumar, linux-mm
On 21/04/16 13:37, Michael Ellerman wrote:
> Testing done by Paul Mackerras has shown that with a modern compiler
> there is no negative effect on code generation from enabling
> STRICT_MM_TYPECHECKS.
>
> So remove the option, and always use the strict type definitions.
>
Should we wait for Aneesh's patches before merging this in. I like the reduction
in the definition of page level metadata so for that
Acked-by: Balbir Singh <bsingharora@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS
2016-04-21 4:15 ` Balbir Singh
@ 2016-04-21 6:36 ` Michael Ellerman
0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2016-04-21 6:36 UTC (permalink / raw)
To: Balbir Singh, linuxppc-dev; +Cc: Paul Mackerras, aneesh.kumar, linux-mm
On Thu, 2016-04-21 at 14:15 +1000, Balbir Singh wrote:
>
> On 21/04/16 13:37, Michael Ellerman wrote:
> > Testing done by Paul Mackerras has shown that with a modern compiler
> > there is no negative effect on code generation from enabling
> > STRICT_MM_TYPECHECKS.
> >
> > So remove the option, and always use the strict type definitions.
> >
>
> Should we wait for Aneesh's patches before merging this in.
Preferably not.
I've already rebased his patches on top of this, it's trivial, it's just
removing code.
It also makes some things we might want to do as part of his series easier
(like adding a raw accessor to get the __be64 pmd/pte val).
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS
2016-04-21 3:37 [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS Michael Ellerman
2016-04-21 4:15 ` Balbir Singh
@ 2016-04-21 9:56 ` Arnd Bergmann
2016-04-28 5:27 ` Michael Ellerman
2016-04-28 5:13 ` Paul Mackerras
2 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2016-04-21 9:56 UTC (permalink / raw)
To: linuxppc-dev
Cc: Michael Ellerman, linuxppc-dev, linux-mm, Paul Mackerras,
aneesh.kumar
On Thursday 21 April 2016 13:37:59 Michael Ellerman wrote:
> Testing done by Paul Mackerras has shown that with a modern compiler
> there is no negative effect on code generation from enabling
> STRICT_MM_TYPECHECKS.
>
> So remove the option, and always use the strict type definitions.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
I recently ran into the same thing on ARM and have checked the history
on the symbol. It seems that some architectures cannot pass structures
in registers as function arguments, but powerpc can, so it was never
needed in the first place.
Arnd
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS
2016-04-21 3:37 [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS Michael Ellerman
2016-04-21 4:15 ` Balbir Singh
2016-04-21 9:56 ` Arnd Bergmann
@ 2016-04-28 5:13 ` Paul Mackerras
2 siblings, 0 replies; 6+ messages in thread
From: Paul Mackerras @ 2016-04-28 5:13 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, aneesh.kumar, linux-mm
On Thu, Apr 21, 2016 at 01:37:59PM +1000, Michael Ellerman wrote:
> Testing done by Paul Mackerras has shown that with a modern compiler
> there is no negative effect on code generation from enabling
> STRICT_MM_TYPECHECKS.
>
> So remove the option, and always use the strict type definitions.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Paul Mackerras <paulus@ozlabs.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS
2016-04-21 9:56 ` Arnd Bergmann
@ 2016-04-28 5:27 ` Michael Ellerman
0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2016-04-28 5:27 UTC (permalink / raw)
To: Arnd Bergmann, linuxppc-dev
Cc: linuxppc-dev, linux-mm, Paul Mackerras, aneesh.kumar
On Thu, 2016-04-21 at 11:56 +0200, Arnd Bergmann wrote:
> On Thursday 21 April 2016 13:37:59 Michael Ellerman wrote:
> > Testing done by Paul Mackerras has shown that with a modern compiler
> > there is no negative effect on code generation from enabling
> > STRICT_MM_TYPECHECKS.
> >
> > So remove the option, and always use the strict type definitions.
> >
> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> >
>
> I recently ran into the same thing on ARM and have checked the history
> on the symbol. It seems that some architectures cannot pass structures
> in registers as function arguments, but powerpc can, so it was never
> needed in the first place.
Thanks Arnd.
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-04-28 5:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21 3:37 [PATCH] powerpc/mm: Always use STRICT_MM_TYPECHECKS Michael Ellerman
2016-04-21 4:15 ` Balbir Singh
2016-04-21 6:36 ` Michael Ellerman
2016-04-21 9:56 ` Arnd Bergmann
2016-04-28 5:27 ` Michael Ellerman
2016-04-28 5:13 ` Paul Mackerras
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).