Hi all,
Today's linux-next merge of the arm64 tree got a conflict in:
include/linux/mm.h
between commit:
e87ec503cf2e ("mm/codetag: uninline and move pgalloc_tag_copy and pgalloc_tag_split")
from the mm-unstable branch of the mm tree and commit:
91e102e79740 ("prctl: arch-agnostic prctl for shadow stack")
from the arm64 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 include/linux/mm.h
index 086ba524d3ba,8852c39c7695..000000000000
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@@ -4166,4 -4174,65 +4178,8 @@@ static inline int do_mseal(unsigned lon
}
#endif
-#ifdef CONFIG_MEM_ALLOC_PROFILING
-static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order)
-{
- int i;
- struct alloc_tag *tag;
- unsigned int nr_pages = 1 << new_order;
-
- if (!mem_alloc_profiling_enabled())
- return;
-
- tag = pgalloc_tag_get(&folio->page);
- if (!tag)
- return;
-
- for (i = nr_pages; i < (1 << old_order); i += nr_pages) {
- union codetag_ref *ref = get_page_tag_ref(folio_page(folio, i));
-
- if (ref) {
- /* Set new reference to point to the original tag */
- alloc_tag_ref_set(ref, tag);
- put_page_tag_ref(ref);
- }
- }
-}
-
-static inline void pgalloc_tag_copy(struct folio *new, struct folio *old)
-{
- struct alloc_tag *tag;
- union codetag_ref *ref;
-
- tag = pgalloc_tag_get(&old->page);
- if (!tag)
- return;
-
- ref = get_page_tag_ref(&new->page);
- if (!ref)
- return;
-
- /* Clear the old ref to the original allocation tag. */
- clear_page_tag_ref(&old->page);
- /* Decrement the counters of the tag on get_new_folio. */
- alloc_tag_sub(ref, folio_nr_pages(new));
-
- __alloc_tag_ref_set(ref, tag);
-
- put_page_tag_ref(ref);
-}
-#else /* !CONFIG_MEM_ALLOC_PROFILING */
-static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order)
-{
-}
-
-static inline void pgalloc_tag_copy(struct folio *new, struct folio *old)
-{
-}
-#endif /* CONFIG_MEM_ALLOC_PROFILING */
-
+ int arch_get_shadow_stack_status(struct task_struct *t, unsigned long __user *status);
+ int arch_set_shadow_stack_status(struct task_struct *t, unsigned long status);
+ int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status);
+
#endif /* _LINUX_MM_H */
Hi all, On Mon, 28 Oct 2024 11:10:58 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Today's linux-next merge of the arm64 tree got a conflict in: > > include/linux/mm.h > > between commit: > > e87ec503cf2e ("mm/codetag: uninline and move pgalloc_tag_copy and pgalloc_tag_split") > > from the mm-unstable branch of the mm tree and commit: > > 91e102e79740 ("prctl: arch-agnostic prctl for shadow stack") > > from the arm64 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 include/linux/mm.h > index 086ba524d3ba,8852c39c7695..000000000000 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@@ -4166,4 -4174,65 +4178,8 @@@ static inline int do_mseal(unsigned lon > } > #endif > > -#ifdef CONFIG_MEM_ALLOC_PROFILING > -static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order) > -{ > - int i; > - struct alloc_tag *tag; > - unsigned int nr_pages = 1 << new_order; > - > - if (!mem_alloc_profiling_enabled()) > - return; > - > - tag = pgalloc_tag_get(&folio->page); > - if (!tag) > - return; > - > - for (i = nr_pages; i < (1 << old_order); i += nr_pages) { > - union codetag_ref *ref = get_page_tag_ref(folio_page(folio, i)); > - > - if (ref) { > - /* Set new reference to point to the original tag */ > - alloc_tag_ref_set(ref, tag); > - put_page_tag_ref(ref); > - } > - } > -} > - > -static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) > -{ > - struct alloc_tag *tag; > - union codetag_ref *ref; > - > - tag = pgalloc_tag_get(&old->page); > - if (!tag) > - return; > - > - ref = get_page_tag_ref(&new->page); > - if (!ref) > - return; > - > - /* Clear the old ref to the original allocation tag. */ > - clear_page_tag_ref(&old->page); > - /* Decrement the counters of the tag on get_new_folio. */ > - alloc_tag_sub(ref, folio_nr_pages(new)); > - > - __alloc_tag_ref_set(ref, tag); > - > - put_page_tag_ref(ref); > -} > -#else /* !CONFIG_MEM_ALLOC_PROFILING */ > -static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order) > -{ > -} > - > -static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) > -{ > -} > -#endif /* CONFIG_MEM_ALLOC_PROFILING */ > - > + int arch_get_shadow_stack_status(struct task_struct *t, unsigned long __user *status); > + int arch_set_shadow_stack_status(struct task_struct *t, unsigned long status); > + int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status); > + > #endif /* _LINUX_MM_H */ This is now a conflict between the mm-stable tree and Linus' tree. -- Cheers, Stephen Rothwell
On Tue, Nov 19, 2024 at 5:01 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Hi all, > > On Mon, 28 Oct 2024 11:10:58 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > Today's linux-next merge of the arm64 tree got a conflict in: > > > > include/linux/mm.h > > > > between commit: > > > > e87ec503cf2e ("mm/codetag: uninline and move pgalloc_tag_copy and pgalloc_tag_split") > > > > from the mm-unstable branch of the mm tree and commit: > > > > 91e102e79740 ("prctl: arch-agnostic prctl for shadow stack") > > > > from the arm64 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 include/linux/mm.h > > index 086ba524d3ba,8852c39c7695..000000000000 > > --- a/include/linux/mm.h > > +++ b/include/linux/mm.h > > @@@ -4166,4 -4174,65 +4178,8 @@@ static inline int do_mseal(unsigned lon > > } > > #endif > > > > -#ifdef CONFIG_MEM_ALLOC_PROFILING > > -static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order) > > -{ > > - int i; > > - struct alloc_tag *tag; > > - unsigned int nr_pages = 1 << new_order; > > - > > - if (!mem_alloc_profiling_enabled()) > > - return; > > - > > - tag = pgalloc_tag_get(&folio->page); > > - if (!tag) > > - return; > > - > > - for (i = nr_pages; i < (1 << old_order); i += nr_pages) { > > - union codetag_ref *ref = get_page_tag_ref(folio_page(folio, i)); > > - > > - if (ref) { > > - /* Set new reference to point to the original tag */ > > - alloc_tag_ref_set(ref, tag); > > - put_page_tag_ref(ref); > > - } > > - } > > -} > > - > > -static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) > > -{ > > - struct alloc_tag *tag; > > - union codetag_ref *ref; > > - > > - tag = pgalloc_tag_get(&old->page); > > - if (!tag) > > - return; > > - > > - ref = get_page_tag_ref(&new->page); > > - if (!ref) > > - return; > > - > > - /* Clear the old ref to the original allocation tag. */ > > - clear_page_tag_ref(&old->page); > > - /* Decrement the counters of the tag on get_new_folio. */ > > - alloc_tag_sub(ref, folio_nr_pages(new)); > > - > > - __alloc_tag_ref_set(ref, tag); > > - > > - put_page_tag_ref(ref); > > -} > > -#else /* !CONFIG_MEM_ALLOC_PROFILING */ > > -static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order) > > -{ > > -} > > - > > -static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) > > -{ > > -} > > -#endif /* CONFIG_MEM_ALLOC_PROFILING */ > > - > > + int arch_get_shadow_stack_status(struct task_struct *t, unsigned long __user *status); > > + int arch_set_shadow_stack_status(struct task_struct *t, unsigned long status); > > + int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status); > > + > > #endif /* _LINUX_MM_H */ > > This is now a conflict between the mm-stable tree and Linus' tree. Let me try to manually apply it to Linus' ToT and will send a replacement patch. > > -- > Cheers, > Stephen Rothwell
Hi Suren, On Tue, 19 Nov 2024 17:09:46 -0800 Suren Baghdasaryan <surenb@google.com> wrote: > > Let me try to manually apply it to Linus' ToT and will send a replacement patch. Please don't. Andrew will tell Linus about the conflict (he has done, I think) and Linus will just fix it up when he merges the mm-stable tree. -- Cheers, Stephen Rothwell
On Tue, Nov 19, 2024 at 6:57 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Hi Suren, > > On Tue, 19 Nov 2024 17:09:46 -0800 Suren Baghdasaryan <surenb@google.com> wrote: > > > > Let me try to manually apply it to Linus' ToT and will send a replacement patch. > > Please don't. Andrew will tell Linus about the conflict (he has done, > I think) and Linus will just fix it up when he merges the mm-stable > tree. Sounds good. I attached the promised patch in my previous reply but I guess it won't be needed. > > -- > Cheers, > Stephen Rothwell
On Tue, Nov 19, 2024 at 5:09 PM Suren Baghdasaryan <surenb@google.com> wrote: > > On Tue, Nov 19, 2024 at 5:01 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > Hi all, > > > > On Mon, 28 Oct 2024 11:10:58 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > > > > > Today's linux-next merge of the arm64 tree got a conflict in: > > > > > > include/linux/mm.h > > > > > > between commit: > > > > > > e87ec503cf2e ("mm/codetag: uninline and move pgalloc_tag_copy and pgalloc_tag_split") > > > > > > from the mm-unstable branch of the mm tree and commit: > > > > > > 91e102e79740 ("prctl: arch-agnostic prctl for shadow stack") > > > > > > from the arm64 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 include/linux/mm.h > > > index 086ba524d3ba,8852c39c7695..000000000000 > > > --- a/include/linux/mm.h > > > +++ b/include/linux/mm.h > > > @@@ -4166,4 -4174,65 +4178,8 @@@ static inline int do_mseal(unsigned lon > > > } > > > #endif > > > > > > -#ifdef CONFIG_MEM_ALLOC_PROFILING > > > -static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order) > > > -{ > > > - int i; > > > - struct alloc_tag *tag; > > > - unsigned int nr_pages = 1 << new_order; > > > - > > > - if (!mem_alloc_profiling_enabled()) > > > - return; > > > - > > > - tag = pgalloc_tag_get(&folio->page); > > > - if (!tag) > > > - return; > > > - > > > - for (i = nr_pages; i < (1 << old_order); i += nr_pages) { > > > - union codetag_ref *ref = get_page_tag_ref(folio_page(folio, i)); > > > - > > > - if (ref) { > > > - /* Set new reference to point to the original tag */ > > > - alloc_tag_ref_set(ref, tag); > > > - put_page_tag_ref(ref); > > > - } > > > - } > > > -} > > > - > > > -static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) > > > -{ > > > - struct alloc_tag *tag; > > > - union codetag_ref *ref; > > > - > > > - tag = pgalloc_tag_get(&old->page); > > > - if (!tag) > > > - return; > > > - > > > - ref = get_page_tag_ref(&new->page); > > > - if (!ref) > > > - return; > > > - > > > - /* Clear the old ref to the original allocation tag. */ > > > - clear_page_tag_ref(&old->page); > > > - /* Decrement the counters of the tag on get_new_folio. */ > > > - alloc_tag_sub(ref, folio_nr_pages(new)); > > > - > > > - __alloc_tag_ref_set(ref, tag); > > > - > > > - put_page_tag_ref(ref); > > > -} > > > -#else /* !CONFIG_MEM_ALLOC_PROFILING */ > > > -static inline void pgalloc_tag_split(struct folio *folio, int old_order, int new_order) > > > -{ > > > -} > > > - > > > -static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) > > > -{ > > > -} > > > -#endif /* CONFIG_MEM_ALLOC_PROFILING */ > > > - > > > + int arch_get_shadow_stack_status(struct task_struct *t, unsigned long __user *status); > > > + int arch_set_shadow_stack_status(struct task_struct *t, unsigned long status); > > > + int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status); > > > + > > > #endif /* _LINUX_MM_H */ > > > > This is now a conflict between the mm-stable tree and Linus' tree. > > Let me try to manually apply it to Linus' ToT and will send a replacement patch. Attached patch should apply to Linus' tree but please make sure the following two patches from mm-stable are merged before this one because there are dependencies between them: ed265529d39a mm/codetag: fix arg in pgalloc_tag_copy alloc_tag_sub 42895a861244 alloc_tag: introduce pgtag_ref_handle to abstract page tag references > > > > > -- > > Cheers, > > Stephen Rothwell
On Mon, Oct 28, 2024 at 11:10:58AM +1100, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the arm64 tree got a conflict in: > > include/linux/mm.h > > between commit: > > e87ec503cf2e ("mm/codetag: uninline and move pgalloc_tag_copy and pgalloc_tag_split") > > from the mm-unstable branch of the mm tree and commit: > > 91e102e79740 ("prctl: arch-agnostic prctl for shadow stack") > > from the arm64 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. This looks fine. Thanks. -- Catalin
On Mon, Oct 28, 2024 at 10:25 AM Catalin Marinas <catalin.marinas@arm.com> wrote: > > On Mon, Oct 28, 2024 at 11:10:58AM +1100, Stephen Rothwell wrote: > > Hi all, > > > > Today's linux-next merge of the arm64 tree got a conflict in: > > > > include/linux/mm.h > > > > between commit: > > > > e87ec503cf2e ("mm/codetag: uninline and move pgalloc_tag_copy and pgalloc_tag_split") > > > > from the mm-unstable branch of the mm tree and commit: > > > > 91e102e79740 ("prctl: arch-agnostic prctl for shadow stack") > > > > from the arm64 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. > > This looks fine. Thanks. Looks valid to me too. Thanks! > > -- > Catalin
© 2016 - 2024 Red Hat, Inc.