From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FDD431352A for ; Tue, 30 Jun 2026 18:36:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782844617; cv=none; b=YHvhh5XOvJFlqxWkknP+XZBVFcpkwSncr0A87Bj8oq2iaJhqEpSSm+VD9nxq1wls6JHxMlesJgKUPoTz9QviG7WsyK3XJvkQV4VgW/DjPzsLlkWOVwUICC51yFI9qZC70d8DDiWQK/+LKWF6DbYMWB/9I681f2JOUNf1SoSmPc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782844617; c=relaxed/simple; bh=RDzySKIjcUY812TTnn8IvYL9PsJ2o6UNm7knRtTbMcE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=FRWD6EcVS3HCkHoMvxqFuQJiJskDYzZRz7gtl3dLMlczHmJbHILWohZnqdFA/IE1TtOwjfxoIkDhu33lmTmyZr/mW7fygjcR7hIxVRIxB/JyR6579XuaJNtc2Z37DxFpS0n5i+s17nog5RLllfpas+H7VXtasITQ2NY4zeE5PBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MZRx7VqP; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MZRx7VqP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E115C1F000E9; Tue, 30 Jun 2026 18:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782844615; bh=1m1PR921mnsj4TECq6NfnQY8tFEpzS/k9AtawFNjuvw=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MZRx7VqPT3BSLXSatuIeT3B9hLZG0Rk2itlA6dCyJPCzpR3z1XFYSegB6U/hB+EEG H609hdQe1Y24L9DCIGxFcjQXWOVhlqRKPTHygih4ozYbpad1ibH2cu7h7Ei8mkDC2x AlHiEqMlk+sf0taZh1jCVQ2HbArJ3+KCEtND6b4RBsRoIuQ3UV1Aa60dsLaUD/VJBx XCLeag2wuss/pENH3dhaGG5R8qbZOLgiYjgxgn2HWzIBcSMRNIPhxH28VmuusNcUGE vY8zRXtV5DPLIAtn31AIhPBHIx22olXSVQpdK7H8DtpC9Ebqv4DRiWgIUobmvNuuxy 0zLbklZbzob4g== From: Thomas Gleixner To: Peter Zijlstra , Dmitry Antipov , glider@google.com, elver@google.com, dvyukov@google.com Cc: Josh Poimboeuf , linux-kernel@vger.kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com Subject: Re: objtool: undefined stack state in folio_zero_user() In-Reply-To: <20260630135450.GA921102@noisy.programming.kicks-ass.net> References: <35822cf3c35fc6621621f858e94a2b0ce19abf88.camel@yandex.ru> <20260630104434.GC751831@noisy.programming.kicks-ass.net> <20260630135450.GA921102@noisy.programming.kicks-ass.net> Date: Tue, 30 Jun 2026 20:36:52 +0200 Message-ID: <87tsqjq3i3.ffs@fw13> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, Jun 30 2026 at 15:54, Peter Zijlstra wrote: > + KMSAN / clang folks > > On Tue, Jun 30, 2026 at 12:44:35PM +0200, Peter Zijlstra wrote: >> On Mon, Jun 22, 2026 at 04:23:46PM +0300, Dmitry Antipov wrote: >> > As of ef0c9f75a195 ("lib: Add stale 'raid6' directory to .gitignore file") >> > with clang 22.1.8 and KMSAN enabled, objtool stucks in folio_zero_user(): >> > >> > $ ./tools/objtool/objtool --hacks=jump_label --hacks=noinstr \ >> > --hacks=skylake --ibt --prefix=16 --orc --retpoline --rethunk \ >> > --static-call --uaccess --no-unreachable --noinstr --unret --link \ >> > vmlinux.o >> > vmlinux.o: warning: objtool: folio_zero_user+0x947: undefined stack state >> > vmlinux.o: error: objtool: folio_zero_user+0x947: unknown CFA base reg -1 >> > >> > Dmitry >> >> > 0000000001533940 : >> >> > 1534272: 48 89 e1 mov %rsp,%rcx >> > 1534275: 48 85 ed test %rbp,%rbp >> > 1534278: 8b 54 24 1c mov 0x1c(%rsp),%edx >> > 153427c: 0f 85 c2 00 00 00 jne 1534344 >> > 1534282: 31 c0 xor %eax,%eax >> > 1534284: 48 89 cc mov %rcx,%rsp >> > 1534287: 4c 89 f7 mov %r14,%rdi ;; HERE >> >> ... >> > 1534327: 48 89 64 24 78 mov %rsp,0x78(%rsp) >> ... >> > 153433a: 48 8b 4c 24 78 mov 0x78(%rsp),%rcx >> > 153433f: e9 31 ff ff ff jmp 1534275 >> >> >> This is well insane codegen, and I cannot blame objtool for hating on it >> -- in fact, I hate on it too. >> >> Let me try and figure out how best to fix this insane compiler output. > > > This seems to 'work', but it is somewhat yuck. It makes the build fail go away, but the resulting kernel compiled with clang22 refuses to boot. It stops here: [ 0.283753] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.433144] stackdepot: allocating hash table via alloc_large_system_hash [ 0.433656] stackdepot hash table entries: 524288 (order: 11, 8388608 bytes, linear) [ 0.435775] stackdepot: allocating space for 8192 stack pools via memblock [ 0.462747] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.463268] Starting KernelMemorySanitizer [ 0.463527] ATTENTION: KMSAN is a debugging tool! Do not use it on production machines! When I attach gdb to the VM then it sits in the ASM entry code of the page fault handler, but the stack looks damaged and it seems to loop somewhere around there forever. Haven't had time to dig into it further. .config is here: https://tglx.de/~tglx/config.fail Thanks, tglx