linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/memkey: fix compilation error caused by upstream changes
@ 2017-10-09 16:11 Ram Pai
  2017-10-10  9:00 ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Ram Pai @ 2017-10-09 16:11 UTC (permalink / raw)
  To: mpe, linuxppc-dev
  Cc: benh, paulus, khandual, aneesh.kumar, bsingharora, hbabu, mhocko,
	bauerman, ebiederm, linuxram

"commit df3735c5 -- x86,mpx: make mpx depend on x86-64 to free up VMA flag"
added the same vm highmem flag we had introduced for PKEY4. That broke
some of the definitions in pkeys.h

This patch fixes the issue.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
 arch/powerpc/include/asm/pkeys.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h
index baac435..da0d5e6 100644
--- a/arch/powerpc/include/asm/pkeys.h
+++ b/arch/powerpc/include/asm/pkeys.h
@@ -15,9 +15,7 @@
  * we have to carry the hunk below. This is  needed to get
  * pkeys working on power. -- Ram
  */
-#ifndef VM_HIGH_ARCH_BIT_4
-#define VM_HIGH_ARCH_BIT_4	36
-#define VM_HIGH_ARCH_4	BIT(VM_HIGH_ARCH_BIT_4)
+#ifndef VM_PKEY_BIT4
 #define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0
 #define VM_PKEY_BIT0	VM_HIGH_ARCH_0
 #define VM_PKEY_BIT1	VM_HIGH_ARCH_1
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/memkey: fix compilation error caused by upstream changes
  2017-10-09 16:11 [PATCH] powerpc/memkey: fix compilation error caused by upstream changes Ram Pai
@ 2017-10-10  9:00 ` Michael Ellerman
  2017-10-10 16:19   ` Ram Pai
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2017-10-10  9:00 UTC (permalink / raw)
  To: Ram Pai, linuxppc-dev
  Cc: benh, paulus, khandual, aneesh.kumar, bsingharora, hbabu, mhocko,
	bauerman, ebiederm, linuxram

Ram Pai <linuxram@us.ibm.com> writes:

> "commit df3735c5 -- x86,mpx: make mpx depend on x86-64 to free up VMA flag"
> added the same vm highmem flag we had introduced for PKEY4. That broke
> some of the definitions in pkeys.h
>
> This patch fixes the issue.
>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> ---
>  arch/powerpc/include/asm/pkeys.h |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)

Thanks.

