Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2021-04-15 Thread Christophe Leroy




Le 15/04/2021 à 12:08, Christophe Leroy a écrit :



Le 15/04/2021 à 12:07, Christophe Leroy a écrit :



Le 15/04/2021 à 11:58, Stephen Rothwell a écrit :

Hi all,

On Thu, 15 Apr 2021 19:44:17 +1000 Stephen Rothwell  
wrote:


Today's linux-next merge of the akpm-current tree got a conflict in:

   arch/powerpc/kernel/module.c

between commit:

   2ec13df16704 ("powerpc/modules: Load modules closer to kernel text")

from the powerpc tree and commit:

   4930ba789f8d ("powerpc/64s/radix: enable huge vmalloc mappings")

from the akpm-current tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/kernel/module.c
index fab84024650c,cdb2d88c54e7..
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@@ -88,29 -88,26 +89,42 @@@ int module_finalize(const Elf_Ehdr *hdr
   return 0;
   }
- #ifdef MODULES_VADDR
  -void *module_alloc(unsigned long size)
  +static __always_inline void *
  +__module_alloc(unsigned long size, unsigned long start, unsigned long end)
   {
  -    unsigned long start = VMALLOC_START;
  -    unsigned long end = VMALLOC_END;
  -
  -#ifdef MODULES_VADDR
  -    BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
  -    start = MODULES_VADDR;
  -    end = MODULES_END;
  -#endif
  -
+ /*
+  * Don't do huge page allocations for modules yet until more testing
+  * is done. STRICT_MODULE_RWX may require extra work to support this
+  * too.
+  */
+
   return __vmalloc_node_range(size, 1, start, end, GFP_KERNEL,
- PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, NUMA_NO_NODE,
+ PAGE_KERNEL_EXEC,
+ VM_NO_HUGE_VMAP | VM_FLUSH_RESET_PERMS,
+ NUMA_NO_NODE,
   __builtin_return_address(0));
   }
  +
++
  +void *module_alloc(unsigned long size)
  +{
++    unsigned long start = VMALLOC_START;
++    unsigned long end = VMALLOC_END;
  +    unsigned long limit = (unsigned long)_etext - SZ_32M;
  +    void *ptr = NULL;
  +
++#ifdef MODULES_VADDR
  +    BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
++    start = MODULES_VADDR;
++    end = MODULES_END;


The #endif should be here.



  +
  +    /* First try within 32M limit from _etext to avoid branch trampolines */
  +    if (MODULES_VADDR < PAGE_OFFSET && MODULES_END > limit)


Should also use start and end here instead of MODULES_VADDR  and MODULES_END



The cleanest however should be to define MODULES_VADDR and MODULES_END all the time with a fallback 
to VMALLOC_START/VMALLOC_END, to avoid the #ifdef.


The #ifdef was OK when we wanted to define modules_alloc() only when module area was different from 
vmalloc area, but now that we want modules_alloc() at all time, MODULES_VADDR and MODULES_END should 
be defined all the time.






- ptr = __module_alloc(size, limit, MODULES_END);
++    ptr = __module_alloc(size, limit, end);
  +
  +    if (!ptr)
- ptr = __module_alloc(size, MODULES_VADDR, MODULES_END);
++#endif
++    ptr = __module_alloc(size, start, end);
  +
  +    return ptr;
  +}
- #endif


Unfortunately, it also needs this:


Before the #endif is too far.



From: Stephen Rothwell 
Date: Thu, 15 Apr 2021 19:53:58 +1000
Subject: [PATCH] merge fix up for powerpc merge fix

