public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* clang/objtool failures on linux-next
@ 2026-03-06 12:41 Arnd Bergmann
  2026-03-06 17:30 ` Josh Poimboeuf
  2026-03-16 21:27 ` Arnd Bergmann
  0 siblings, 2 replies; 13+ messages in thread
From: Arnd Bergmann @ 2026-03-06 12:41 UTC (permalink / raw)
  To: Peter Zijlstra, Josh Poimboeuf, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

I came across two randconfig builds on linux-next that fail to build:

==> build/x86/0xCE0DD5F4_defconfig/log <==
drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: undefined stack state
drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: unknown CFA base reg -1

==> build/x86/0xAE77DEF6_defconfig/log <==
drivers/scsi/qla2xxx/qla_dbg.o: error: SIGSEGV: objtool stack overflow!
Segmentation fault

The first one happens with clang-18 through clang-22, the second one
with all versions of clang.

The crash seems worse at first, but I also noticed that
clang takes a long time to actually compile it, and the object
file is huge, so this is probably partially a compiler problem.

Please have a look at the attached object files along the configs
I used.

      Arnd

[-- Attachment #2: 0xAE77DEF6_qla_dbg.o.xz --]
[-- Type: application/x-xz, Size: 344820 bytes --]

[-- Attachment #3: 0xAE77DEF6_defconfig.xz --]
[-- Type: application/x-xz, Size: 40180 bytes --]

[-- Attachment #4: 0xCE0DD5F4_uinput.o.xz --]
[-- Type: application/x-xz, Size: 15580 bytes --]

[-- Attachment #5: 0xCE0DD5F4_defconfig.xz --]
[-- Type: application/x-xz, Size: 41940 bytes --]

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

* Re: clang/objtool failures on linux-next
  2026-03-06 12:41 clang/objtool failures on linux-next Arnd Bergmann
@ 2026-03-06 17:30 ` Josh Poimboeuf
  2026-03-06 18:29   ` Josh Poimboeuf
  2026-03-16 21:27 ` Arnd Bergmann
  1 sibling, 1 reply; 13+ messages in thread
From: Josh Poimboeuf @ 2026-03-06 17:30 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, linux-kernel

On Fri, Mar 06, 2026 at 01:41:59PM +0100, Arnd Bergmann wrote:
> I came across two randconfig builds on linux-next that fail to build:
> 
> ==> build/x86/0xCE0DD5F4_defconfig/log <==
> drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: undefined stack state
> drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: unknown CFA base reg -1
> 
> ==> build/x86/0xAE77DEF6_defconfig/log <==
> drivers/scsi/qla2xxx/qla_dbg.o: error: SIGSEGV: objtool stack overflow!
> Segmentation fault
> 
> The first one happens with clang-18 through clang-22, the second one
> with all versions of clang.
> 
> The crash seems worse at first, but I also noticed that
> clang takes a long time to actually compile it, and the object
> file is huge, so this is probably partially a compiler problem.
> 
> Please have a look at the attached object files along the configs
> I used.

Thanks, I'll post a fix for the 1st one right now (haven't looked at the
stack overflow yet).


-- 
Josh

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

* Re: clang/objtool failures on linux-next
  2026-03-06 17:30 ` Josh Poimboeuf
@ 2026-03-06 18:29   ` Josh Poimboeuf
  2026-03-06 21:02     ` Arnd Bergmann
  0 siblings, 1 reply; 13+ messages in thread
From: Josh Poimboeuf @ 2026-03-06 18:29 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, linux-kernel

On Fri, Mar 06, 2026 at 09:31:02AM -0800, Josh Poimboeuf wrote:
> On Fri, Mar 06, 2026 at 01:41:59PM +0100, Arnd Bergmann wrote:
> > I came across two randconfig builds on linux-next that fail to build:
> > 
> > ==> build/x86/0xCE0DD5F4_defconfig/log <==
> > drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: undefined stack state
> > drivers/input/misc/uinput.o: warning: objtool: uinput_str_to_user+0x165: unknown CFA base reg -1
> > 
> > ==> build/x86/0xAE77DEF6_defconfig/log <==
> > drivers/scsi/qla2xxx/qla_dbg.o: error: SIGSEGV: objtool stack overflow!
> > Segmentation fault
> > 
> > The first one happens with clang-18 through clang-22, the second one
> > with all versions of clang.
> > 
> > The crash seems worse at first, but I also noticed that
> > clang takes a long time to actually compile it, and the object
> > file is huge, so this is probably partially a compiler problem.
> > 
> > Please have a look at the attached object files along the configs
> > I used.
> 
> Thanks, I'll post a fix for the 1st one right now (haven't looked at the
> stack overflow yet).

Both fixes posted now:

https://lore.kernel.org/240e6a172cc73292499334a3724d02ccb3247fc7.1772818491.git.jpoimboe@kernel.org
https://lore.kernel.org/8b97f62d083457f3b0a29a424275f7957dd3372f.1772821683.git.jpoimboe@kernel.org

-- 
Josh

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

* Re: clang/objtool failures on linux-next
  2026-03-06 18:29   ` Josh Poimboeuf
@ 2026-03-06 21:02     ` Arnd Bergmann
  2026-03-06 21:17       ` Josh Poimboeuf
  2026-03-06 23:25       ` Nathan Chancellor
  0 siblings, 2 replies; 13+ messages in thread
From: Arnd Bergmann @ 2026-03-06 21:02 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: Peter Zijlstra, linux-kernel, Nathan Chancellor

On Fri, Mar 6, 2026, at 19:29, Josh Poimboeuf wrote:
> On Fri, Mar 06, 2026 at 09:31:02AM -0800, Josh Poimboeuf wrote:
>> On Fri, Mar 06, 2026 at 01:41:59PM +0100, Arnd Bergmann wrote:
>> 
>> Thanks, I'll post a fix for the 1st one right now (haven't looked at the
>> stack overflow yet).
>
> Both fixes posted now:
>
> https://lore.kernel.org/240e6a172cc73292499334a3724d02ccb3247fc7.1772818491.git.jpoimboe@kernel.org
> https://lore.kernel.org/8b97f62d083457f3b0a29a424275f7957dd3372f.1772821683.git.jpoimboe@kernel.org

Thanks a lot, that was quick!

I've applied both to my randconfig tree now and verified that
both issues are addressed in the full build. There is still
the question of the 0xAE77DEF6_defconfig causing an incredibly
long compile time (minutes!) for the one file when using clang.

I've added Nathan to Cc in case he is motivated to try to
reproduce this.

FWIW, this is the current set of objtool warnings that I get that
don't cause the build to fail:

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction
drivers/gpu/drm/msm/msm.o: warning: objtool: msm_gem_vm_close+0x1cf: unreachable instruction
drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind+0x32b: __stack_chk_fail() missing __noreturn in .c/.h or NORETURN() in noreturns.h
drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind_async+0x285: unreachable instruction
drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction
drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction
drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()
kernel/bpf/core.o: warning: objtool: ___bpf_prog_run+0x217: sibling call from callable instruction with modified stack frame
sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map()
vmlinux.o: warning: objtool: ___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6: hdmi_pll_compute() missing __noreturn in .c/.h or NORETURN() in noreturns.h

If you want to investigate those, I can send you the configs and/or
object files for these as well.

       Arnd

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

* Re: clang/objtool failures on linux-next
  2026-03-06 21:02     ` Arnd Bergmann
@ 2026-03-06 21:17       ` Josh Poimboeuf
  2026-03-06 22:04         ` Arnd Bergmann
  2026-03-06 23:25       ` Nathan Chancellor
  1 sibling, 1 reply; 13+ messages in thread
From: Josh Poimboeuf @ 2026-03-06 21:17 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, linux-kernel, Nathan Chancellor

On Fri, Mar 06, 2026 at 10:02:54PM +0100, Arnd Bergmann wrote:
> On Fri, Mar 6, 2026, at 19:29, Josh Poimboeuf wrote:
> > On Fri, Mar 06, 2026 at 09:31:02AM -0800, Josh Poimboeuf wrote:
> >> On Fri, Mar 06, 2026 at 01:41:59PM +0100, Arnd Bergmann wrote:
> >> 
> >> Thanks, I'll post a fix for the 1st one right now (haven't looked at the
> >> stack overflow yet).
> >
> > Both fixes posted now:
> >
> > https://lore.kernel.org/240e6a172cc73292499334a3724d02ccb3247fc7.1772818491.git.jpoimboe@kernel.org
> > https://lore.kernel.org/8b97f62d083457f3b0a29a424275f7957dd3372f.1772821683.git.jpoimboe@kernel.org
> 
> Thanks a lot, that was quick!
> 
> I've applied both to my randconfig tree now and verified that
> both issues are addressed in the full build. There is still
> the question of the 0xAE77DEF6_defconfig causing an incredibly
> long compile time (minutes!) for the one file when using clang.
> 
> I've added Nathan to Cc in case he is motivated to try to
> reproduce this.
> 
> FWIW, this is the current set of objtool warnings that I get that
> don't cause the build to fail:
> 
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction
> drivers/gpu/drm/msm/msm.o: warning: objtool: msm_gem_vm_close+0x1cf: unreachable instruction
> drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind+0x32b: __stack_chk_fail() missing __noreturn in .c/.h or NORETURN() in noreturns.h
> drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind_async+0x285: unreachable instruction
> drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction
> drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction
> drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()
> kernel/bpf/core.o: warning: objtool: ___bpf_prog_run+0x217: sibling call from callable instruction with modified stack frame
> sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map()
> vmlinux.o: warning: objtool: ___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
> vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6: hdmi_pll_compute() missing __noreturn in .c/.h or NORETURN() in noreturns.h
> 
> If you want to investigate those, I can send you the configs and/or
> object files for these as well.

Yes, please send those and I'll take a look.  Thanks!

-- 
Josh

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

* Re: clang/objtool failures on linux-next
  2026-03-06 21:17       ` Josh Poimboeuf
@ 2026-03-06 22:04         ` Arnd Bergmann
  2026-03-07  1:35           ` Josh Poimboeuf
  2026-03-07  1:37           ` Josh Poimboeuf
  0 siblings, 2 replies; 13+ messages in thread
From: Arnd Bergmann @ 2026-03-06 22:04 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: Peter Zijlstra, linux-kernel, Nathan Chancellor

[-- Attachment #1: Type: text/plain, Size: 2590 bytes --]

On Fri, Mar 6, 2026, at 22:17, Josh Poimboeuf wrote:
> On Fri, Mar 06, 2026 at 10:02:54PM +0100, Arnd Bergmann wrote:
>> 
>> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction
>> drivers/gpu/drm/msm/msm.o: warning: objtool: msm_gem_vm_close+0x1cf: unreachable instruction
>> drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind+0x32b: __stack_chk_fail() missing __noreturn in .c/.h or NORETURN() in noreturns.h
>> drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind_async+0x285: unreachable instruction
>> drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction
>> drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction
>> drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()
>> kernel/bpf/core.o: warning: objtool: ___bpf_prog_run+0x217: sibling call from callable instruction with modified stack frame
>> sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map()
>> vmlinux.o: warning: objtool: ___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
>> vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6: hdmi_pll_compute() missing __noreturn in .c/.h or NORETURN() in noreturns.h
>> 
>> If you want to investigate those, I can send you the configs and/or
>> object files for these as well.
>
> Yes, please send those and I'll take a look.  Thanks!

These are the ones I could easily reproduce on today's linux-next:

==> build/x86/0xCE0DD5F4_defconfig/log <==
vmlinux.o: warning: objtool: ___bpf_prog_run+0x1c5: sibling call from callable instruction with modified stack frame

==> build/x86/0x8FD83285_defconfig/log <==
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction
drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction
drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction
drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()

==> build/x86/0x4DF22811_defconfig/log <==
sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map()

     Arnd


[-- Attachment #2: objtool-warnings.tar.gz --]
[-- Type: application/gzip, Size: 457763 bytes --]

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

* Re: clang/objtool failures on linux-next
  2026-03-06 21:02     ` Arnd Bergmann
  2026-03-06 21:17       ` Josh Poimboeuf
@ 2026-03-06 23:25       ` Nathan Chancellor
  1 sibling, 0 replies; 13+ messages in thread
From: Nathan Chancellor @ 2026-03-06 23:25 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Josh Poimboeuf, Peter Zijlstra, linux-kernel

On Fri, Mar 06, 2026 at 10:02:54PM +0100, Arnd Bergmann wrote:
> I've added Nathan to Cc in case he is motivated to try to
> reproduce this.

Yeah, I will see if I can get something reproduced for the LLVM folks to
take a look at upstream. Most of the time it ends up being something
small and dumb :)

Cheers,
Nathan

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

* Re: clang/objtool failures on linux-next
  2026-03-06 22:04         ` Arnd Bergmann
@ 2026-03-07  1:35           ` Josh Poimboeuf
  2026-03-09 21:15             ` Nathan Chancellor
  2026-03-07  1:37           ` Josh Poimboeuf
  1 sibling, 1 reply; 13+ messages in thread
From: Josh Poimboeuf @ 2026-03-07  1:35 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, linux-kernel, Nathan Chancellor

On Fri, Mar 06, 2026 at 11:04:50PM +0100, Arnd Bergmann wrote:
> ==> build/x86/0x8FD83285_defconfig/log <==
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction
> drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction
> drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction

These three warnings are accurate, for each of these, Clang is leaving
an unreachable JMP at the end of the function:

    166e:	4c 89 ea             	mov    %r13,%rdx
    1671:	e8 00 00 00 00       	call   1676 <amdgpu_cs_parser_bos+0x716>	1672: R_X86_64_PLT32	__ubsan_handle_shift_out_of_bounds-0x4
    1676:	49 8b 94 24 08 1d 01 00 	mov    0x11d08(%r12),%rdx
    167e:	e9 c6 fd ff ff       	jmp    1449 <amdgpu_cs_parser_bos+0x4e9>
    1683:	e9 8c f9 ff ff       	jmp    1014 <amdgpu_cs_parser_bos+0xb4>
    1688:	0f 1f 84 00 00 00 00 00 	nopl   0x0(%rax,%rax,1)

Nathan, any idea?  I haven't seen this pattern before.

-- 
Josh

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

* Re: clang/objtool failures on linux-next
  2026-03-06 22:04         ` Arnd Bergmann
  2026-03-07  1:35           ` Josh Poimboeuf
@ 2026-03-07  1:37           ` Josh Poimboeuf
  1 sibling, 0 replies; 13+ messages in thread
From: Josh Poimboeuf @ 2026-03-07  1:37 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, linux-kernel, Nathan Chancellor

On Fri, Mar 06, 2026 at 11:04:50PM +0100, Arnd Bergmann wrote:
> On Fri, Mar 6, 2026, at 22:17, Josh Poimboeuf wrote:
> > On Fri, Mar 06, 2026 at 10:02:54PM +0100, Arnd Bergmann wrote:
> >> 
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction
> >> drivers/gpu/drm/msm/msm.o: warning: objtool: msm_gem_vm_close+0x1cf: unreachable instruction
> >> drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind+0x32b: __stack_chk_fail() missing __noreturn in .c/.h or NORETURN() in noreturns.h
> >> drivers/gpu/drm/panthor/panthor.o: warning: objtool: panthor_ioctl_vm_bind_async+0x285: unreachable instruction
> >> drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction
> >> drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction
> >> drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()
> >> kernel/bpf/core.o: warning: objtool: ___bpf_prog_run+0x217: sibling call from callable instruction with modified stack frame
> >> sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map()
> >> vmlinux.o: warning: objtool: ___bpf_prog_run+0x1d4: sibling call from callable instruction with modified stack frame
> >> vmlinux.o: warning: objtool: hdmi_power_on_full.isra.0+0xd6: hdmi_pll_compute() missing __noreturn in .c/.h or NORETURN() in noreturns.h
> >> 
> >> If you want to investigate those, I can send you the configs and/or
> >> object files for these as well.
> >
> > Yes, please send those and I'll take a look.  Thanks!
> 
> These are the ones I could easily reproduce on today's linux-next:
> 
> ==> build/x86/0xCE0DD5F4_defconfig/log <==
> vmlinux.o: warning: objtool: ___bpf_prog_run+0x1c5: sibling call from callable instruction with modified stack frame
> 
> ==> build/x86/0x8FD83285_defconfig/log <==
> ...
> drivers/iio/imu/bmi160/bmi160_core.o: warning: objtool: bmi160_setup_irq() falls through to next function __cfi_bmi160_core_runtime_resume()
> 
> ==> build/x86/0x4DF22811_defconfig/log <==
> sound/soc/codecs/wcd9335.o: warning: objtool: wcd9335_slimbus_irq() falls through to next function __cfi_wcd9335_set_channel_map()

I have fixes for these 3, will post the lot soonish.

-- 
Josh

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

* Re: clang/objtool failures on linux-next
  2026-03-07  1:35           ` Josh Poimboeuf
@ 2026-03-09 21:15             ` Nathan Chancellor
  2026-03-09 21:27               ` Arnd Bergmann
  0 siblings, 1 reply; 13+ messages in thread
From: Nathan Chancellor @ 2026-03-09 21:15 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: Arnd Bergmann, Peter Zijlstra, linux-kernel

On Fri, Mar 06, 2026 at 05:35:20PM -0800, Josh Poimboeuf wrote:
> On Fri, Mar 06, 2026 at 11:04:50PM +0100, Arnd Bergmann wrote:
> > ==> build/x86/0x8FD83285_defconfig/log <==
> > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o: warning: objtool: amdgpu_cs_parser_bos+0x723: unreachable instruction
> > drivers/gpu/drm/xe/xe_bo.o: warning: objtool: xe_bo_create_pin_map_at_novm+0x11d: unreachable instruction
> > drivers/gpu/drm/panthor/panthor_drv.o: warning: objtool: panthor_ioctl_vm_bind+0x2df: unreachable instruction
> 
> These three warnings are accurate, for each of these, Clang is leaving
> an unreachable JMP at the end of the function:
> 
>     166e:	4c 89 ea             	mov    %r13,%rdx
>     1671:	e8 00 00 00 00       	call   1676 <amdgpu_cs_parser_bos+0x716>	1672: R_X86_64_PLT32	__ubsan_handle_shift_out_of_bounds-0x4
>     1676:	49 8b 94 24 08 1d 01 00 	mov    0x11d08(%r12),%rdx
>     167e:	e9 c6 fd ff ff       	jmp    1449 <amdgpu_cs_parser_bos+0x4e9>
>     1683:	e9 8c f9 ff ff       	jmp    1014 <amdgpu_cs_parser_bos+0xb4>
>     1688:	0f 1f 84 00 00 00 00 00 	nopl   0x0(%rax,%rax,1)
> 
> Nathan, any idea?  I haven't seen this pattern before.

This seems pretty similar to

  https://github.com/ClangBuiltLinux/linux/issues/2130
  https://github.com/llvm/llvm-project/issues/167774

as they all use drm_exec_until_all_locked(). Justin fixed this in main
(23.0.0) and it was backported to 22.1.0:

  https://github.com/llvm/llvm-project/commit/404920838836a022b0ae4b9a462befba89ee0cdc
  https://github.com/llvm/llvm-project/commit/2fb8921a7c70b264f670569ac319d1c96e9f5acc

I don't think Arnd has that fix based on the .comment section:

  Debian clang version 22.0.0 (++20251025104945+e219cf60598c-1~exp1~20251025225011.1789)

I don't see a configuration file for these so I cannot verify that they
are actually fixed with a newer version of clang.

Unfortunately, the problematic change landed in the 21.1.0 release so
that version will still see these warnings. I am guessing it is probably
not too easy to workaround this in objtool though, so maybe we will just
have to live with them?

Cheers,
Nathan

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

* Re: clang/objtool failures on linux-next
  2026-03-09 21:15             ` Nathan Chancellor
@ 2026-03-09 21:27               ` Arnd Bergmann
  0 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2026-03-09 21:27 UTC (permalink / raw)
  To: Nathan Chancellor, Josh Poimboeuf; +Cc: Peter Zijlstra, linux-kernel

On Mon, Mar 9, 2026, at 22:15, Nathan Chancellor wrote:
> On Fri, Mar 06, 2026 at 05:35:20PM -0800, Josh Poimboeuf wrote:
>> On Fri, Mar 06, 2026 at 11:04:50PM +0100, Arnd Bergmann wrote:

> I don't think Arnd has that fix based on the .comment section:
>
>   Debian clang version 22.0.0 
> (++20251025104945+e219cf60598c-1~exp1~20251025225011.1789)
>

Correct, I am still using the apt.llvm.org packages on arm64, and
those don't have clang-23 packages yet. I should probably start
using your builds instead.

    Arnd

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

* Re: clang/objtool failures on linux-next
  2026-03-06 12:41 clang/objtool failures on linux-next Arnd Bergmann
  2026-03-06 17:30 ` Josh Poimboeuf
@ 2026-03-16 21:27 ` Arnd Bergmann
  2026-03-17  0:29   ` Josh Poimboeuf
  1 sibling, 1 reply; 13+ messages in thread
From: Arnd Bergmann @ 2026-03-16 21:27 UTC (permalink / raw)
  To: Peter Zijlstra, Josh Poimboeuf, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

I've found two more objtool related build failures on today's linux-next.

See attachment for .config and object files.

==> build/x86/0x8F5E6B2F_defconfig/log <==
mm/memory.o: warning: objtool: folio_zero_user+0x69a: undefined stack state
mm/memory.o: error: objtool: folio_zero_user+0x69a: unknown CFA base reg -1
make[5]: *** [/home/arnd/arm-soc/scripts/Makefile.build:279: mm/memory.o] Error 255

==> build/x86/0xEC8A503_defconfig/log <==
vmlinux.o: warning: objtool: ___bpf_prog_run+0x202: sibling call from callable instruction with modified stack frame
vmlinux.o: warning: objtool: __x64_sys_get_mempolicy+0x1705: stack state mismatch: cfa1=4+288 cfa2=4+80
vmlinux.o: error: objtool: vmw_host_printf+0xd: unknown CFA base reg 0
make[4]: *** [/home/arnd/arm-soc/scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255

       Arnd

[-- Attachment #2: objtool-failures-next-20260316.tar.gz --]
[-- Type: application/gzip, Size: 884136 bytes --]

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

* Re: clang/objtool failures on linux-next
  2026-03-16 21:27 ` Arnd Bergmann
@ 2026-03-17  0:29   ` Josh Poimboeuf
  0 siblings, 0 replies; 13+ messages in thread
From: Josh Poimboeuf @ 2026-03-17  0:29 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Peter Zijlstra, linux-kernel

On Mon, Mar 16, 2026 at 10:27:44PM +0100, Arnd Bergmann wrote:
> I've found two more objtool related build failures on today's linux-next.
> 
> See attachment for .config and object files.
> 
> ==> build/x86/0x8F5E6B2F_defconfig/log <==
> mm/memory.o: warning: objtool: folio_zero_user+0x69a: undefined stack state
> mm/memory.o: error: objtool: folio_zero_user+0x69a: unknown CFA base reg -1
> make[5]: *** [/home/arnd/arm-soc/scripts/Makefile.build:279: mm/memory.o] Error 255

This is a clang issue we've seen before, where ASM_CALL_CONSTRAINT
causes clang to save/restore RSP around some inline asm.

The "fix" was going to be asm_call(), as discussed here with Linus:

  https://lore.kernel.org/174099976188.10177.7153571701278544000.tip-bot2@tip-bot2

I need to dust off those patches.

> ==> build/x86/0xEC8A503_defconfig/log <==
> vmlinux.o: warning: objtool: ___bpf_prog_run+0x202: sibling call from callable instruction with modified stack frame
> vmlinux.o: warning: objtool: __x64_sys_get_mempolicy+0x1705: stack state mismatch: cfa1=4+288 cfa2=4+80
> vmlinux.o: error: objtool: vmw_host_printf+0xd: unknown CFA base reg 0
> make[4]: *** [/home/arnd/arm-soc/scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 255

This one's easy, just need to add RAX to the ORC register list.  I will
post a fix shortly.

-- 
Josh

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

end of thread, other threads:[~2026-03-17  0:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 12:41 clang/objtool failures on linux-next Arnd Bergmann
2026-03-06 17:30 ` Josh Poimboeuf
2026-03-06 18:29   ` Josh Poimboeuf
2026-03-06 21:02     ` Arnd Bergmann
2026-03-06 21:17       ` Josh Poimboeuf
2026-03-06 22:04         ` Arnd Bergmann
2026-03-07  1:35           ` Josh Poimboeuf
2026-03-09 21:15             ` Nathan Chancellor
2026-03-09 21:27               ` Arnd Bergmann
2026-03-07  1:37           ` Josh Poimboeuf
2026-03-06 23:25       ` Nathan Chancellor
2026-03-16 21:27 ` Arnd Bergmann
2026-03-17  0:29   ` Josh Poimboeuf

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