From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45CA313C3F2 for ; Sat, 30 Nov 2024 11:13:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.228.1.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732965193; cv=none; b=TbssOI/WJ2dM9Klj9DMesuMDT+oN2xhFzZCvk5jUfF8o5rqktdJlravybFweiFiOvbo7f0daMph/5sHu90eh5g8rwHuI2q/I0yTg1LADX1J6Eso8O8cy8hvsBmozTMg4vIJFoxD5MnOXMBM13I01FSaJPXsi3jPPPxhENirYOj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732965193; c=relaxed/simple; bh=YKNR9pLpW36hs0Nl1FpqhkN3FbQPk3kXBJ4RXXHSqiA=; h=Date:From:To:Cc:Subject:Message-ID:References:Mime-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ly2toaaSmFb6yF9G9VGvKX2F5OepMeCAtmWOB//YXA0muuhVc/q/1YiH1lAPgTbJ+hr3Pq3tZXK65E1f2bna2HgoanpZFtqN9qak0xizsNY/AM3lNbdoFSpmRzvphMoq9HK4uBVMyX1Hw3g1p2v40rWWR/y8y+EbrESqPqVwkB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org; spf=pass smtp.mailfrom=kernel.crashing.org; arc=none smtp.client-ip=63.228.1.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 4AUBAfT4019243; Sat, 30 Nov 2024 05:10:41 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 4AUBAeUT019240; Sat, 30 Nov 2024 05:10:40 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Sat, 30 Nov 2024 05:10:40 -0600 From: Segher Boessenkool To: Linus Torvalds Cc: Jakub Jelinek , Peter Zijlstra , linux-toolchains@vger.kernel.org, x86@kernel.org Subject: Re: GCC 15 -fzero-init-padding-bits= option and redzone clobber Message-ID: <20241130111040.GR29862@gate.crashing.org> References: <20241129125238.GI24400@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-toolchains@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: User-Agent: Mutt/1.4.2.3i Hi! On Fri, Nov 29, 2024 at 10:21:13AM -0800, Linus Torvalds wrote: > On Fri, 29 Nov 2024 at 09:55, Linus Torvalds > wrote: > > > > This has happened with both gcc and clang, and telling the compiler > > that we need the stack pointer fixes it. I don't actually remember who > > told us to do that, but I think it was a gcc person. > > > > In fact, if I were a betting man, I would have thought it was you ;) > > Ahh, found it. Not you. Segher. Doing some archeology finds this: > > https://gcc.gnu.org/legacy-ml/gcc/2015-07/msg00080.html > > and even at the time, Segher suggested maybe having a separate "stack" > clobber. But obviously that wasn't available at the time, and afaik > has never happened. But that would not mean changing the stack pointer, writing to something on the stack instead. Something like this "redzone" thing maybe. I did say it would have to have precise semantics specified :-) > So we used that gcc suggestion, and it has worked fine for most of a > decade by now. Interesting. And I was even accused of being "clever" in that thread, wow! :-) But of course, GCC assumes there is a properly set up stack *everywhere*, it can in principle insert calls *anywhere*. So these asm constraints are totally superfluous anyway! (Input constraints do not say a reg is read, and output constraints do not say it is written to. Instead, they express the data flow, something that is actually useful to the compiler, and very much required as well). Segher