Next problem is pmac32, corenet32/corenet64_smp defconfigs:

  arch/powerpc/include/asm/pkeys.h:19:23: error: 'VM_HIGH_ARCH_BIT_0' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:20:22: error: 'VM_HIGH_ARCH_0' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:21:22: error: 'VM_HIGH_ARCH_1' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:22:22: error: 'VM_HIGH_ARCH_2' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:23:22: error: 'VM_HIGH_ARCH_3' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:24:22: error: 'VM_HIGH_ARCH_4' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:50:39: error: 'H_PAGE_PKEY_BIT4' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:51:32: error: 'H_PAGE_PKEY_BIT3' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:52:32: error: 'H_PAGE_PKEY_BIT2' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:53:32: error: 'H_PAGE_PKEY_BIT1' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:54:32: error: 'H_PAGE_PKEY_BIT0' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:77:23: error: 'H_PAGE_PKEY_BIT0' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:77:43: error: 'HPTE_R_KEY_BIT0' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:78:16: error: 'H_PAGE_PKEY_BIT1' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:78:36: error: 'HPTE_R_KEY_BIT1' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:79:16: error: 'H_PAGE_PKEY_BIT2' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:79:36: error: 'HPTE_R_KEY_BIT2' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:80:16: error: 'H_PAGE_PKEY_BIT3' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:80:36: error: 'HPTE_R_KEY_BIT3' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:81:16: error: 'H_PAGE_PKEY_BIT4' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:81:36: error: 'HPTE_R_KEY_BIT4' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:89:23: error: 'H_PAGE_PKEY_BIT0' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:90:16: error: 'H_PAGE_PKEY_BIT1' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:91:16: error: 'H_PAGE_PKEY_BIT2' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:92:16: error: 'H_PAGE_PKEY_BIT3' undeclared (first use in this function)
  arch/powerpc/include/asm/pkeys.h:93:16: error: 'H_PAGE_PKEY_BIT4' undeclared (first use in this function)
  arch/powerpc/include/asm/mmu_context.h:199:19: error: redefinition of 'vma_pkey'
  arch/powerpc/include/asm/mmu_context.h:204:19: error: redefinition of 'pte_to_hpte_pkey_bits'
  arch/powerpc/include/asm/pkeys.h:102:48: error: 'mm_context_t' has no member named 'pkey_allocation_map'
  arch/powerpc/include/asm/pkeys.h:224:13: error: 'mm_context_t' has no member named 'execute_only_pkey'

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/memkey: fix compilation error caused by upstream changes
  2017-10-10  9:00 ` Michael Ellerman
@ 2017-10-10 16:19   ` Ram Pai
  2017-10-10 16:22     ` [PATCH] powerpc/memkey: feature applies to PPC_BOOK3S_64 archs only Ram Pai
  0 siblings, 1 reply; 5+ messages in thread
From: Ram Pai @ 2017-10-10 16:19 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, benh, paulus, khandual, aneesh.kumar, bsingharora,
	hbabu, mhocko, bauerman, ebiederm

On Tue, Oct 10, 2017 at 08:00:27PM +1100, Michael Ellerman wrote:
> Ram Pai <linuxram@us.ibm.com> writes:
> 
> > "commit df3735c5 -- x86,mpx: make mpx depend on x86-64 to free up VMA flag"
> > added the same vm highmem flag we had introduced for PKEY4. That broke
> > some of the definitions in pkeys.h
> >
> > This patch fixes the issue.
> >
> > Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> > ---
> >  arch/powerpc/include/asm/pkeys.h |    4 +---
> >  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> Thanks.

Oops. this bug is already fixed in my latest branch. Balbir had
commented about it. the issue is that Kconfig is configued to depend on
PPC64 instead of PPC_BOOK3S_64. Will send a fix that applies to your
tree, right away.

RP

> 
> Next problem is pmac32, corenet32/corenet64_smp defconfigs:
> 
>   arch/powerpc/include/asm/pkeys.h:19:23: error: 'VM_HIGH_ARCH_BIT_0' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:20:22: error: 'VM_HIGH_ARCH_0' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:21:22: error: 'VM_HIGH_ARCH_1' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:22:22: error: 'VM_HIGH_ARCH_2' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:23:22: error: 'VM_HIGH_ARCH_3' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:24:22: error: 'VM_HIGH_ARCH_4' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:50:39: error: 'H_PAGE_PKEY_BIT4' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:51:32: error: 'H_PAGE_PKEY_BIT3' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:52:32: error: 'H_PAGE_PKEY_BIT2' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:53:32: error: 'H_PAGE_PKEY_BIT1' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:54:32: error: 'H_PAGE_PKEY_BIT0' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:77:23: error: 'H_PAGE_PKEY_BIT0' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:77:43: error: 'HPTE_R_KEY_BIT0' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:78:16: error: 'H_PAGE_PKEY_BIT1' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:78:36: error: 'HPTE_R_KEY_BIT1' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:79:16: error: 'H_PAGE_PKEY_BIT2' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:79:36: error: 'HPTE_R_KEY_BIT2' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:80:16: error: 'H_PAGE_PKEY_BIT3' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:80:36: error: 'HPTE_R_KEY_BIT3' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:81:16: error: 'H_PAGE_PKEY_BIT4' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:81:36: error: 'HPTE_R_KEY_BIT4' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:89:23: error: 'H_PAGE_PKEY_BIT0' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:90:16: error: 'H_PAGE_PKEY_BIT1' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:91:16: error: 'H_PAGE_PKEY_BIT2' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:92:16: error: 'H_PAGE_PKEY_BIT3' undeclared (first use in this function)
>   arch/powerpc/include/asm/pkeys.h:93:16: error: 'H_PAGE_PKEY_BIT4' undeclared (first use in this function)
>   arch/powerpc/include/asm/mmu_context.h:199:19: error: redefinition of 'vma_pkey'
>   arch/powerpc/include/asm/mmu_context.h:204:19: error: redefinition of 'pte_to_hpte_pkey_bits'
>   arch/powerpc/include/asm/pkeys.h:102:48: error: 'mm_context_t' has no member named 'pkey_allocation_map'
>   arch/powerpc/include/asm/pkeys.h:224:13: error: 'mm_context_t' has no member named 'execute_only_pkey'
> 
> cheers

-- 
Ram Pai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] powerpc/memkey: feature applies to PPC_BOOK3S_64 archs only
  2017-10-10 16:19   ` Ram Pai
