mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] CONFIG_KMSAN breaks objtool and building of the kernel
@ 2026-06-16 22:14 Dmitry Voytik
  2026-06-17  7:48 ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Voytik @ 2026-06-16 22:14 UTC (permalink / raw)
  To: glider, jpoimboe; +Cc: kasan-dev, linux-kernel, peterz

Enabling CONFIG_KMSAN=y triggers the following build error:
make LLVM=1 -j(nproc)
  SYNC    include/config/auto.conf
  DESCEND objtool
  INSTALL libsubcmd_headers
  LD      vmlinux.o
vmlinux.o: warning: objtool: intel_pt_interrupt+0xde9: undefined stack state
vmlinux.o: warning: objtool: folio_zero_user+0x7cc: undefined stack state
vmlinux.o: error: objtool: intel_pt_interrupt+0xde4: unknown cfa base reg -1
make[2]: *** [scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
make[2]: *** Deleting file 'vmlinux.o'

↪ git log --oneline | head -n1
062871f1371b (HEAD -> master, origin/master, origin/HEAD) Merge tag
'pinctrl-v7.1-3' of
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

↪ clang --version
clang version 22.1.6
Target: x86_64-pc-linux-gnu

Please let me know if you need my .config (basically, it's the default
Arch Linux config + make oldconfg)

-- 
Best Regards,
Dmitry Voytik.
voytikd@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] CONFIG_KMSAN breaks objtool and building of the kernel
  2026-06-16 22:14 [BUG] CONFIG_KMSAN breaks objtool and building of the kernel Dmitry Voytik
@ 2026-06-17  7:48 ` Peter Zijlstra
  2026-06-17 18:47   ` Dmitry Voytik
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2026-06-17  7:48 UTC (permalink / raw)
  To: Dmitry Voytik; +Cc: glider, jpoimboe, kasan-dev, linux-kernel

On Wed, Jun 17, 2026 at 12:14:26AM +0200, Dmitry Voytik wrote:
> Enabling CONFIG_KMSAN=y triggers the following build error:
> make LLVM=1 -j(nproc)
>   SYNC    include/config/auto.conf
>   DESCEND objtool
>   INSTALL libsubcmd_headers
>   LD      vmlinux.o
> vmlinux.o: warning: objtool: intel_pt_interrupt+0xde9: undefined stack state
> vmlinux.o: warning: objtool: folio_zero_user+0x7cc: undefined stack state
> vmlinux.o: error: objtool: intel_pt_interrupt+0xde4: unknown cfa base reg -1
> make[2]: *** [scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
> make[2]: *** Deleting file 'vmlinux.o'
> 
> ↪ git log --oneline | head -n1
> 062871f1371b (HEAD -> master, origin/master, origin/HEAD) Merge tag
> 'pinctrl-v7.1-3' of
> git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
> 
> ↪ clang --version
> clang version 22.1.6
> Target: x86_64-pc-linux-gnu
> 
> Please let me know if you need my .config (basically, it's the default
> Arch Linux config + make oldconfg)

Using v7.1-2765-g6b5a2b7d9bc1, clang-22.1.0 (debian) and defconfig+KMSAN, I
cannot reproduce :/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] CONFIG_KMSAN breaks objtool and building of the kernel
  2026-06-17  7:48 ` Peter Zijlstra
@ 2026-06-17 18:47   ` Dmitry Voytik
  2026-06-18  8:46     ` Alexander Potapenko
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Voytik @ 2026-06-17 18:47 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: glider, jpoimboe, kasan-dev, linux-kernel

Hi Peter,

On Wed, Jun 17, 2026 at 9:48 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Jun 17, 2026 at 12:14:26AM +0200, Dmitry Voytik wrote:
> > Enabling CONFIG_KMSAN=y triggers the following build error:
> > make LLVM=1 -j(nproc)
> >   SYNC    include/config/auto.conf
> >   DESCEND objtool
> >   INSTALL libsubcmd_headers
> >   LD      vmlinux.o
> > vmlinux.o: warning: objtool: intel_pt_interrupt+0xde9: undefined stack state
> > vmlinux.o: warning: objtool: folio_zero_user+0x7cc: undefined stack state
> > vmlinux.o: error: objtool: intel_pt_interrupt+0xde4: unknown cfa base reg -1
> > make[2]: *** [scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
> > make[2]: *** Deleting file 'vmlinux.o'
> >
> > ↪ git log --oneline | head -n1
> > 062871f1371b (HEAD -> master, origin/master, origin/HEAD) Merge tag
> > 'pinctrl-v7.1-3' of
> > git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
> >
> > ↪ clang --version
> > clang version 22.1.6
> > Target: x86_64-pc-linux-gnu
> >
> > Please let me know if you need my .config (basically, it's the default
> > Arch Linux config + make oldconfg)
>
> Using v7.1-2765-g6b5a2b7d9bc1, clang-22.1.0 (debian) and defconfig+KMSAN, I
> cannot reproduce :/

Thanks for double checking that.
Indeed, defconfig + KMSAN is OK.

It took me quite some time to narrow down the following combinations:
defconfig + CONFIG_KMSAN + CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
defconfig + CONFIG_KMSAN + CONFIG_DEBUG_INFO_DWARF4
defconfig + CONFIG_KMSAN + CONFIG_DEBUG_INFO_DWARF5

make mrproper
make LLVM=1 defconfig
./scripts/config -e CONFIG_KMSAN -e CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
make LLVM=1 olddefconfig
make LLVM=1 -j(nproc) vmlinux

vmlinux.o: warning: objtool: folio_zero_user+0x801: undefined stack state
vmlinux.o: error: objtool: folio_zero_user+0x801: unknown CFA base reg -1
make[2]: *** [scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
make[2]: *** Deleting file 'vmlinux.o'
make[1]: *** [/home/voyt/p/linux/Makefile:1326: vmlinux_o] Error 2
make: *** [Makefile:248: __sub-make] Error 2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] CONFIG_KMSAN breaks objtool and building of the kernel
  2026-06-17 18:47   ` Dmitry Voytik