Signed-off-by: Stephen Rothwell 
---
  arch/powerpc/kernel/module.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index d8ab1ad2eb05..c060f99afd4d 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -110,7 +110,9 @@ void *module_alloc(unsigned long size)
  {
  unsigned long start = VMALLOC_START;
  unsigned long end = VMALLOC_END;
+#ifdef MODULES_VADDR
  unsigned long limit = (unsigned long)_etext - SZ_32M;
+#endif
  void *ptr = NULL;
  #ifdef MODULES_VADDR



Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2021-04-15 Thread Christophe Leroy




Le 15/04/2021 à 12:07, Christophe Leroy a écrit :



Le 15/04/2021 à 11:58, Stephen Rothwell a écrit :

Hi all,

On Thu, 15 Apr 2021 19:44:17 +1000 Stephen Rothwell  
wrote:


Today's linux-next merge of the akpm-current tree got a conflict in:

   arch/powerpc/kernel/module.c

between commit:

   2ec13df16704 ("powerpc/modules: Load modules closer to kernel text")

from the powerpc tree and commit:

   4930ba789f8d ("powerpc/64s/radix: enable huge vmalloc mappings")

from the akpm-current tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/kernel/module.c
index fab84024650c,cdb2d88c54e7..
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@@ -88,29 -88,26 +89,42 @@@ int module_finalize(const Elf_Ehdr *hdr
   return 0;
   }
- #ifdef MODULES_VADDR
  -void *module_alloc(unsigned long size)
  +static __always_inline void *
  +__module_alloc(unsigned long size, unsigned long start, unsigned long end)
   {
  -    unsigned long start = VMALLOC_START;
  -    unsigned long end = VMALLOC_END;
  -
  -#ifdef MODULES_VADDR
  -    BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
  -    start = MODULES_VADDR;
  -    end = MODULES_END;
  -#endif
  -
+ /*
+  * Don't do huge page allocations for modules yet until more testing
+  * is done. STRICT_MODULE_RWX may require extra work to support this
+  * too.
+  */
+
   return __vmalloc_node_range(size, 1, start, end, GFP_KERNEL,
- PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, NUMA_NO_NODE,
+ PAGE_KERNEL_EXEC,
+ VM_NO_HUGE_VMAP | VM_FLUSH_RESET_PERMS,
+ NUMA_NO_NODE,
   __builtin_return_address(0));
   }
  +
++
  +void *module_alloc(unsigned long size)
  +{
++    unsigned long start = VMALLOC_START;
++    unsigned long end = VMALLOC_END;
  +    unsigned long limit = (unsigned long)_etext - SZ_32M;
  +    void *ptr = NULL;
  +
++#ifdef MODULES_VADDR
  +    BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
++    start = MODULES_VADDR;
++    end = MODULES_END;


The #endif should be here.



  +
  +    /* First try within 32M limit from _etext to avoid branch trampolines */
  +    if (MODULES_VADDR < PAGE_OFFSET && MODULES_END > limit)


Should also use start and end here instead of MODULES_VADDR  and MODULES_END


- ptr = __module_alloc(size, limit, MODULES_END);
++    ptr = __module_alloc(size, limit, end);
  +
  +    if (!ptr)
- ptr = __module_alloc(size, MODULES_VADDR, MODULES_END);
++#endif
++    ptr = __module_alloc(size, start, end);
  +
  +    return ptr;
  +}
- #endif


Unfortunately, it also needs this:


Before the #endif is too far.



From: Stephen Rothwell 
Date: Thu, 15 Apr 2021 19:53:58 +1000
Subject: [PATCH] merge fix up for powerpc merge fix

Signed-off-by: Stephen Rothwell 
---
  arch/powerpc/kernel/module.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index d8ab1ad2eb05..c060f99afd4d 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -110,7 +110,9 @@ void *module_alloc(unsigned long size)
  {
  unsigned long start = VMALLOC_START;
  unsigned long end = VMALLOC_END;
+#ifdef MODULES_VADDR
  unsigned long limit = (unsigned long)_etext - SZ_32M;
+#endif
  void *ptr = NULL;
  #ifdef MODULES_VADDR



Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2021-04-15 Thread Christophe Leroy




Le 15/04/2021 à 11:58, Stephen Rothwell a écrit :

Hi all,

On Thu, 15 Apr 2021 19:44:17 +1000 Stephen Rothwell  
wrote:


Today's linux-next merge of the akpm-current tree got a conflict in:

   arch/powerpc/kernel/module.c

between commit:

   2ec13df16704 ("powerpc/modules: Load modules closer to kernel text")

from the powerpc tree and commit:

   4930ba789f8d ("powerpc/64s/radix: enable huge vmalloc mappings")

from the akpm-current tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/kernel/module.c
index fab84024650c,cdb2d88c54e7..
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@@ -88,29 -88,26 +89,42 @@@ int module_finalize(const Elf_Ehdr *hdr
return 0;
   }
   
- #ifdef MODULES_VADDR

  -void *module_alloc(unsigned long size)
  +static __always_inline void *
  +__module_alloc(unsigned long size, unsigned long start, unsigned long end)
   {
  - unsigned long start = VMALLOC_START;
  - unsigned long end = VMALLOC_END;
  -
  -#ifdef MODULES_VADDR
  - BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
  - start = MODULES_VADDR;
  - end = MODULES_END;
  -#endif
  -
+   /*
+* Don't do huge page allocations for modules yet until more testing
+* is done. STRICT_MODULE_RWX may require extra work to support this
+* too.
+*/
+
return __vmalloc_node_range(size, 1, start, end, GFP_KERNEL,
-   PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, 
NUMA_NO_NODE,
+   PAGE_KERNEL_EXEC,
+   VM_NO_HUGE_VMAP | VM_FLUSH_RESET_PERMS,
+   NUMA_NO_NODE,
__builtin_return_address(0));
   }
  +
++
  +void *module_alloc(unsigned long size)
  +{
++  unsigned long start = VMALLOC_START;
++  unsigned long end = VMALLOC_END;
  + unsigned long limit = (unsigned long)_etext - SZ_32M;
  + void *ptr = NULL;
  +
++#ifdef MODULES_VADDR
  + BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
++  start = MODULES_VADDR;
++  end = MODULES_END;


The #endif should be here.



  +
  + /* First try within 32M limit from _etext to avoid branch trampolines */
  + if (MODULES_VADDR < PAGE_OFFSET && MODULES_END > limit)
-   ptr = __module_alloc(size, limit, MODULES_END);
++  ptr = __module_alloc(size, limit, end);
  +
  + if (!ptr)
-   ptr = __module_alloc(size, MODULES_VADDR, MODULES_END);
++#endif
++  ptr = __module_alloc(size, start, end);
  +
  + return ptr;
  +}
- #endif


Unfortunately, it also needs this:


Before the #endif is too far.



From: Stephen Rothwell 
Date: Thu, 15 Apr 2021 19:53:58 +1000
Subject: [PATCH] merge fix up for powerpc merge fix

Signed-off-by: Stephen Rothwell 
---
  arch/powerpc/kernel/module.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index d8ab1ad2eb05..c060f99afd4d 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -110,7 +110,9 @@ void *module_alloc(unsigned long size)
  {
unsigned long start = VMALLOC_START;
unsigned long end = VMALLOC_END;
+#ifdef MODULES_VADDR
unsigned long limit = (unsigned long)_etext - SZ_32M;
+#endif
void *ptr = NULL;
  
  #ifdef MODULES_VADDR




Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2021-04-15 Thread Stephen Rothwell
Hi all,

On Thu, 15 Apr 2021 19:44:17 +1000 Stephen Rothwell  
wrote:
> 
> Today's linux-next merge of the akpm-current tree got a conflict in:
> 
>   arch/powerpc/kernel/module.c
> 
> between commit:
> 
>   2ec13df16704 ("powerpc/modules: Load modules closer to kernel text")
> 
> from the powerpc tree and commit:
> 
>   4930ba789f8d ("powerpc/64s/radix: enable huge vmalloc mappings")
> 
> from the akpm-current tree.
> 
> I fixed it up (I think - see below) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc arch/powerpc/kernel/module.c
> index fab84024650c,cdb2d88c54e7..
> --- a/arch/powerpc/kernel/module.c
> +++ b/arch/powerpc/kernel/module.c
> @@@ -88,29 -88,26 +89,42 @@@ int module_finalize(const Elf_Ehdr *hdr
>   return 0;
>   }
>   
> - #ifdef MODULES_VADDR
>  -void *module_alloc(unsigned long size)
>  +static __always_inline void *
>  +__module_alloc(unsigned long size, unsigned long start, unsigned long end)
>   {
>  -unsigned long start = VMALLOC_START;
>  -unsigned long end = VMALLOC_END;
>  -
>  -#ifdef MODULES_VADDR
>  -BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
>  -start = MODULES_VADDR;
>  -end = MODULES_END;
>  -#endif
>  -
> + /*
> +  * Don't do huge page allocations for modules yet until more testing
> +  * is done. STRICT_MODULE_RWX may require extra work to support this
> +  * too.
> +  */
> + 
>   return __vmalloc_node_range(size, 1, start, end, GFP_KERNEL,
> - PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, 
> NUMA_NO_NODE,
> + PAGE_KERNEL_EXEC,
> + VM_NO_HUGE_VMAP | VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE,
>   __builtin_return_address(0));
>   }
>  +
> ++
>  +void *module_alloc(unsigned long size)
>  +{
> ++unsigned long start = VMALLOC_START;
> ++unsigned long end = VMALLOC_END;
>  +unsigned long limit = (unsigned long)_etext - SZ_32M;
>  +void *ptr = NULL;
>  +
> ++#ifdef MODULES_VADDR
>  +BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
> ++start = MODULES_VADDR;
> ++end = MODULES_END;
>  +
>  +/* First try within 32M limit from _etext to avoid branch trampolines */
>  +if (MODULES_VADDR < PAGE_OFFSET && MODULES_END > limit)
> - ptr = __module_alloc(size, limit, MODULES_END);
> ++ptr = __module_alloc(size, limit, end);
>  +
>  +if (!ptr)
> - ptr = __module_alloc(size, MODULES_VADDR, MODULES_END);
> ++#endif
> ++ptr = __module_alloc(size, start, end);
>  +
>  +return ptr;
>  +}
> - #endif

Unfortunately, it also needs this:

From: Stephen Rothwell 
Date: Thu, 15 Apr 2021 19:53:58 +1000
Subject: [PATCH] merge fix up for powerpc merge fix

Signed-off-by: Stephen Rothwell 
---
 arch/powerpc/kernel/module.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index d8ab1ad2eb05..c060f99afd4d 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -110,7 +110,9 @@ void *module_alloc(unsigned long size)
 {
unsigned long start = VMALLOC_START;
unsigned long end = VMALLOC_END;
+#ifdef MODULES_VADDR
unsigned long limit = (unsigned long)_etext - SZ_32M;
+#endif
void *ptr = NULL;
 
 #ifdef MODULES_VADDR
-- 
2.30.2

-- 
Cheers,
Stephen Rothwell


pgpwiUNsqMujV.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2021-04-15 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/kernel/module.c

between commit:

  2ec13df16704 ("powerpc/modules: Load modules closer to kernel text")

from the powerpc tree and commit:

  4930ba789f8d ("powerpc/64s/radix: enable huge vmalloc mappings")

from the akpm-current tree.

I fixed it up (I think - see below) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/kernel/module.c
index fab84024650c,cdb2d88c54e7..
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@@ -88,29 -88,26 +89,42 @@@ int module_finalize(const Elf_Ehdr *hdr
return 0;
  }
  
- #ifdef MODULES_VADDR
 -void *module_alloc(unsigned long size)
 +static __always_inline void *
 +__module_alloc(unsigned long size, unsigned long start, unsigned long end)
  {
 -  unsigned long start = VMALLOC_START;
 -  unsigned long end = VMALLOC_END;
 -
 -#ifdef MODULES_VADDR
 -  BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
 -  start = MODULES_VADDR;
 -  end = MODULES_END;
 -#endif
 -
+   /*
+* Don't do huge page allocations for modules yet until more testing
+* is done. STRICT_MODULE_RWX may require extra work to support this
+* too.
+*/
+ 
return __vmalloc_node_range(size, 1, start, end, GFP_KERNEL,
-   PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS, 
NUMA_NO_NODE,
+   PAGE_KERNEL_EXEC,
+   VM_NO_HUGE_VMAP | VM_FLUSH_RESET_PERMS,
+   NUMA_NO_NODE,
__builtin_return_address(0));
  }
 +
++
 +void *module_alloc(unsigned long size)
 +{
++  unsigned long start = VMALLOC_START;
++  unsigned long end = VMALLOC_END;
 +  unsigned long limit = (unsigned long)_etext - SZ_32M;
 +  void *ptr = NULL;
 +
++#ifdef MODULES_VADDR
 +  BUILD_BUG_ON(TASK_SIZE > MODULES_VADDR);
++  start = MODULES_VADDR;
++  end = MODULES_END;
 +
 +  /* First try within 32M limit from _etext to avoid branch trampolines */
 +  if (MODULES_VADDR < PAGE_OFFSET && MODULES_END > limit)
-   ptr = __module_alloc(size, limit, MODULES_END);
++  ptr = __module_alloc(size, limit, end);
 +
 +  if (!ptr)
-   ptr = __module_alloc(size, MODULES_VADDR, MODULES_END);
++#endif
++  ptr = __module_alloc(size, start, end);
 +
 +  return ptr;
 +}
- #endif


pgpNvkByg9NJG.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2020-12-16 Thread Stephen Rothwell
Hi all,

On Tue, 8 Dec 2020 20:40:16 +1100 Stephen Rothwell  
wrote:
>
> Today's linux-next merge of the akpm-current tree got conflicts in:
> 
>   drivers/misc/lkdtm/Makefile
>   drivers/misc/lkdtm/lkdtm.h
>   tools/testing/selftests/lkdtm/tests.txt
> 
> between commit:
> 
>   3ba150fb2120 ("lkdtm/powerpc: Add SLB multihit test")
> 
> from the powerpc tree and commit:
> 
>   014a486edd8a ("drivers/misc/lkdtm: add new file in LKDTM to test fortified 
> strscpy")
> 
> from the akpm-current tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> 
> diff --cc drivers/misc/lkdtm/Makefile
> index 5a92c74eca92,d898f7b22045..
> --- a/drivers/misc/lkdtm/Makefile
> +++ b/drivers/misc/lkdtm/Makefile
> @@@ -10,7 -10,7 +10,8 @@@ lkdtm-$(CONFIG_LKDTM)   += rodata_objcop
>   lkdtm-$(CONFIG_LKDTM)   += usercopy.o
>   lkdtm-$(CONFIG_LKDTM)   += stackleak.o
>   lkdtm-$(CONFIG_LKDTM)   += cfi.o
> + lkdtm-$(CONFIG_LKDTM)   += fortify.o
>  +lkdtm-$(CONFIG_PPC_BOOK3S_64)   += powerpc.o
>   
>   KASAN_SANITIZE_stackleak.o  := n
>   KCOV_INSTRUMENT_rodata.o:= n
> diff --cc drivers/misc/lkdtm/lkdtm.h
> index 79ec05c18dd1,6aa6d6a1a839..
> --- a/drivers/misc/lkdtm/lkdtm.h
> +++ b/drivers/misc/lkdtm/lkdtm.h
> @@@ -102,7 -104,7 +104,10 @@@ void lkdtm_STACKLEAK_ERASING(void)
>   /* cfi.c */
>   void lkdtm_CFI_FORWARD_PROTO(void);
>   
> + /* fortify.c */
> + void lkdtm_FORTIFIED_STRSCPY(void);
> + 
>  +/* powerpc.c */
>  +void lkdtm_PPC_SLB_MULTIHIT(void);
>  +
>   #endif
> diff --cc tools/testing/selftests/lkdtm/tests.txt
> index 18e4599863c0,92ba4cc41314..
> --- a/tools/testing/selftests/lkdtm/tests.txt
> +++ b/tools/testing/selftests/lkdtm/tests.txt
> @@@ -68,4 -68,4 +68,5 @@@ USERCOPY_STACK_BEYON
>   USERCOPY_KERNEL
>   STACKLEAK_ERASING OK: the rest of the thread stack is properly erased
>   CFI_FORWARD_PROTO
> + FORTIFIED_STRSCPY
>  +PPC_SLB_MULTIHIT Recovered

These conflicts are now between the powerpc tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell


pgpv2X_m6ussY.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2020-12-08 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got conflicts in:

  drivers/misc/lkdtm/Makefile
  drivers/misc/lkdtm/lkdtm.h
  tools/testing/selftests/lkdtm/tests.txt

between commit:

  3ba150fb2120 ("lkdtm/powerpc: Add SLB multihit test")

from the powerpc tree and commit:

  014a486edd8a ("drivers/misc/lkdtm: add new file in LKDTM to test fortified 
strscpy")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/misc/lkdtm/Makefile
index 5a92c74eca92,d898f7b22045..
--- a/drivers/misc/lkdtm/Makefile
+++ b/drivers/misc/lkdtm/Makefile
@@@ -10,7 -10,7 +10,8 @@@ lkdtm-$(CONFIG_LKDTM) += rodata_objcop
  lkdtm-$(CONFIG_LKDTM) += usercopy.o
  lkdtm-$(CONFIG_LKDTM) += stackleak.o
  lkdtm-$(CONFIG_LKDTM) += cfi.o
+ lkdtm-$(CONFIG_LKDTM) += fortify.o
 +lkdtm-$(CONFIG_PPC_BOOK3S_64) += powerpc.o
  
  KASAN_SANITIZE_stackleak.o:= n
  KCOV_INSTRUMENT_rodata.o  := n
diff --cc drivers/misc/lkdtm/lkdtm.h
index 79ec05c18dd1,6aa6d6a1a839..
--- a/drivers/misc/lkdtm/lkdtm.h
+++ b/drivers/misc/lkdtm/lkdtm.h
@@@ -102,7 -104,7 +104,10 @@@ void lkdtm_STACKLEAK_ERASING(void)
  /* cfi.c */
  void lkdtm_CFI_FORWARD_PROTO(void);
  
+ /* fortify.c */
+ void lkdtm_FORTIFIED_STRSCPY(void);
+ 
 +/* powerpc.c */
 +void lkdtm_PPC_SLB_MULTIHIT(void);
 +
  #endif
diff --cc tools/testing/selftests/lkdtm/tests.txt
index 18e4599863c0,92ba4cc41314..
--- a/tools/testing/selftests/lkdtm/tests.txt
+++ b/tools/testing/selftests/lkdtm/tests.txt
@@@ -68,4 -68,4 +68,5 @@@ USERCOPY_STACK_BEYON
  USERCOPY_KERNEL
  STACKLEAK_ERASING OK: the rest of the thread stack is properly erased
  CFI_FORWARD_PROTO
+ FORTIFIED_STRSCPY
 +PPC_SLB_MULTIHIT Recovered


pgpJyyZrxO1th.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2020-09-17 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/mm/kasan/kasan_init_32.c

between commit:

  4c42dc5c69a8 ("powerpc/kasan: Fix CONFIG_KASAN_VMALLOC for 8xx")

from the powerpc tree and commit:

  76713c119a9d ("arch, drivers: replace for_each_membock() with 
for_each_mem_range()")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/mm/kasan/kasan_init_32.c
index 929716ea21e9,26fda3203320..
--- a/arch/powerpc/mm/kasan/kasan_init_32.c
+++ b/arch/powerpc/mm/kasan/kasan_init_32.c
@@@ -137,12 -138,12 +137,12 @@@ void __init kasan_mmu_init(void
  
  void __init kasan_init(void)
  {
-   struct memblock_region *reg;
+   phys_addr_t base, end;
 +  int ret;
+   u64 i;
  
-   for_each_memblock(memory, reg) {
-   phys_addr_t base = reg->base;
-   phys_addr_t top = min(base + reg->size, total_lowmem);
+   for_each_mem_range(i, , ) {
+   phys_addr_t top = min(end, total_lowmem);
 -  int ret;
  
if (base >= top)
continue;


pgp4fJEWgQ7bY.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2020-06-03 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/mm/ptdump/ptdump.c

between commit:

  6b789a26d7da ("powerpc/ptdump: Handle hugepd at PGD level")

from the powerpc tree and patch:

  "powerpc: add support for folded p4d page tables"

from the akpm-current tree.

Thanks to Michael Ellerman for an example resolution.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/mm/ptdump/ptdump.c
index 5fc880e30175,507cb9793b26..
--- a/arch/powerpc/mm/ptdump/ptdump.c
+++ b/arch/powerpc/mm/ptdump/ptdump.c
@@@ -333,13 -304,13 +333,15 @@@ static void walk_pagetables(struct pg_s
 * the hash pagetable.
 */
for (i = pgd_index(addr); i < PTRS_PER_PGD; i++, pgd++, addr += 
PGDIR_SIZE) {
-   if (pgd_none(*pgd) || pgd_is_leaf(*pgd))
-   note_page(st, addr, 1, pgd_val(*pgd), PGDIR_SIZE);
-   else if (is_hugepd(__hugepd(pgd_val(*pgd
-   walk_hugepd(st, (hugepd_t *)pgd, addr, PGDIR_SHIFT, 1);
+   p4d_t *p4d = p4d_offset(pgd, 0);
+ 
 -  if (!p4d_none(*p4d) && !p4d_is_leaf(*p4d))
++  if (p4d_none(*p4d) || p4d_is_leaf(*p4d))
++  note_page(st, addr, 1, p4d_val(*p4d), PGDIR_SIZE);
++  else if (is_hugepd(__hugepd(p4d_val(*p4d
++  walk_hugepd(st, (hugepd_t *)p4d, addr, PGDIR_SHIFT, 1);
 +  else
-   /* pgd exists */
-   walk_pud(st, pgd, addr);
+   /* p4d exists */
+   walk_pud(st, p4d, addr);
 -  else
 -  note_page(st, addr, 1, p4d_val(*p4d));
}
  }
  


pgplAaSCH_vGR.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2019-07-08 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/include/asm/pgtable.h

between commit:

  d6eacedd1f0e ("powerpc/book3s: Use config independent helpers for page table 
walk")

from the powerpc tree and commit:

  be66a174b253 ("mm/nvdimm: add is_ioremap_addr and use that to check ioremap 
address")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/include/asm/pgtable.h
index bf7d771f342e,64145751b2fd..
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@@ -140,30 -140,20 +140,44 @@@ static inline void pte_frag_set(mm_cont
  }
  #endif
  
 +#ifndef pmd_is_leaf
 +#define pmd_is_leaf pmd_is_leaf
 +static inline bool pmd_is_leaf(pmd_t pmd)
 +{
 +  return false;
 +}
 +#endif
 +
 +#ifndef pud_is_leaf
 +#define pud_is_leaf pud_is_leaf
 +static inline bool pud_is_leaf(pud_t pud)
 +{
 +  return false;
 +}
 +#endif
 +
 +#ifndef pgd_is_leaf
 +#define pgd_is_leaf pgd_is_leaf
 +static inline bool pgd_is_leaf(pgd_t pgd)
 +{
 +  return false;
 +}
 +#endif
 +
+ #ifdef CONFIG_PPC64
+ #define is_ioremap_addr is_ioremap_addr
+ static inline bool is_ioremap_addr(const void *x)
+ {
+ #ifdef CONFIG_MMU
+   unsigned long addr = (unsigned long)x;
+ 
+   return addr >= IOREMAP_BASE && addr < IOREMAP_END;
+ #else
+   return false;
+ #endif
+ }
+ #endif /* CONFIG_PPC64 */
+ 
  #endif /* __ASSEMBLY__ */
  
  #endif /* _ASM_POWERPC_PGTABLE_H */


pgpS_8gwh7VKt.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2019-04-23 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/mm/mem.c

between commit:

  f172acbfae1a ("powerpc/mm: move warning from resize_hpt_for_hotplug()")
  26ad26718dfa ("powerpc/mm: Fix section mismatch warning")

from the powerpc tree and commit:

  fc6a586376ab ("mm, memory_hotplug: provide a more generic restrictions for 
memory hotplug")
  e8b6bc564e97 ("mm/memory_hotplug: make __remove_pages() and 
arch_remove_memory() never fail")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/mm/mem.c
index e12bec98366f,cc9425fb9056..
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@@ -109,8 -109,8 +109,8 @@@ int __weak remove_section_mapping(unsig
return -ENODEV;
  }
  
- int __ref arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap 
*altmap,
- bool want_memblock)
 -int __meminit arch_add_memory(int nid, u64 start, u64 size,
 -  struct mhp_restrictions *restrictions)
++int __ref arch_add_memory(int nid, u64 start, u64 size,
++struct mhp_restrictions *restrictions)
  {
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
@@@ -131,8 -131,8 +131,8 @@@
  }
  
  #ifdef CONFIG_MEMORY_HOTREMOVE
- int __ref arch_remove_memory(int nid, u64 start, u64 size,
-struct vmem_altmap *altmap)
 -void __meminit arch_remove_memory(int nid, u64 start, u64 size,
 -struct vmem_altmap *altmap)
++void __ref arch_remove_memory(int nid, u64 start, u64 size,
++struct vmem_altmap *altmap)
  {
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
@@@ -161,10 -160,7 +160,8 @@@
 */
vm_unmap_aliases();
  
 -  resize_hpt_for_hotplug(memblock_phys_mem_size());
 +  if (resize_hpt_for_hotplug(memblock_phys_mem_size()) == -ENOSPC)
 +  pr_warn("Hash collision while resizing HPT\n");
- 
-   return ret;
  }
  #endif
  #endif /* CONFIG_MEMORY_HOTPLUG */


pgpzu4LHIQRjm.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2019-02-24 Thread Stephen Rothwell
Hi all,

On Mon, 25 Feb 2019 17:42:48 +1100 Stephen Rothwell  
wrote:
>
> Today's linux-next merge of the akpm-current tree got a conflict in:

This was actually the akpm tree.

-- 
Cheers,
Stephen Rothwell


pgpPothP9uC2A.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2019-02-24 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/kernel/irq.c

between commit:

  c8e409a33cf8 ("powerpc/irq: use memblock functions returning virtual address")
and other patches in the powerpc tree

from the powerpc tree and patch:

  "powerpc: use memblock functions returning virtual address"

from the akpm-current tree.

This file looks the same after applying either of those patches, so I
just used the powerpc version of the file due to the other changes.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

The akpm patch now looks like this:

diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c 
b/arch/powerpc/kernel/dt_cpu_ftrs.c
index e49bd5efcfe6..28c076c771de 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -810,7 +810,6 @@ static int __init process_cpufeatures_node(unsigned long 
node,
int len;
 
f = _cpu_features[i];
-   memset(f, 0, sizeof(struct dt_cpu_feature));
 
f->node = node;
 
@@ -1005,7 +1004,7 @@ static int __init dt_cpu_ftrs_scan_callback(unsigned long 
node, const char
/* Count and allocate space for cpu features */
of_scan_flat_dt_subnodes(node, count_cpufeatures_subnodes,
_dt_cpu_features);
-   dt_cpu_features = __va(memblock_phys_alloc(sizeof(struct 
dt_cpu_feature) * nr_dt_cpu_features, PAGE_SIZE));
+   dt_cpu_features = memblock_alloc(sizeof(struct dt_cpu_feature) * 
nr_dt_cpu_features, PAGE_SIZE);
 
cpufeatures_setup_start(isa);
 
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 8c890c6557ed..e7382abee868 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -196,7 +196,11 @@ void __init allocate_paca_ptrs(void)
paca_nr_cpu_ids = nr_cpu_ids;
 
paca_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids;
-   paca_ptrs = __va(memblock_phys_alloc(paca_ptrs_size, SMP_CACHE_BYTES));
+   paca_ptrs = memblock_alloc_raw(paca_ptrs_size, SMP_CACHE_BYTES);
+   if (!paca_ptrs)
+   panic("Failed to allocate %d bytes for paca pointers\n",
+ paca_ptrs_size);
+
memset(paca_ptrs, 0x88, paca_ptrs_size);
 }
 
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index e97aaf201d67..c0ed4fa0b9d3 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -127,7 +127,10 @@ static void __init move_device_tree(void)
if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
!memblock_is_memory(start + size - 1) ||
overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
-   p = __va(memblock_phys_alloc(size, PAGE_SIZE));
+   p = memblock_alloc_raw(size, PAGE_SIZE);
+   if (!p)
+   panic("Failed to allocate %lu bytes to move device 
tree\n",
+ size);
memcpy(p, initial_boot_params, size);
initial_boot_params = p;
DBG("Moved device tree to 0x%px\n", p);

-- 
Cheers,
Stephen Rothwell


pgpCWzKOG0kMl.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm-current tree with the powerpc tree

2019-02-24 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/kernel/setup_64.c

between commits:

  c8e409a33cf8 ("powerpc/irq: use memblock functions returning virtual address")
  d608898abc74 ("powerpc: clean stack pointers naming")

from the powerpc tree and commit:

  82af77ee7503 ("powerpc: prefer memblock APIs returning virtual address")

from the akpm-current tree.

Commits 82af77ee7503 and c8e409a33cf8 overlap.

I fixed it up (I just used the powerpc tree version of this file) and
can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.



-- 
Cheers,
Stephen Rothwell


pgpoY876kcZke.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2018-12-06 Thread Joel Fernandes
On Thu, Dec 06, 2018 at 05:44:17PM +1100, Stephen Rothwell wrote:
> Hi Andrew,
> 
> Today's linux-next merge of the akpm-current tree got conflicts in:
> 
>   arch/powerpc/include/asm/book3s/32/pgalloc.h
>   arch/powerpc/include/asm/nohash/32/pgalloc.h
>   arch/powerpc/mm/pgtable-book3s64.c
> 
> between commits:
> 
>   a95d133c8643 ("powerpc/mm: Move pte_fragment_alloc() to a common location")
>   32ea4c149990 ("powerpc/mm: Extend pte_fragment functionality to PPC32")
> 
> from the powerpc tree and commit:
> 
>   913c2d755b39 ("mm: treewide: remove unused address argument from pte_alloc 
> functions")
> 
> from the akpm-current tree.
> 
> I fixed it up (see below, plus the extra merge fix patch) and can
> carry the fix as necessary. This is now fixed as far as linux-next is
> concerned, but any non trivial conflicts should be mentioned to your
> upstream maintainer when your tree is submitted for merging.  You may
> also want to consider cooperating with the maintainer of the conflicting
> tree to minimise any particularly complex conflicts.

The conflict resolution looks good to me.

Reviewed-by: Joel Fernandes (Google) 

thanks,

 - Joel


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2016-05-02 Thread Aneesh Kumar K.V
Stephen Rothwell  writes:

> Hi Andrew,
>
> Today's linux-next merge of the akpm-current tree got a conflict in:
>
>   arch/powerpc/include/asm/book3s/64/pgtable.h
>
> between commit:
>
>   dbaba7a16b7b ("powerpc/mm: THP is only available on hash64 as of now")
>
> from the powerpc tree and commit:
>
>   383b50a4e356 ("arch: fix has_transparent_hugepage()")
>
> from the akpm-current tree.
>
> I fixed it up (see below - the code moved) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.
>


looks good.

> -- 
> Cheers,
> Stephen Rothwell
>
> diff --cc arch/powerpc/include/asm/book3s/64/pgtable.h
> index 48dc76c13094,8fe6f6b48aa5..
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@@ -820,86 -265,9 +820,87 @@@ static inline int pmd_protnone(pmd_t pm
>   #define __HAVE_ARCH_PMD_WRITE
>   #define pmd_write(pmd)  pte_write(pmd_pte(pmd))
>   
>  +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  +extern pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot);
>  +extern pmd_t mk_pmd(struct page *page, pgprot_t pgprot);
>  +extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
>  +extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
>  +   pmd_t *pmdp, pmd_t pmd);
>  +extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long 
> addr,
>  + pmd_t *pmd);
>  +extern int hash__has_transparent_hugepage(void);
> ++#define has_transparent_hugepage has_transparent_hugepage
>  +static inline int has_transparent_hugepage(void)
>  +{
>  +if (radix_enabled())
>  +return radix__has_transparent_hugepage();
>  +return hash__has_transparent_hugepage();
>  +}
>  +
>  +static inline unsigned long
>  +pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp,
>  +unsigned long clr, unsigned long set)
>  +{
>  +if (radix_enabled())
>  +return radix__pmd_hugepage_update(mm, addr, pmdp, clr, set);
>  +return hash__pmd_hugepage_update(mm, addr, pmdp, clr, set);
>  +}
>  +
>  +static inline int pmd_large(pmd_t pmd)
>  +{
>  +return !!(pmd_val(pmd) & _PAGE_PTE);
>  +}
>  +
>  +static inline pmd_t pmd_mknotpresent(pmd_t pmd)
>  +{
>  +return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
>  +}
>  +/*
>  + * For radix we should always find H_PAGE_HASHPTE zero. Hence
>  + * the below will work for radix too
>  + */
>  +static inline int __pmdp_test_and_clear_young(struct mm_struct *mm,
>  +  unsigned long addr, pmd_t *pmdp)
>  +{
>  +unsigned long old;
>  +
>  +if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | H_PAGE_HASHPTE)) == 0)
>  +return 0;
>  +old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED, 0);
>  +return ((old & _PAGE_ACCESSED) != 0);
>  +}
>  +
>  +#define __HAVE_ARCH_PMDP_SET_WRPROTECT
>  +static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long 
> addr,
>  +  pmd_t *pmdp)
>  +{
>  +
>  +if ((pmd_val(*pmdp) & _PAGE_WRITE) == 0)
>  +return;
>  +
>  +pmd_hugepage_update(mm, addr, pmdp, _PAGE_WRITE, 0);
>  +}
>  +
>  +static inline int pmd_trans_huge(pmd_t pmd)
>  +{
>  +if (radix_enabled())
>  +return radix__pmd_trans_huge(pmd);
>  +return hash__pmd_trans_huge(pmd);
>  +}
>  +
>  +#define __HAVE_ARCH_PMD_SAME
>  +static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
>  +{
>  +if (radix_enabled())
>  +return radix__pmd_same(pmd_a, pmd_b);
>  +return hash__pmd_same(pmd_a, pmd_b);
>  +}
>  +
>   static inline pmd_t pmd_mkhuge(pmd_t pmd)
>   {
>  -return __pmd(pmd_val(pmd) | (_PAGE_PTE | _PAGE_THP_HUGE));
>  +if (radix_enabled())
>  +return radix__pmd_mkhuge(pmd);
>  +return hash__pmd_mkhuge(pmd);
>   }
>   
>   #define __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS



Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2016-05-02 Thread Aneesh Kumar K.V
Stephen Rothwell  writes:

> Hi Andrew,
>
> Today's linux-next merge of the akpm-current tree got a conflict in:
>
>   arch/powerpc/include/asm/book3s/64/pgtable.h
>
> between commit:
>
>   dbaba7a16b7b ("powerpc/mm: THP is only available on hash64 as of now")
>
> from the powerpc tree and commit:
>
>   383b50a4e356 ("arch: fix has_transparent_hugepage()")
>
> from the akpm-current tree.
>
> I fixed it up (see below - the code moved) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.
>


looks good.

> -- 
> Cheers,
> Stephen Rothwell
>
> diff --cc arch/powerpc/include/asm/book3s/64/pgtable.h
> index 48dc76c13094,8fe6f6b48aa5..
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@@ -820,86 -265,9 +820,87 @@@ static inline int pmd_protnone(pmd_t pm
>   #define __HAVE_ARCH_PMD_WRITE
>   #define pmd_write(pmd)  pte_write(pmd_pte(pmd))
>   
>  +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  +extern pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot);
>  +extern pmd_t mk_pmd(struct page *page, pgprot_t pgprot);
>  +extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
>  +extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
>  +   pmd_t *pmdp, pmd_t pmd);
>  +extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long 
> addr,
>  + pmd_t *pmd);
>  +extern int hash__has_transparent_hugepage(void);
> ++#define has_transparent_hugepage has_transparent_hugepage
>  +static inline int has_transparent_hugepage(void)
>  +{
>  +if (radix_enabled())
>  +return radix__has_transparent_hugepage();
>  +return hash__has_transparent_hugepage();
>  +}
>  +
>  +static inline unsigned long
>  +pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp,
>  +unsigned long clr, unsigned long set)
>  +{
>  +if (radix_enabled())
>  +return radix__pmd_hugepage_update(mm, addr, pmdp, clr, set);
>  +return hash__pmd_hugepage_update(mm, addr, pmdp, clr, set);
>  +}
>  +
>  +static inline int pmd_large(pmd_t pmd)
>  +{
>  +return !!(pmd_val(pmd) & _PAGE_PTE);
>  +}
>  +
>  +static inline pmd_t pmd_mknotpresent(pmd_t pmd)
>  +{
>  +return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
>  +}
>  +/*
>  + * For radix we should always find H_PAGE_HASHPTE zero. Hence
>  + * the below will work for radix too
>  + */
>  +static inline int __pmdp_test_and_clear_young(struct mm_struct *mm,
>  +  unsigned long addr, pmd_t *pmdp)
>  +{
>  +unsigned long old;
>  +
>  +if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | H_PAGE_HASHPTE)) == 0)
>  +return 0;
>  +old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED, 0);
>  +return ((old & _PAGE_ACCESSED) != 0);
>  +}
>  +
>  +#define __HAVE_ARCH_PMDP_SET_WRPROTECT
>  +static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long 
> addr,
>  +  pmd_t *pmdp)
>  +{
>  +
>  +if ((pmd_val(*pmdp) & _PAGE_WRITE) == 0)
>  +return;
>  +
>  +pmd_hugepage_update(mm, addr, pmdp, _PAGE_WRITE, 0);
>  +}
>  +
>  +static inline int pmd_trans_huge(pmd_t pmd)
>  +{
>  +if (radix_enabled())
>  +return radix__pmd_trans_huge(pmd);
>  +return hash__pmd_trans_huge(pmd);
>  +}
>  +
>  +#define __HAVE_ARCH_PMD_SAME
>  +static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
>  +{
>  +if (radix_enabled())
>  +return radix__pmd_same(pmd_a, pmd_b);
>  +return hash__pmd_same(pmd_a, pmd_b);
>  +}
>  +
>   static inline pmd_t pmd_mkhuge(pmd_t pmd)
>   {
>  -return __pmd(pmd_val(pmd) | (_PAGE_PTE | _PAGE_THP_HUGE));
>  +if (radix_enabled())
>  +return radix__pmd_mkhuge(pmd);
>  +return hash__pmd_mkhuge(pmd);
>   }
>   
>   #define __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS



linux-next: manual merge of the akpm-current tree with the powerpc tree

2016-05-02 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/include/asm/book3s/64/pgtable.h

between commit:

  dbaba7a16b7b ("powerpc/mm: THP is only available on hash64 as of now")

from the powerpc tree and commit:

  383b50a4e356 ("arch: fix has_transparent_hugepage()")

from the akpm-current tree.

I fixed it up (see below - the code moved) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/include/asm/book3s/64/pgtable.h
index 48dc76c13094,8fe6f6b48aa5..
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@@ -820,86 -265,9 +820,87 @@@ static inline int pmd_protnone(pmd_t pm
  #define __HAVE_ARCH_PMD_WRITE
  #define pmd_write(pmd)pte_write(pmd_pte(pmd))
  
 +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 +extern pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot);
 +extern pmd_t mk_pmd(struct page *page, pgprot_t pgprot);
 +extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
 +extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 + pmd_t *pmdp, pmd_t pmd);
 +extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long 
addr,
 +   pmd_t *pmd);
 +extern int hash__has_transparent_hugepage(void);
++#define has_transparent_hugepage has_transparent_hugepage
 +static inline int has_transparent_hugepage(void)
 +{
 +  if (radix_enabled())
 +  return radix__has_transparent_hugepage();
 +  return hash__has_transparent_hugepage();
 +}
 +
 +static inline unsigned long
 +pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp,
 +  unsigned long clr, unsigned long set)
 +{
 +  if (radix_enabled())
 +  return radix__pmd_hugepage_update(mm, addr, pmdp, clr, set);
 +  return hash__pmd_hugepage_update(mm, addr, pmdp, clr, set);
 +}
 +
 +static inline int pmd_large(pmd_t pmd)
 +{
 +  return !!(pmd_val(pmd) & _PAGE_PTE);
 +}
 +
 +static inline pmd_t pmd_mknotpresent(pmd_t pmd)
 +{
 +  return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
 +}
 +/*
 + * For radix we should always find H_PAGE_HASHPTE zero. Hence
 + * the below will work for radix too
 + */
 +static inline int __pmdp_test_and_clear_young(struct mm_struct *mm,
 +unsigned long addr, pmd_t *pmdp)
 +{
 +  unsigned long old;
 +
 +  if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | H_PAGE_HASHPTE)) == 0)
 +  return 0;
 +  old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED, 0);
 +  return ((old & _PAGE_ACCESSED) != 0);
 +}
 +
 +#define __HAVE_ARCH_PMDP_SET_WRPROTECT
 +static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long 
addr,
 +pmd_t *pmdp)
 +{
 +
 +  if ((pmd_val(*pmdp) & _PAGE_WRITE) == 0)
 +  return;
 +
 +  pmd_hugepage_update(mm, addr, pmdp, _PAGE_WRITE, 0);
 +}
 +
 +static inline int pmd_trans_huge(pmd_t pmd)
 +{
 +  if (radix_enabled())
 +  return radix__pmd_trans_huge(pmd);
 +  return hash__pmd_trans_huge(pmd);
 +}
 +
 +#define __HAVE_ARCH_PMD_SAME
 +static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
 +{
 +  if (radix_enabled())
 +  return radix__pmd_same(pmd_a, pmd_b);
 +  return hash__pmd_same(pmd_a, pmd_b);
 +}
 +
  static inline pmd_t pmd_mkhuge(pmd_t pmd)
  {
 -  return __pmd(pmd_val(pmd) | (_PAGE_PTE | _PAGE_THP_HUGE));
 +  if (radix_enabled())
 +  return radix__pmd_mkhuge(pmd);
 +  return hash__pmd_mkhuge(pmd);
  }
  
  #define __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS


linux-next: manual merge of the akpm-current tree with the powerpc tree

2016-05-02 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/include/asm/book3s/64/pgtable.h

between commit:

  dbaba7a16b7b ("powerpc/mm: THP is only available on hash64 as of now")

from the powerpc tree and commit:

  383b50a4e356 ("arch: fix has_transparent_hugepage()")

from the akpm-current tree.

I fixed it up (see below - the code moved) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/include/asm/book3s/64/pgtable.h
index 48dc76c13094,8fe6f6b48aa5..
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@@ -820,86 -265,9 +820,87 @@@ static inline int pmd_protnone(pmd_t pm
  #define __HAVE_ARCH_PMD_WRITE
  #define pmd_write(pmd)pte_write(pmd_pte(pmd))
  
 +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 +extern pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot);
 +extern pmd_t mk_pmd(struct page *page, pgprot_t pgprot);
 +extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
 +extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 + pmd_t *pmdp, pmd_t pmd);
 +extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long 
addr,
 +   pmd_t *pmd);
 +extern int hash__has_transparent_hugepage(void);
++#define has_transparent_hugepage has_transparent_hugepage
 +static inline int has_transparent_hugepage(void)
 +{
 +  if (radix_enabled())
 +  return radix__has_transparent_hugepage();
 +  return hash__has_transparent_hugepage();
 +}
 +
 +static inline unsigned long
 +pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp,
 +  unsigned long clr, unsigned long set)
 +{
 +  if (radix_enabled())
 +  return radix__pmd_hugepage_update(mm, addr, pmdp, clr, set);
 +  return hash__pmd_hugepage_update(mm, addr, pmdp, clr, set);
 +}
 +
 +static inline int pmd_large(pmd_t pmd)
 +{
 +  return !!(pmd_val(pmd) & _PAGE_PTE);
 +}
 +
 +static inline pmd_t pmd_mknotpresent(pmd_t pmd)
 +{
 +  return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
 +}
 +/*
 + * For radix we should always find H_PAGE_HASHPTE zero. Hence
 + * the below will work for radix too
 + */
 +static inline int __pmdp_test_and_clear_young(struct mm_struct *mm,
 +unsigned long addr, pmd_t *pmdp)
 +{
 +  unsigned long old;
 +
 +  if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | H_PAGE_HASHPTE)) == 0)
 +  return 0;
 +  old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED, 0);
 +  return ((old & _PAGE_ACCESSED) != 0);
 +}
 +
 +#define __HAVE_ARCH_PMDP_SET_WRPROTECT
 +static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long 
addr,
 +pmd_t *pmdp)
 +{
 +
 +  if ((pmd_val(*pmdp) & _PAGE_WRITE) == 0)
 +  return;
 +
 +  pmd_hugepage_update(mm, addr, pmdp, _PAGE_WRITE, 0);
 +}
 +
 +static inline int pmd_trans_huge(pmd_t pmd)
 +{
 +  if (radix_enabled())
 +  return radix__pmd_trans_huge(pmd);
 +  return hash__pmd_trans_huge(pmd);
 +}
 +
 +#define __HAVE_ARCH_PMD_SAME
 +static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
 +{
 +  if (radix_enabled())
 +  return radix__pmd_same(pmd_a, pmd_b);
 +  return hash__pmd_same(pmd_a, pmd_b);
 +}
 +
  static inline pmd_t pmd_mkhuge(pmd_t pmd)
  {
 -  return __pmd(pmd_val(pmd) | (_PAGE_PTE | _PAGE_THP_HUGE));
 +  if (radix_enabled())
 +  return radix__pmd_mkhuge(pmd);
 +  return hash__pmd_mkhuge(pmd);
  }
  
  #define __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS


linux-next: manual merge of the akpm-current tree with the powerpc tree

2016-03-03 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  mm/huge_memory.c

between commit:

  ff20c2e0acc5 ("mm: Some arch may want to use HPAGE_PMD related values as 
variables")

from the powerpc tree and commit:

  82fdbe051e29 ("mm: make optimistic check for swapin readahead")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell

diff --cc mm/huge_memory.c
index 43b11a695113,5b38aa24566f..
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@@ -98,7 -100,8 +100,8 @@@ static DECLARE_WAIT_QUEUE_HEAD(khugepag
   * it would have happened if the vma was large enough during page
   * fault.
   */
 -static unsigned int khugepaged_max_ptes_none __read_mostly = HPAGE_PMD_NR-1;
 -static unsigned int khugepaged_max_ptes_swap __read_mostly = HPAGE_PMD_NR/8;
 +static unsigned int khugepaged_max_ptes_none __read_mostly;
++static unsigned int khugepaged_max_ptes_swap __read_mostly;
  
  static int khugepaged(void *none);
  static int khugepaged_slab_init(void);
@@@ -660,18 -691,6 +691,19 @@@ static int __init hugepage_init(void
return -EINVAL;
}
  
 +  khugepaged_pages_to_scan = HPAGE_PMD_NR * 8;
 +  khugepaged_max_ptes_none = HPAGE_PMD_NR - 1;
++  khugepaged_max_ptes_swap = HPAGE_PMD_NR / 8;
 +  /*
 +   * hugepages can't be allocated by the buddy allocator
 +   */
 +  MAYBE_BUILD_BUG_ON(HPAGE_PMD_ORDER >= MAX_ORDER);
 +  /*
 +   * we use page->mapping and page->index in second tail page
 +   * as list_head: assuming THP order >= 2
 +   */
 +  MAYBE_BUILD_BUG_ON(HPAGE_PMD_ORDER < 2);
 +
err = hugepage_init_sysfs(_kobj);
if (err)
goto err_sysfs;


linux-next: manual merge of the akpm-current tree with the powerpc tree

2016-03-03 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the akpm-current tree got a conflict in:

  mm/huge_memory.c

between commit:

  ff20c2e0acc5 ("mm: Some arch may want to use HPAGE_PMD related values as 
variables")

from the powerpc tree and commit:

  82fdbe051e29 ("mm: make optimistic check for swapin readahead")

from the akpm-current tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell

diff --cc mm/huge_memory.c
index 43b11a695113,5b38aa24566f..
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@@ -98,7 -100,8 +100,8 @@@ static DECLARE_WAIT_QUEUE_HEAD(khugepag
   * it would have happened if the vma was large enough during page
   * fault.
   */
 -static unsigned int khugepaged_max_ptes_none __read_mostly = HPAGE_PMD_NR-1;
 -static unsigned int khugepaged_max_ptes_swap __read_mostly = HPAGE_PMD_NR/8;
 +static unsigned int khugepaged_max_ptes_none __read_mostly;
++static unsigned int khugepaged_max_ptes_swap __read_mostly;
  
  static int khugepaged(void *none);
  static int khugepaged_slab_init(void);
@@@ -660,18 -691,6 +691,19 @@@ static int __init hugepage_init(void
return -EINVAL;
}
  
 +  khugepaged_pages_to_scan = HPAGE_PMD_NR * 8;
 +  khugepaged_max_ptes_none = HPAGE_PMD_NR - 1;
++  khugepaged_max_ptes_swap = HPAGE_PMD_NR / 8;
 +  /*
 +   * hugepages can't be allocated by the buddy allocator
 +   */
 +  MAYBE_BUILD_BUG_ON(HPAGE_PMD_ORDER >= MAX_ORDER);
 +  /*
 +   * we use page->mapping and page->index in second tail page
 +   * as list_head: assuming THP order >= 2
 +   */
 +  MAYBE_BUILD_BUG_ON(HPAGE_PMD_ORDER < 2);
 +
err = hugepage_init_sysfs(_kobj);
if (err)
goto err_sysfs;


linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-17 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/include/asm/pgtable.h

between commit:

  ee4889c7bc2a ("powerpc/mm: Don't have generic headers introduce functions 
touching pte bits")

from the powerpc tree and commit:

  e0e8474c0d55 ("mm, dax, gpu: convert vm_insert_mixed to pfn_t")

from the akpm-current tree.

I fixed it up (the code being changed was moved from this file - I added
the fix up patch below) and can carry the fix as necessary (no action
is required).

From: Stephen Rothwell 
Date: Fri, 18 Dec 2015 16:30:47 +1100
Subject: [PATCH] mm, dax, gpu: merge fix for convert vm_insert_mixed to pfn_t

Signed-off-by: Stephen Rothwell 
---
 arch/powerpc/include/asm/book3s/32/pgtable.h | 1 +
 arch/powerpc/include/asm/book3s/64/hash.h| 1 +
 arch/powerpc/include/asm/nohash/pgtable.h| 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h 
b/arch/powerpc/include/asm/book3s/32/pgtable.h
index 38b33dcfcc9d..3ed3303c1295 100644
--- a/arch/powerpc/include/asm/book3s/32/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/32/pgtable.h
@@ -313,6 +313,7 @@ static inline int pte_present(pte_t pte)
  * Even if PTEs can be unsigned long long, a PFN is always an unsigned
  * long for now.
  */
+#define pfn_pte pfn_pte
 static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
 {
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
b/arch/powerpc/include/asm/book3s/64/hash.h
index 9e861b4378bd..6ab967d0da00 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -410,6 +410,7 @@ static inline int pte_present(pte_t pte)
  * Even if PTEs can be unsigned long long, a PFN is always an unsigned
  * long for now.
  */
+#define pfn_pte pfn_pte
 static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
 {
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
diff --git a/arch/powerpc/include/asm/nohash/pgtable.h 
b/arch/powerpc/include/asm/nohash/pgtable.h
index 1263c22d60d8..11e3767216c0 100644
--- a/arch/powerpc/include/asm/nohash/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/pgtable.h
@@ -49,6 +49,7 @@ static inline int pte_present(pte_t pte)
  * Even if PTEs can be unsigned long long, a PFN is always an unsigned
  * long for now.
  */
+#define pfn_pte pfn_pte
 static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) {
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
 pgprot_val(pgprot)); }
-- 
2.6.2

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-17 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm-current tree got a conflict in:

  arch/powerpc/include/asm/pgtable.h

between commit:

  ee4889c7bc2a ("powerpc/mm: Don't have generic headers introduce functions 
touching pte bits")

from the powerpc tree and commit:

  e0e8474c0d55 ("mm, dax, gpu: convert vm_insert_mixed to pfn_t")

from the akpm-current tree.

I fixed it up (the code being changed was moved from this file - I added
the fix up patch below) and can carry the fix as necessary (no action
is required).

From: Stephen Rothwell 
Date: Fri, 18 Dec 2015 16:30:47 +1100
Subject: [PATCH] mm, dax, gpu: merge fix for convert vm_insert_mixed to pfn_t

Signed-off-by: Stephen Rothwell 
---
 arch/powerpc/include/asm/book3s/32/pgtable.h | 1 +
 arch/powerpc/include/asm/book3s/64/hash.h| 1 +
 arch/powerpc/include/asm/nohash/pgtable.h| 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h 
b/arch/powerpc/include/asm/book3s/32/pgtable.h
index 38b33dcfcc9d..3ed3303c1295 100644
--- a/arch/powerpc/include/asm/book3s/32/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/32/pgtable.h
@@ -313,6 +313,7 @@ static inline int pte_present(pte_t pte)
  * Even if PTEs can be unsigned long long, a PFN is always an unsigned
  * long for now.
  */
+#define pfn_pte pfn_pte
 static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
 {
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
b/arch/powerpc/include/asm/book3s/64/hash.h
index 9e861b4378bd..6ab967d0da00 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -410,6 +410,7 @@ static inline int pte_present(pte_t pte)
  * Even if PTEs can be unsigned long long, a PFN is always an unsigned
  * long for now.
  */
+#define pfn_pte pfn_pte
 static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
 {
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
diff --git a/arch/powerpc/include/asm/nohash/pgtable.h 
b/arch/powerpc/include/asm/nohash/pgtable.h
index 1263c22d60d8..11e3767216c0 100644
--- a/arch/powerpc/include/asm/nohash/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/pgtable.h
@@ -49,6 +49,7 @@ static inline int pte_present(pte_t pte)
  * Even if PTEs can be unsigned long long, a PFN is always an unsigned
  * long for now.
  */
+#define pfn_pte pfn_pte
 static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) {
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
 pgprot_val(pgprot)); }
-- 
2.6.2

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-15 Thread Aneesh Kumar K.V
Stephen Rothwell  writes:

> Hi Andrew,
>
> Today's linux-next merge of the akpm-current tree got conflicts in:
>
>   arch/powerpc/include/asm/nohash/64/pgtable.h
>   arch/powerpc/mm/pgtable_64.c
>
> between various commits from the powerpc tree and commits:
>
>   e56ebae0dd4c ("powerpc, thp: remove infrastructure for handling splitting 
> PMDs")


For reference the web url for the patch

http://article.gmane.org/gmane.linux.kernel.mm/139654


>
> from the akpm-current tree.
>
> I used the powerpc tree version of the first and the akpm-current tree
> version of the second and then I applied the following merge fix patch:
>
> From: Stephen Rothwell 
> Date: Tue, 15 Dec 2015 16:50:42 +1100
> Subject: [PATCH] merge fix for "powerpc, thp: remove infrastructure for
>  handling splitting PMDs"
>
> Signed-off-by: Stephen Rothwell 


Looks good.
Reviewed-by: Aneesh Kumar K.V 



> ---
>  arch/powerpc/include/asm/book3s/64/hash-64k.h | 12 
>  arch/powerpc/include/asm/book3s/64/hash.h | 10 ++
>  arch/powerpc/include/asm/book3s/64/pgtable.h  |  4 
>  3 files changed, 2 insertions(+), 24 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h 
> b/arch/powerpc/include/asm/book3s/64/hash-64k.h
> index 9f9942998587..f2072a4ca9e3 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash-64k.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash-64k.h
> @@ -256,13 +256,6 @@ static inline int pmd_trans_huge(pmd_t pmd)
> (_PAGE_PTE | _PAGE_THP_HUGE));
>  }
>
> -static inline int pmd_trans_splitting(pmd_t pmd)
> -{
> - if (pmd_trans_huge(pmd))
> - return pmd_val(pmd) & _PAGE_SPLITTING;
> - return 0;
> -}
> -
>  static inline int pmd_large(pmd_t pmd)
>  {
>   return !!(pmd_val(pmd) & _PAGE_PTE);
> @@ -273,11 +266,6 @@ static inline pmd_t pmd_mknotpresent(pmd_t pmd)
>   return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
>  }
>
> -static inline pmd_t pmd_mksplitting(pmd_t pmd)
> -{
> - return __pmd(pmd_val(pmd) | _PAGE_SPLITTING);
> -}
> -
>  #define __HAVE_ARCH_PMD_SAME
>  static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
>  {
> diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
> b/arch/powerpc/include/asm/book3s/64/hash.h
> index 8b929e531758..4e69d9a273ed 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash.h
> @@ -35,11 +35,6 @@
>  #define _PAGE_SPECIAL0x1 /* software: special page */
>
>  /*
> - * THP pages can't be special. So use the _PAGE_SPECIAL
> - */
> -#define _PAGE_SPLITTING _PAGE_SPECIAL
> -
> -/*
>   * We need to differentiate between explicit huge page and THP huge
>   * page, since THP huge page also need to track real subpage details
>   */
> @@ -48,9 +43,8 @@
>  /*
>   * set of bits not changed in pmd_modify.
>   */
> -#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS |\
> -  _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPLITTING | \
> -  _PAGE_THP_HUGE | _PAGE_PTE)
> +#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY |
> +  _PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE)
>
>  #ifdef CONFIG_PPC_64K_PAGES
>  #include 
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h 
> b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index a2d4e0e37067..6306d6565ee0 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -232,10 +232,6 @@ extern int pmdp_clear_flush_young(struct vm_area_struct 
> *vma,
>  extern pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
>unsigned long addr, pmd_t *pmdp);
>
> -#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH
> -extern void pmdp_splitting_flush(struct vm_area_struct *vma,
> -  unsigned long address, pmd_t *pmdp);
> -
>  extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
>unsigned long address, pmd_t *pmdp);
>  #define pmdp_collapse_flush pmdp_collapse_flush
> -- 
> 2.6.2
>
> -- 
> Cheers,
> Stephen Rothwells...@canb.auug.org.au

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-15 Thread Aneesh Kumar K.V
Stephen Rothwell  writes:

> Hi Andrew,
>
> Today's linux-next merge of the akpm-current tree got conflicts in:
>
>   arch/powerpc/include/asm/nohash/64/pgtable.h
>   arch/powerpc/mm/pgtable_64.c
>
> between various commits from the powerpc tree and commits:
>
>   e56ebae0dd4c ("powerpc, thp: remove infrastructure for handling splitting 
> PMDs")


For reference the web url for the patch

http://article.gmane.org/gmane.linux.kernel.mm/139654


>
> from the akpm-current tree.
>
> I used the powerpc tree version of the first and the akpm-current tree
> version of the second and then I applied the following merge fix patch:
>
> From: Stephen Rothwell 
> Date: Tue, 15 Dec 2015 16:50:42 +1100
> Subject: [PATCH] merge fix for "powerpc, thp: remove infrastructure for
>  handling splitting PMDs"
>
> Signed-off-by: Stephen Rothwell 


Looks good.
Reviewed-by: Aneesh Kumar K.V 



> ---
>  arch/powerpc/include/asm/book3s/64/hash-64k.h | 12 
>  arch/powerpc/include/asm/book3s/64/hash.h | 10 ++
>  arch/powerpc/include/asm/book3s/64/pgtable.h  |  4 
>  3 files changed, 2 insertions(+), 24 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h 
> b/arch/powerpc/include/asm/book3s/64/hash-64k.h
> index 9f9942998587..f2072a4ca9e3 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash-64k.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash-64k.h
> @@ -256,13 +256,6 @@ static inline int pmd_trans_huge(pmd_t pmd)
> (_PAGE_PTE | _PAGE_THP_HUGE));
>  }
>
> -static inline int pmd_trans_splitting(pmd_t pmd)
> -{
> - if (pmd_trans_huge(pmd))
> - return pmd_val(pmd) & _PAGE_SPLITTING;
> - return 0;
> -}
> -
>  static inline int pmd_large(pmd_t pmd)
>  {
>   return !!(pmd_val(pmd) & _PAGE_PTE);
> @@ -273,11 +266,6 @@ static inline pmd_t pmd_mknotpresent(pmd_t pmd)
>   return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
>  }
>
> -static inline pmd_t pmd_mksplitting(pmd_t pmd)
> -{
> - return __pmd(pmd_val(pmd) | _PAGE_SPLITTING);
> -}
> -
>  #define __HAVE_ARCH_PMD_SAME
>  static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
>  {
> diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
> b/arch/powerpc/include/asm/book3s/64/hash.h
> index 8b929e531758..4e69d9a273ed 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash.h
> @@ -35,11 +35,6 @@
>  #define _PAGE_SPECIAL0x1 /* software: special page */
>
>  /*
> - * THP pages can't be special. So use the _PAGE_SPECIAL
> - */
> -#define _PAGE_SPLITTING _PAGE_SPECIAL
> -
> -/*
>   * We need to differentiate between explicit huge page and THP huge
>   * page, since THP huge page also need to track real subpage details
>   */
> @@ -48,9 +43,8 @@
>  /*
>   * set of bits not changed in pmd_modify.
>   */
> -#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS |\
> -  _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPLITTING | \
> -  _PAGE_THP_HUGE | _PAGE_PTE)
> +#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY |
> +  _PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE)
>
>  #ifdef CONFIG_PPC_64K_PAGES
>  #include 
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h 
> b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index a2d4e0e37067..6306d6565ee0 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -232,10 +232,6 @@ extern int pmdp_clear_flush_young(struct vm_area_struct 
> *vma,
>  extern pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
>unsigned long addr, pmd_t *pmdp);
>
> -#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH
> -extern void pmdp_splitting_flush(struct vm_area_struct *vma,
> -  unsigned long address, pmd_t *pmdp);
> -
>  extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
>unsigned long address, pmd_t *pmdp);
>  #define pmdp_collapse_flush pmdp_collapse_flush
> -- 
> 2.6.2
>
> -- 
> Cheers,
> Stephen Rothwells...@canb.auug.org.au

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-14 Thread Stephen Rothwell
Hi Andrew,

