[PATCH] powerpc: Fix pud_mkwrite() definition after pte_mkwrite() API changes [was: Re: [GIT PULL] x86/shstk for 6.6-rc1]

Ingo Molnar posted 1 patch 2 years, 5 months ago
arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] powerpc: Fix pud_mkwrite() definition after pte_mkwrite() API changes [was: Re: [GIT PULL] x86/shstk for 6.6-rc1]
Posted by Ingo Molnar 2 years, 5 months ago

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, 30 Aug 2023 at 16:48, Dave Hansen <dave.hansen@linux.intel.com> wrote:
> >
> > Add x86 shadow stack support
> 
> I assume you are aware of the system call renumbering from linux-next,
> but I thought I'd mention it anyway. 452 was taken by fchmodat2, so
> your new map_shadow_stack() system call is merged as 453.
> 
> I do also note that it looks like the merge resolution of the
> _COMMON_PAGE_CHG_MASK bits in linux-next is wrong, and lost the
> _PAGE_DIRTY_BITS part in Ingo's -tip merge 783560d95e0e ("Merge branch
> 'x86/mm' into x86/merge, to ease integration testing").
> 
> Anyway, please do double-check my merge for correctness, and test it
> on some machine that hopefully supports this and has the
> infrastructure set up for it.

I believe there's one semantic conflict you missed, which breaks the powerpc64
build: recent changes to arch/powerpc/include/asm/book3s/64/pgtable.h created
a new semantic conflict due to the changes to the pte_mkwrite() API:

  161e393c0f63 ("mm: Make pte_mkwrite() take a VMA")

... resolved with the fix below.

Only build tested though.

The crossing upstream commit was:

  27af67f35631 ("powerpc/book3s64/mm: enable transparent pud hugepage")

Thanks,

	Ingo

Signed-off-by: Ingo Molnar <mingo@kernel.org>

 arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 136232a89739..5c497c862d75 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -931,7 +931,7 @@ static inline pte_t *pudp_ptep(pud_t *pud)
 #define pud_mkdirty(pud)	pte_pud(pte_mkdirty(pud_pte(pud)))
 #define pud_mkclean(pud)	pte_pud(pte_mkclean(pud_pte(pud)))
 #define pud_mkyoung(pud)	pte_pud(pte_mkyoung(pud_pte(pud)))
-#define pud_mkwrite(pud)	pte_pud(pte_mkwrite(pud_pte(pud)))
+#define pud_mkwrite(pud)	pte_pud(pte_mkwrite_novma(pud_pte(pud)))
 #define pud_write(pud)		pte_write(pud_pte(pud))
 
 #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY
Re: [PATCH] powerpc: Fix pud_mkwrite() definition after pte_mkwrite() API changes [was: Re: [GIT PULL] x86/shstk for 6.6-rc1]
Posted by Linus Torvalds 2 years, 5 months ago
On Thu, 31 Aug 2023 at 14:27, Ingo Molnar <mingo@kernel.org> wrote:
>
> I believe there's one semantic conflict you missed, which breaks the powerpc64
> build: recent changes to arch/powerpc/include/asm/book3s/64/pgtable.h created
> a new semantic conflict due to the changes to the pte_mkwrite() API:

Ack. Patch applied (with mightily changed commit message).

           Linus
[tip: x86/merge] powerpc: Fix pud_mkwrite() definition after pte_mkwrite() API changes
Posted by tip-bot2 for Ingo Molnar 2 years, 5 months ago
The following commit has been merged into the x86/merge branch of tip:

Commit-ID:     cc852156ee7cbd4c83dfd64e9b800f7932f867d0
Gitweb:        https://git.kernel.org/tip/cc852156ee7cbd4c83dfd64e9b800f7932f867d0
Author:        Ingo Molnar <mingo@kernel.org>
AuthorDate:    Thu, 31 Aug 2023 23:27:31 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Thu, 31 Aug 2023 23:32:39 +02:00

powerpc: Fix pud_mkwrite() definition after pte_mkwrite() API changes

I believe there's one semantic conflict we missed, which breaks the powerpc64
build: recent changes to arch/powerpc/include/asm/book3s/64/pgtable.h created
a new semantic conflict due to the changes to the pte_mkwrite() API:

  161e393c0f63 ("mm: Make pte_mkwrite() take a VMA")

... resolved with the fix below.

Only build tested though.

The crossing upstream commit was:

  27af67f35631 ("powerpc/book3s64/mm: enable transparent pud hugepage")

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/ZPEFw1XGrI69ZbJ6@gmail.com
--
 arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
 arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 136232a..5c497c8 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -931,7 +931,7 @@ static inline pte_t *pudp_ptep(pud_t *pud)
 #define pud_mkdirty(pud)	pte_pud(pte_mkdirty(pud_pte(pud)))
 #define pud_mkclean(pud)	pte_pud(pte_mkclean(pud_pte(pud)))
 #define pud_mkyoung(pud)	pte_pud(pte_mkyoung(pud_pte(pud)))
-#define pud_mkwrite(pud)	pte_pud(pte_mkwrite(pud_pte(pud)))
+#define pud_mkwrite(pud)	pte_pud(pte_mkwrite_novma(pud_pte(pud)))
 #define pud_write(pud)		pte_write(pud_pte(pud))
 
 #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY