Subject: Re: linux-next: manual merge of the risc-v tree with the mm-unstable tree

From: Andrew Morton <[email-masked]>
Date: Fri, 28 Nov 2025 10:24:33 -0800

On Fri, 28 Nov 2025 10:27:07 +1100 Stephen Rothwell <[email-masked]> wrote:

> Hi all,
> 
> Today's linux-next merge of the risc-v tree got a conflict in:
> 
>   include/linux/mm.h
> 
> between commit:
> 
>   554156bd610e ("mm: declare VMA flags by bit")
> 
> from the mm-unstable tree and commit:
> 
>   ae8460ac9db2 ("mm: add VM_SHADOW_STACK definition for riscv")
> 
> from the risc-v 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.

Thanks.  Looks like a huge mess, but in fact it's just this change,
from the riscv tree:

--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -380,6 +380,13 @@ extern unsigned int kobjsize(const void *objp);
 # define VM_SHADOW_STACK	VM_HIGH_ARCH_6
 #endif
 
+#if defined(CONFIG_RISCV_USER_CFI)
+/*
+ * Following x86 and picking up the same bitpos.
+ */
+# define VM_SHADOW_STACK	VM_HIGH_ARCH_5
+#endif
+
 #ifndef VM_SHADOW_STACK
 # define VM_SHADOW_STACK	VM_NONE
 #endif

which should be simple for Linus to resolve.