On Tue, 15 Dec 2015 16:53:42 +1100 Stephen Rothwell  
wrote:
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
> b/arch/powerpc/include/asm/book3s/64/hash.h
> index 8b929e531758..4e69d9a273ed 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash.h
> @@ -48,9 +43,8 @@
>  /*
>   * set of bits not changed in pmd_modify.
>   */
> -#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS |\
> -  _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPLITTING | \
> -  _PAGE_THP_HUGE | _PAGE_PTE)
> +#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY |
   ^
I missed a backslash here which I fixed up in my tree.

> +  _PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE)
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-14 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm-current tree got conflicts in:

  arch/powerpc/include/asm/nohash/64/pgtable.h
  arch/powerpc/mm/pgtable_64.c

between various commits from the powerpc tree and commits:

  e56ebae0dd4c ("powerpc, thp: remove infrastructure for handling splitting 
PMDs")

from the akpm-current tree.

I used the powerpc tree version of the first and the akpm-current tree
version of the second and then I applied the following merge fix patch:

From: Stephen Rothwell 
Date: Tue, 15 Dec 2015 16:50:42 +1100
Subject: [PATCH] merge fix for "powerpc, thp: remove infrastructure for
 handling splitting PMDs"

Signed-off-by: Stephen Rothwell 
---
 arch/powerpc/include/asm/book3s/64/hash-64k.h | 12 
 arch/powerpc/include/asm/book3s/64/hash.h | 10 ++
 arch/powerpc/include/asm/book3s/64/pgtable.h  |  4 
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h 
b/arch/powerpc/include/asm/book3s/64/hash-64k.h
index 9f9942998587..f2072a4ca9e3 100644
--- a/arch/powerpc/include/asm/book3s/64/hash-64k.h
+++ b/arch/powerpc/include/asm/book3s/64/hash-64k.h
@@ -256,13 +256,6 @@ static inline int pmd_trans_huge(pmd_t pmd)
  (_PAGE_PTE | _PAGE_THP_HUGE));
 }
 
-static inline int pmd_trans_splitting(pmd_t pmd)
-{
-   if (pmd_trans_huge(pmd))
-   return pmd_val(pmd) & _PAGE_SPLITTING;
-   return 0;
-}
-
 static inline int pmd_large(pmd_t pmd)
 {
return !!(pmd_val(pmd) & _PAGE_PTE);
@@ -273,11 +266,6 @@ static inline pmd_t pmd_mknotpresent(pmd_t pmd)
return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
 }
 
-static inline pmd_t pmd_mksplitting(pmd_t pmd)
-{
-   return __pmd(pmd_val(pmd) | _PAGE_SPLITTING);
-}
-
 #define __HAVE_ARCH_PMD_SAME
 static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
 {
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
b/arch/powerpc/include/asm/book3s/64/hash.h
index 8b929e531758..4e69d9a273ed 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -35,11 +35,6 @@
 #define _PAGE_SPECIAL  0x1 /* software: special page */
 
 /*
- * THP pages can't be special. So use the _PAGE_SPECIAL
- */
-#define _PAGE_SPLITTING _PAGE_SPECIAL
-
-/*
  * We need to differentiate between explicit huge page and THP huge
  * page, since THP huge page also need to track real subpage details
  */
@@ -48,9 +43,8 @@
 /*
  * set of bits not changed in pmd_modify.
  */
-#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS |  \
-_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPLITTING | \
-_PAGE_THP_HUGE | _PAGE_PTE)
+#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY |
+_PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE)
 
 #ifdef CONFIG_PPC_64K_PAGES
 #include 
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h 
b/arch/powerpc/include/asm/book3s/64/pgtable.h
index a2d4e0e37067..6306d6565ee0 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -232,10 +232,6 @@ extern int pmdp_clear_flush_young(struct vm_area_struct 
*vma,
 extern pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
 unsigned long addr, pmd_t *pmdp);
 