@ 2026-06-18  8:46     ` Alexander Potapenko
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Potapenko @ 2026-06-18  8:46 UTC (permalink / raw)
  To: Dmitry Voytik; +Cc: Peter Zijlstra, jpoimboe, kasan-dev, linux-kernel

On Wed, Jun 17, 2026 at 8:47 PM Dmitry Voytik <voytikd@gmail.com> wrote:
>
> Hi Peter,
>
> On Wed, Jun 17, 2026 at 9:48 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Wed, Jun 17, 2026 at 12:14:26AM +0200, Dmitry Voytik wrote:
> > > Enabling CONFIG_KMSAN=y triggers the following build error:
> > > make LLVM=1 -j(nproc)
> > >   SYNC    include/config/auto.conf
> > >   DESCEND objtool
> > >   INSTALL libsubcmd_headers
> > >   LD      vmlinux.o
> > > vmlinux.o: warning: objtool: intel_pt_interrupt+0xde9: undefined stack state
> > > vmlinux.o: warning: objtool: folio_zero_user+0x7cc: undefined stack state
> > > vmlinux.o: error: objtool: intel_pt_interrupt+0xde4: unknown cfa base reg -1
> > > make[2]: *** [scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
> > > make[2]: *** Deleting file 'vmlinux.o'
> > >
> > > ↪ git log --oneline | head -n1
> > > 062871f1371b (HEAD -> master, origin/master, origin/HEAD) Merge tag
> > > 'pinctrl-v7.1-3' of
> > > git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
> > >
> > > ↪ clang --version
> > > clang version 22.1.6
> > > Target: x86_64-pc-linux-gnu
> > >
> > > Please let me know if you need my .config (basically, it's the default
> > > Arch Linux config + make oldconfg)
> >
> > Using v7.1-2765-g6b5a2b7d9bc1, clang-22.1.0 (debian) and defconfig+KMSAN, I
> > cannot reproduce :/
>
> Thanks for double checking that.
> Indeed, defconfig + KMSAN is OK.
>
> It took me quite some time to narrow down the following combinations:
> defconfig + CONFIG_KMSAN + CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> defconfig + CONFIG_KMSAN + CONFIG_DEBUG_INFO_DWARF4
> defconfig + CONFIG_KMSAN + CONFIG_DEBUG_INFO_DWARF5
>
> make mrproper
> make LLVM=1 defconfig
> ./scripts/config -e CONFIG_KMSAN -e CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> make LLVM=1 olddefconfig
> make LLVM=1 -j(nproc) vmlinux
>
> vmlinux.o: warning: objtool: folio_zero_user+0x801: undefined stack state
> vmlinux.o: error: objtool: folio_zero_user+0x801: unknown CFA base reg -1
> make[2]: *** [scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255
> make[2]: *** Deleting file 'vmlinux.o'
> make[1]: *** [/home/voyt/p/linux/Makefile:1326: vmlinux_o] Error 2
> make: *** [Makefile:248: __sub-make] Error 2

I could reproduce it on both 7.0 and 7.1, but it seems to be just
regular register pressure (caused by KMSAN instrumentation), not a
compiler bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-18  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-16 22:14 [BUG] CONFIG_KMSAN breaks objtool and building of the kernel Dmitry Voytik
2026-06-17  7:48 ` Peter Zijlstra
2026-06-17 18:47   ` Dmitry Voytik
2026-06-18  8:46     ` Alexander Potapenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox