* Re: Build regressions/improvements in v4.17-rc1 [not found] <1523884165-17044-1-git-send-email-geert@linux-m68k.org> @ 2018-08-06 10:39 ` Geert Uytterhoeven 2018-08-06 22:54 ` Andrew Morton 0 siblings, 1 reply; 6+ messages in thread From: Geert Uytterhoeven @ 2018-08-06 10:39 UTC (permalink / raw) To: Linux Kernel Mailing List, Dan Williams, Michael Ellerman, Andrew Morton, linuxppc-dev CC Dan, Michael, AKPM, powerpc On Mon, Apr 16, 2018 at 3:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > Below is the list of build error/warning regressions/improvements in > v4.17-rc1[1] compared to v4.16[2]. I'd like to point your attention to: > + warning: vmlinux.o(.text+0x376518): Section mismatch in reference from the function .devm_memremap_pages() to the function .meminit.text:.arch_add_memory(): => N/A > + warning: vmlinux.o(.text+0x376d64): Section mismatch in reference from the function .devm_memremap_pages_release() to the function .meminit.text:.arch_remove_memory(): => N/A > + warning: vmlinux.o(.text+0x37dfd8): Section mismatch in reference from the function .devm_memremap_pages() to the function .meminit.text:.arch_add_memory(): => N/A > + warning: vmlinux.o(.text+0x37e824): Section mismatch in reference from the function .devm_memremap_pages_release() to the function .meminit.text:.arch_remove_memory(): => N/A > + warning: vmlinux.o(.text+0x3944): Section mismatch in reference from the variable start_here_multiplatform to the function .init.text:early_setup(): => N/A > + warning: vmlinux.o(.text+0x3978): Section mismatch in reference from the variable start_here_common to the function .init.text:start_kernel(): => N/A > + warning: vmlinux.o(.text+0x3a66c): Section mismatch in reference from the function mips_sc_init() to the function .init.text:mips_sc_probe_cm3(): => N/A > + warning: vmlinux.o(.text+0x3e9908): Section mismatch in reference from the function .devm_memremap_pages() to the function .meminit.text:.arch_add_memory(): => N/A > + warning: vmlinux.o(.text+0x3ea154): Section mismatch in reference from the function .devm_memremap_pages_release() to the function .meminit.text:.arch_remove_memory(): => N/A > + warning: vmlinux.o(.text+0x498dbc): Section mismatch in reference from the function hmm_devmem_release() to the function .meminit.text:arch_remove_memory(): => N/A > + warning: vmlinux.o(.text+0x499130): Section mismatch in reference from the function hmm_devmem_pages_create() to the function .meminit.text:arch_add_memory(): => N/A > + warning: vmlinux.o(.text+0x4a59ec): Section mismatch in reference from the function .hmm_devmem_release() to the function .meminit.text:.arch_remove_memory(): => N/A > + warning: vmlinux.o(.text+0x4a5d08): Section mismatch in reference from the function .hmm_devmem_pages_create() to the function .meminit.text:.arch_add_memory(): => N/A > + warning: vmlinux.o(.text+0x4ad8ac): Section mismatch in reference from the function .hmm_devmem_release() to the function .meminit.text:.arch_remove_memory(): => N/A > + warning: vmlinux.o(.text+0x4adbc8): Section mismatch in reference from the function .hmm_devmem_pages_create() to the function .meminit.text:.arch_add_memory(): => N/A > + warning: vmlinux.o(.text+0x4ca7238): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label(): => N/A > + warning: vmlinux.o(.text+0x51ffec): Section mismatch in reference from the function .hmm_devmem_release() to the function .meminit.text:.arch_remove_memory(): => N/A > + warning: vmlinux.o(.text+0x520308): Section mismatch in reference from the function .hmm_devmem_pages_create() to the function .meminit.text:.arch_add_memory(): => N/A These are still seen on v4.18-rc8 on various powerpc all{mod,yes}config builds. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Build regressions/improvements in v4.17-rc1 2018-08-06 10:39 ` Build regressions/improvements in v4.17-rc1 Geert Uytterhoeven @ 2018-08-06 22:54 ` Andrew Morton 2018-08-08 10:32 ` Michael Ellerman 0 siblings, 1 reply; 6+ messages in thread From: Andrew Morton @ 2018-08-06 22:54 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Linux Kernel Mailing List, Dan Williams, Michael Ellerman, linuxppc-dev On Mon, 6 Aug 2018 12:39:21 +0200 Geert Uytterhoeven <geert@linux-m68k.org> wrote: > CC Dan, Michael, AKPM, powerpc > > On Mon, Apr 16, 2018 at 3:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Below is the list of build error/warning regressions/improvements in > > v4.17-rc1[1] compared to v4.16[2]. > > I'd like to point your attention to: > > > + warning: vmlinux.o(.text+0x376518): Section mismatch in reference from the function .devm_memremap_pages() to the function .meminit.text:.arch_add_memory(): => N/A > > + warning: vmlinux.o(.text+0x376d64): Section mismatch in reference from the function .devm_memremap_pages_release() to the function .meminit.text:.arch_remove_memory(): => N/A hm. Dan isn't around at present so we're on our own with this one. x86 doesn't put arch_add_memory and arch_remove_memory into __meminit. x86 does #ifdef CONFIG_MEMORY_HOTPLUG int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap, bool want_memblock) { ... So I guess powerpc should do that as well? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Build regressions/improvements in v4.17-rc1 2018-08-06 22:54 ` Andrew Morton @ 2018-08-08 10:32 ` Michael Ellerman 2018-08-08 11:46 ` Mathieu Malaterre ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Michael Ellerman @ 2018-08-08 10:32 UTC (permalink / raw) To: Andrew Morton, Geert Uytterhoeven Cc: Linux Kernel Mailing List, Dan Williams, linuxppc-dev, npiggin Andrew Morton <akpm@linux-foundation.org> writes: > On Mon, 6 Aug 2018 12:39:21 +0200 Geert Uytterhoeven <geert@linux-m68k.org> wrote: > >> CC Dan, Michael, AKPM, powerpc >> >> On Mon, Apr 16, 2018 at 3:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: >> > Below is the list of build error/warning regressions/improvements in >> > v4.17-rc1[1] compared to v4.16[2]. >> >> I'd like to point your attention to: >> >> > + warning: vmlinux.o(.text+0x376518): Section mismatch in reference from the function .devm_memremap_pages() to the function .meminit.text:.arch_add_memory(): => N/A >> > + warning: vmlinux.o(.text+0x376d64): Section mismatch in reference from the function .devm_memremap_pages_release() to the function .meminit.text:.arch_remove_memory(): => N/A > > hm. Dan isn't around at present so we're on our own with this one. > > x86 doesn't put arch_add_memory and arch_remove_memory into __meminit. > x86 does > > #ifdef CONFIG_MEMORY_HOTPLUG > int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap, > bool want_memblock) > { > ... > > > So I guess powerpc should do that as well? But we only recently added it to fix a section mismatch warning: WARNING: vmlinux.o(.text+0x6da88): Section mismatch in reference from the function .arch_add_memory() to the function .meminit.text:.create_section_mapping() The function .arch_add_memory() references the function __meminit .create_section_mapping(). This is often because .arch_add_memory lacks a __meminit annotation or the annotation of .create_section_mapping is wrong. I think the problem is that the section mismatch logic isn't able to cope with __meminit's changing semantics. When CONFIG_MEMORY_HOTPLUG=y references from .text to .meminit.text should be allowed, because they're just folded in together in the linker script. When CONFIG_MEMORY_HOTPLUG=n references from .text to .meminit.text should NOT be allowed, because .meminit.text becomes .init.text and will be freed. I don't see anything in the section mismatch logic to cope with that difference. It looks like __meminit is saving us about 1K on powerpc, so I'm strongly inclined to just remove it entirely from arch/powerpc. Also I haven't been seeing this in my local builds because I have: CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y So I guess we need to work out why that's interfering with section mismatch analysis. cheers ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Build regressions/improvements in v4.17-rc1 2018-08-08 10:32 ` Michael Ellerman @ 2018-08-08 11:46 ` Mathieu Malaterre 2018-08-08 12:26 ` Geert Uytterhoeven 2018-08-08 13:16 ` Michael Ellerman 2 siblings, 0 replies; 6+ messages in thread From: Mathieu Malaterre @ 2018-08-08 11:46 UTC (permalink / raw) To: Michael Ellerman Cc: Andrew Morton, Geert Uytterhoeven, Dan Williams, linuxppc-dev, LKML, Nicholas Piggin On Wed, Aug 8, 2018 at 12:34 PM Michael Ellerman <mpe@ellerman.id.au> wrote: > > Andrew Morton <akpm@linux-foundation.org> writes: > > On Mon, 6 Aug 2018 12:39:21 +0200 Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > >> CC Dan, Michael, AKPM, powerpc > >> > >> On Mon, Apr 16, 2018 at 3:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > >> > Below is the list of build error/warning regressions/improvements in > >> > v4.17-rc1[1] compared to v4.16[2]. > >> > >> I'd like to point your attention to: > >> > >> > + warning: vmlinux.o(.text+0x376518): Section mismatch in reference from the function .devm_memremap_pages() to the function .meminit.text:.arch_add_memory(): => N/A > >> > + warning: vmlinux.o(.text+0x376d64): Section mismatch in reference from the function .devm_memremap_pages_release() to the function .meminit.text:.arch_remove_memory(): => N/A > > > > hm. Dan isn't around at present so we're on our own with this one. > > > > x86 doesn't put arch_add_memory and arch_remove_memory into __meminit. > > x86 does > > > > #ifdef CONFIG_MEMORY_HOTPLUG > > int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap, > > bool want_memblock) > > { > > ... > > > > > > So I guess powerpc should do that as well? > > But we only recently added it to fix a section mismatch warning: > > WARNING: vmlinux.o(.text+0x6da88): Section mismatch in reference from the function .arch_add_memory() to the function .meminit.text:.create_section_mapping() > The function .arch_add_memory() references > the function __meminit .create_section_mapping(). > This is often because .arch_add_memory lacks a __meminit > annotation or the annotation of .create_section_mapping is wrong. > > > I think the problem is that the section mismatch logic isn't able to > cope with __meminit's changing semantics. > > When CONFIG_MEMORY_HOTPLUG=y references from .text to .meminit.text > should be allowed, because they're just folded in together in the linker > script. > > When CONFIG_MEMORY_HOTPLUG=n references from .text to .meminit.text > should NOT be allowed, because .meminit.text becomes .init.text and will > be freed. > > I don't see anything in the section mismatch logic to cope with that > difference. > > It looks like __meminit is saving us about 1K on powerpc, so I'm > strongly inclined to just remove it entirely from arch/powerpc. > > Also I haven't been seeing this in my local builds because I have: > > CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y > > So I guess we need to work out why that's interfering with section > mismatch analysis. ... Well that's a good question actually. Section mismatch analysis is done on the throwaway vmlinux.o which is not linked with --gc-sections (and is not a final link), so the via_pmu_driver symbol should exist and be picked up. I wonder if something about the -ffunction-sections is breaking the reference detection. ... ref: https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg135431.html > > cheers ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Build regressions/improvements in v4.17-rc1 2018-08-08 10:32 ` Michael Ellerman 2018-08-08 11:46 ` Mathieu Malaterre @ 2018-08-08 12:26 ` Geert Uytterhoeven 2018-08-08 13:16 ` Michael Ellerman 2 siblings, 0 replies; 6+ messages in thread From: Geert Uytterhoeven @ 2018-08-08 12:26 UTC (permalink / raw) To: Michael Ellerman Cc: Andrew Morton, Linux Kernel Mailing List, Dan Williams, linuxppc-dev, Nicholas Piggin On Wed, Aug 8, 2018 at 12:32 PM Michael Ellerman <mpe@ellerman.id.au> wrote: > Also I haven't been seeing this in my local builds because I have: > > CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y > > So I guess we need to work out why that's interfering with section > mismatch analysis. One other common case of missing section mismatch warnings is when some versions of the compiler inline the called function, while other versions don't. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Build regressions/improvements in v4.17-rc1 2018-08-08 10:32 ` Michael Ellerman 2018-08-08 11:46 ` Mathieu Malaterre 2018-08-08 12:26 ` Geert Uytterhoeven @ 2018-08-08 13:16 ` Michael Ellerman 2 siblings, 0 replies; 6+ messages in thread From: Michael Ellerman @ 2018-08-08 13:16 UTC (permalink / raw) To: Andrew Morton, Geert Uytterhoeven Cc: Linux Kernel Mailing List, Dan Williams, linuxppc-dev, npiggin@gmail.com Michael Ellerman <mpe@ellerman.id.au> writes: > Andrew Morton <akpm@linux-foundation.org> writes: >> On Mon, 6 Aug 2018 12:39:21 +0200 Geert Uytterhoeven <geert@linux-m68k.org> wrote: >> >>> CC Dan, Michael, AKPM, powerpc >>> >>> On Mon, Apr 16, 2018 at 3:10 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: >>> > Below is the list of build error/warning regressions/improvements in >>> > v4.17-rc1[1] compared to v4.16[2]. >>> >>> I'd like to point your attention to: >>> >>> > + warning: vmlinux.o(.text+0x376518): Section mismatch in reference from the function .devm_memremap_pages() to the function .meminit.text:.arch_add_memory(): => N/A >>> > + warning: vmlinux.o(.text+0x376d64): Section mismatch in reference from the function .devm_memremap_pages_release() to the function .meminit.text:.arch_remove_memory(): => N/A >> >> hm. Dan isn't around at present so we're on our own with this one. >> >> x86 doesn't put arch_add_memory and arch_remove_memory into __meminit. >> x86 does >> >> #ifdef CONFIG_MEMORY_HOTPLUG >> int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap, >> bool want_memblock) >> { >> ... >> >> >> So I guess powerpc should do that as well? > > But we only recently added it to fix a section mismatch warning: > > WARNING: vmlinux.o(.text+0x6da88): Section mismatch in reference from the function .arch_add_memory() to the function .meminit.text:.create_section_mapping() > The function .arch_add_memory() references > the function __meminit .create_section_mapping(). > This is often because .arch_add_memory lacks a __meminit > annotation or the annotation of .create_section_mapping is wrong. > > > I think the problem is that the section mismatch logic isn't able to > cope with __meminit's changing semantics. > > When CONFIG_MEMORY_HOTPLUG=y references from .text to .meminit.text > should be allowed, because they're just folded in together in the linker > script. > > When CONFIG_MEMORY_HOTPLUG=n references from .text to .meminit.text > should NOT be allowed, because .meminit.text becomes .init.text and will > be freed. > > I don't see anything in the section mismatch logic to cope with that > difference. > > It looks like __meminit is saving us about 1K on powerpc, so I'm > strongly inclined to just remove it entirely from arch/powerpc. Gah that doesn't work. Our arch routines call things in mm/ that are __meminit, so we have to mark our code __meminit too, otherwise we get a section mismatch warning. cheers ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-08 13:16 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1523884165-17044-1-git-send-email-geert@linux-m68k.org> 2018-08-06 10:39 ` Build regressions/improvements in v4.17-rc1 Geert Uytterhoeven 2018-08-06 22:54 ` Andrew Morton 2018-08-08 10:32 ` Michael Ellerman 2018-08-08 11:46 ` Mathieu Malaterre 2018-08-08 12:26 ` Geert Uytterhoeven 2018-08-08 13:16 ` 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).