Skip to contentSkip to conversation

linux-next: build warning after merge of the mm tree

PATCH Stephen Rothwell 2 participants 3 messages Mar 20, 2023 – Mar 23, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the mm tree, today's linux-next build (sparc64 defconfig) produced this warning:

In file included from include/linux/wait.h:11,

                 from include/linux/swait.h:8,
                 from include/linux/completion.h:12,
                 from include/linux/mm_types.h:14,
                 from include/linux/uio.h:10,
                 from include/linux/vmalloc.h:12,
                 from include/asm-generic/io.h:994,
                 from arch/sparc/include/asm/io.h:22,
                 from arch/sparc/vdso/vclock_gettime.c:18:

arch/sparc/include/asm/current.h:18:30: warning: call-clobbered register used for global register variable
18 | register struct task_struct *current asm("g4");
| ^~~~~~~

I guess the immediate cause is commit

4e29dd9708cb ("mm: vmalloc: convert vread() to vread_iter()")

from the mm that included linux/uio.h into include/linux/vmalloc.h. Though there may be a deeper old cause that may need addressing in the longer term.

Indeed, this patch (obviously) makes the warning go away (and presumably speeds up the build ever so slightly :-)).

From: Stephen Rothwell <[email protected]>
Date: Mon, 20 Mar 2023 14:02:18 +1100
Subject: [PATCH] mm: vmalloc: fix sparc64 warning

This fixes this warning from a sparc64 defconfig build:

In file included from /home/sfr/next/next/include/linux/wait.h:11,

                 from /home/sfr/next/next/include/linux/swait.h:8,
                 from /home/sfr/next/next/include/linux/completion.h:12,
                 from /home/sfr/next/next/include/linux/mm_types.h:14,
                 from /home/sfr/next/next/include/linux/uio.h:10,
                 from /home/sfr/next/next/include/linux/vmalloc.h:12,
                 from /home/sfr/next/next/include/asm-generic/io.h:994,
                 from /home/sfr/next/next/arch/sparc/include/asm/io.h:22,
                 from /home/sfr/next/next/arch/sparc/vdso/vclock_gettime.c:18:

/home/sfr/next/next/arch/sparc/include/asm/current.h:18:30: warning: call-clobbered register used for global register variable
18 | register struct task_struct *current asm("g4");
| ^~~~~~~

Fixes 4e29dd9708cb ("mm: vmalloc: convert vread() to vread_iter()")
---
 include/linux/vmalloc.h | 2 +-
 mm/vmalloc.c            | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/vmalloc.h +1 -1
index 6beb2ace6a7a..c187c4d9bc33 100644
@@ -9,12 +9,12 @@
 #include <asm/page.h>		/* pgprot_t */
 #include <linux/rbtree.h>
 #include <linux/overflow.h>
-#include <linux/uio.h>
 
 #include <asm/vmalloc.h>
 
 struct vm_area_struct;		/* vma defining user mapping in mm_types.h */
 struct notifier_block;		/* in notifier.h */
+struct iov_iter;		/* in uio.h */
 
 /* bits in flags of vmalloc's vm_struct below */
 #define VM_IOREMAP		0x00000001	/* ioremap() and friends */
mm/vmalloc.c +1 -0
index f19509a6eef4..6e5647937dab 100644
@@ -40,6 +40,7 @@
 #include <linux/hugetlb.h>
 #include <linux/sched/mm.h>
 #include <linux/rwsem.h>
+#include <linux/uio.h>
 #include <asm/tlbflush.h>
 #include <asm/shmparam.h>
 
Signature · 5 lines
2.39.2

-- 
Cheers,
Stephen Rothwell
#1 lore raw

Hi all,

Quoted 13 lines · On Mon, 20 Mar 2023 14:47:21 +1100 Stephen Rothwell <[email protected]>…

After merging the mm tree, today's linux-next build (sparc64 defconfig) produced this warning:

In file included from include/linux/wait.h:11,

                 from include/linux/swait.h:8,
                 from include/linux/completion.h:12,
                 from include/linux/mm_types.h:14,
                 from include/linux/uio.h:10,
                 from include/linux/vmalloc.h:12,
                 from include/asm-generic/io.h:994,
                 from arch/sparc/include/asm/io.h:22,
                 from arch/sparc/vdso/vclock_gettime.c:18:
Quoted 3 lines

arch/sparc/include/asm/current.h:18:30: warning: call-clobbered register used for global register variable
18 | register struct task_struct *current asm("g4");
| ^~~~~~~

This has come back today. Did my fix up get dropped accidentally?

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#2 lore raw
Quoted 5 lines · On Thu, 23 Mar 2023 13:58:35 +1100 Stephen Rothwell <[email protected]>…
Quoted 3 lines

arch/sparc/include/asm/current.h:18:30: warning: call-clobbered register used for global register variable
18 | register struct task_struct *current asm("g4");
| ^~~~~~~

This has come back today. Did my fix up get dropped accidentally?

Yes, looks like Lorenzo didn't integrate that fixup when redoing. And I failed to check for that (I usually do...).