@ 2017-10-10 16:22     ` Ram Pai
  2017-10-11 10:50       ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Ram Pai @ 2017-10-10 16:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, benh, paulus, khandual, aneesh.kumar, bsingharora,
	hbabu, mhocko, bauerman, ebiederm

Currently protection key feature is erroneously configured to
be enabled for any flavor of PPC64. This patch fixes it.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
 arch/powerpc/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 7dee449..4b2b055 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -868,7 +868,7 @@ config PPC64_MEMORY_PROTECTION_KEYS
 	prompt "PowerPC Memory Protection Keys"
 	def_bool y
 	# Note: only available in 64-bit mode
-	depends on PPC64
+	depends on PPC_BOOK3S_64
 	select ARCH_USES_HIGH_VMA_FLAGS
 	select ARCH_HAS_PKEYS
 	---help---
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/memkey: feature applies to PPC_BOOK3S_64 archs only
  2017-10-10 16:22     ` [PATCH] powerpc/memkey: feature applies to PPC_BOOK3S_64 archs only Ram Pai
@ 2017-10-11 10:50       ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2017-10-11 10:50 UTC (permalink / raw)
  To: Ram Pai
  Cc: linuxppc-dev, benh, paulus, khandual, aneesh.kumar, bsingharora,
	hbabu, mhocko, bauerman, ebiederm

Ram Pai <linuxram@us.ibm.com> writes:

> Currently protection key feature is erroneously configured to
> be enabled for any flavor of PPC64. This patch fixes it.
>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> ---
>  arch/powerpc/Kconfig |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 7dee449..4b2b055 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -868,7 +868,7 @@ config PPC64_MEMORY_PROTECTION_KEYS
>  	prompt "PowerPC Memory Protection Keys"
>  	def_bool y
>  	# Note: only available in 64-bit mode
> -	depends on PPC64
> +	depends on PPC_BOOK3S_64
>  	select ARCH_USES_HIGH_VMA_FLAGS
>  	select ARCH_HAS_PKEYS

That didn't really help.

I needed the patch below to get it building.

cheers

diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h
index da0d5e64ffab..28fad534333d 100644
--- a/arch/powerpc/include/asm/pkeys.h
+++ b/arch/powerpc/include/asm/pkeys.h
@@ -1,6 +1,8 @@
 #ifndef _ASM_PPC64_PKEYS_H
 #define _ASM_PPC64_PKEYS_H
 
+#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS
+
 #include <asm/firmware.h>
 
 extern bool pkey_inited;
@@ -247,4 +249,7 @@ extern void thread_pkey_regs_restore(struct thread_struct *new_thread,
 			struct thread_struct *old_thread);
 extern void thread_pkey_regs_init(struct thread_struct *thread);
 extern void pkey_initialize(void);
+
+#endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */
+
 #endif /*_ASM_PPC64_PKEYS_H */

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-11 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-09 16:11 [PATCH] powerpc/memkey: fix compilation error caused by upstream changes Ram Pai
2017-10-10  9:00 ` Michael Ellerman
2017-10-10 16:19   ` Ram Pai
2017-10-10 16:22     ` [PATCH] powerpc/memkey: feature applies to PPC_BOOK3S_64 archs only Ram Pai
2017-10-11 10:50       ` Michael Ellerman

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).