-#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH
-extern void pmdp_splitting_flush(struct vm_area_struct *vma,
-unsigned long address, pmd_t *pmdp);
-
 extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
 unsigned long address, pmd_t *pmdp);
 #define pmdp_collapse_flush pmdp_collapse_flush
-- 
2.6.2

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-14 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm-current tree got conflicts in:

  arch/powerpc/include/asm/nohash/64/pgtable.h
  arch/powerpc/mm/pgtable_64.c

between various commits from the powerpc tree and commits:

  e56ebae0dd4c ("powerpc, thp: remove infrastructure for handling splitting 
PMDs")

from the akpm-current tree.

I used the powerpc tree version of the first and the akpm-current tree
version of the second and then I applied the following merge fix patch:

From: Stephen Rothwell 
Date: Tue, 15 Dec 2015 16:50:42 +1100
Subject: [PATCH] merge fix for "powerpc, thp: remove infrastructure for
 handling splitting PMDs"

Signed-off-by: Stephen Rothwell 
---
 arch/powerpc/include/asm/book3s/64/hash-64k.h | 12 
 arch/powerpc/include/asm/book3s/64/hash.h | 10 ++
 arch/powerpc/include/asm/book3s/64/pgtable.h  |  4 
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h 
b/arch/powerpc/include/asm/book3s/64/hash-64k.h
index 9f9942998587..f2072a4ca9e3 100644
--- a/arch/powerpc/include/asm/book3s/64/hash-64k.h
+++ b/arch/powerpc/include/asm/book3s/64/hash-64k.h
@@ -256,13 +256,6 @@ static inline int pmd_trans_huge(pmd_t pmd)
  (_PAGE_PTE | _PAGE_THP_HUGE));
 }
 
-static inline int pmd_trans_splitting(pmd_t pmd)
-{
-   if (pmd_trans_huge(pmd))
-   return pmd_val(pmd) & _PAGE_SPLITTING;
-   return 0;
-}
-
 static inline int pmd_large(pmd_t pmd)
 {
return !!(pmd_val(pmd) & _PAGE_PTE);
@@ -273,11 +266,6 @@ static inline pmd_t pmd_mknotpresent(pmd_t pmd)
return __pmd(pmd_val(pmd) & ~_PAGE_PRESENT);
 }
 
-static inline pmd_t pmd_mksplitting(pmd_t pmd)
-{
-   return __pmd(pmd_val(pmd) | _PAGE_SPLITTING);
-}
-
 #define __HAVE_ARCH_PMD_SAME
 static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
 {
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
b/arch/powerpc/include/asm/book3s/64/hash.h
index 8b929e531758..4e69d9a273ed 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -35,11 +35,6 @@
 #define _PAGE_SPECIAL  0x1 /* software: special page */
 
 /*
- * THP pages can't be special. So use the _PAGE_SPECIAL
- */
-#define _PAGE_SPLITTING _PAGE_SPECIAL
-
-/*
  * We need to differentiate between explicit huge page and THP huge
  * page, since THP huge page also need to track real subpage details
  */
@@ -48,9 +43,8 @@
 /*
  * set of bits not changed in pmd_modify.
  */
-#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS |  \
-_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPLITTING | \
-_PAGE_THP_HUGE | _PAGE_PTE)
+#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY |
+_PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE)
 
 #ifdef CONFIG_PPC_64K_PAGES
 #include 
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h 
b/arch/powerpc/include/asm/book3s/64/pgtable.h
index a2d4e0e37067..6306d6565ee0 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -232,10 +232,6 @@ extern int pmdp_clear_flush_young(struct vm_area_struct 
*vma,
 extern pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
 unsigned long addr, pmd_t *pmdp);
 
-#define __HAVE_ARCH_PMDP_SPLITTING_FLUSH
-extern void pmdp_splitting_flush(struct vm_area_struct *vma,
-unsigned long address, pmd_t *pmdp);
-
 extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
 unsigned long address, pmd_t *pmdp);
 #define pmdp_collapse_flush pmdp_collapse_flush
-- 
2.6.2

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2015-12-14 Thread Stephen Rothwell
Hi Andrew,

On Tue, 15 Dec 2015 16:53:42 +1100 Stephen Rothwell  
wrote:
>
> diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
> b/arch/powerpc/include/asm/book3s/64/hash.h
> index 8b929e531758..4e69d9a273ed 100644
> --- a/arch/powerpc/include/asm/book3s/64/hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/hash.h
> @@ -48,9 +43,8 @@
>  /*
>   * set of bits not changed in pmd_modify.
>   */
> -#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS |\
> -  _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPLITTING | \
> -  _PAGE_THP_HUGE | _PAGE_PTE)
> +#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY |
   ^
I missed a backslash here which I fixed up in my tree.

> +  _PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE)
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/