From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 815E1198A11 for ; Wed, 18 Dec 2024 10:08:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734516495; cv=none; b=r5OOO84piKyb5Aemi2x/CjQQXG1FPKoLoJxQapBjRbwZz+hxJtm1MTZPz6VvHrzfpXm3ex6VFdfANfxtldIYHd1ftFn4rWK9WV/RBSm85KG0fSyovYccQcgYKi1pasn2nlmm5KUiq1aahJvdbu0eSFPP86RvIDJ6gLYrlK/A2Bs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734516495; c=relaxed/simple; bh=qIh0xm5YnGl1ftEc4vlUbffVWrkEbyOyp36QrU+QImU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aIex+xvYNrKfoAH0i/hjM0e3i4fdQLfbvram/L6WKanr1od0zKz1UtnkUyI4ZWUhQM3IRdNbW+0KoskhDz7oyKQLf6aepoLb9skled6OZi9BDwoSJcCVjNvbiacI1N9NdIE5HO2npyz9wPXvAQBsO9WoOZAyqYgiWiyVAa9DeQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=kj667Yyb; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kj667Yyb" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/PUFTF2mSs/5SCMKQE6dUB4Yt6pWYvMBeSFB+gSTbJI=; b=kj667Yyb05rXf3u2wEj8vr8Rdi zGdXi+//DEZkyNEh1gFjycrdsEMVVJ0UfEga2V6cWm+iorudrcOpO9QnyDuGy3oivWTVbpBartC5W e4w923Ek4GbOwmK5TynEn4L1Pfx3EeX+OHj+f2Mof66R4vzyXAo/t5tGK/ahZrGKyiNlg8Y9//IXD a74XX84gSZaOgag46nc/Twu8YMUuPZNg/ElzHs+Qa+Lo81Ox1zYsRRhUiPigI5lZyq+YJc5+DczvF w/q8AizlChDDGj2yWPirqeN0gp6Q/uuCYMMupqNLMIpWisdMHcDn3lEC3auVZ0nVk2gR8spZnTYTG Yrf8j7xw==; Received: from 77-249-17-89.cable.dynamic.v4.ziggo.nl ([77.249.17.89] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tNqyS-00000005EFg-2Znu; Wed, 18 Dec 2024 10:08:12 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 2BBDA3002A0; Wed, 18 Dec 2024 11:08:12 +0100 (CET) Date: Wed, 18 Dec 2024 11:08:12 +0100 From: Peter Zijlstra To: Josh Poimboeuf Cc: Arnd Bergmann , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: "relocation to !ENDBR" objtool warnings Message-ID: <20241218100812.GJ11133@noisy.programming.kicks-ass.net> References: <33f3a0a3-a929-4584-af81-6e020671d428@app.fastmail.com> <710349fd-08df-444f-b8c6-86b1249810df@app.fastmail.com> <20241218084729.mluqut2jqp57ckwa@jpoimboe> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241218084729.mluqut2jqp57ckwa@jpoimboe> On Wed, Dec 18, 2024 at 12:47:29AM -0800, Josh Poimboeuf wrote: > On Tue, Dec 17, 2024 at 10:09:56AM +0100, Arnd Bergmann wrote: > > On Tue, Dec 17, 2024, at 09:54, Arnd Bergmann wrote: > > > > > > 00000000000000f0 : > > > f0: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) > > > f7: 00 00 00 00 > > > fb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) > > > 100: f3 0f 1e fa endbr64 > > > > > > I had one more look at the assembler file created by gcc and found > > that this is a 16-byte nop: > > > > .align 16 > > .globl stpcpy > > .type stpcpy, @function > > stpcpy: > > .p2align 5 > > endbr64 > > .L30: > > movzbl (%rsi), %eax # MEM[(const char *)src_8 + -1B], _1 > > movq %rdi, %rdx # dest, > > addq $1, %rsi #, src > > addq $1, %rdi #, dest > > movb %al, -1(%rdi) # _1, MEM[(char *)dest_9 + -1B] > > testb %al, %al # _1 > > jne .L30 #, > > movq %rdx, %rax # , > > xorl %edx, %edx # > > xorl %esi, %esi # > > xorl %edi, %edi # > > ret > > .size stpcpy, .-stpcpy > > .align 16 > > > > No idea why it got inserted here, or why it only shows up in these > > two functions. Having a nop before the endbr is a compiler bug, right? > > Yeah, looks like a bug to me. Did you find https://gcc.gnu.org/PR116174 again?