Received: by 2002:ac8:5491:0:b0:40f:fb00:664b with SMTP id h17csp608188qtq; Thu, 10 Aug 2023 10:22:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3ca80C84i3M259NHuo/7TVSW3/w6HyjSli5g36YeHWFSP1VHEEgamKKwE6YgYMaI7P67q X-Received: by 2002:a17:906:18a2:b0:99c:7301:4d69 with SMTP id c2-20020a17090618a200b0099c73014d69mr2695961ejf.20.1691688126645; Thu, 10 Aug 2023 10:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691688126; cv=none; d=google.com; s=arc-20160816; b=zVycYl5agGn8skxW+mu1m+DvW93vt42BkTCrpNbAZapdSqLe52idGQIbvmzaerUt+i Jxwd8Kz+jf+AGq+OqFpH5tc/ZW4mrUG9zFJfOzz4uD8BhOTRxc0jpmRVkoIuYjGZbKf4 RO/wrrV+e6BKGX9Rm12NFFpW05Qp3SQvVtOglw4c64eoNRszbv2c82wKHED+0Vkh3Uqp LVBBNNBhSjnczHKzBNSEulS0bletGeS6SeD4mxVuu0DSsG0TSI2u1rlF0wCEiPOPhO1U TicLZTmVYNH2Q9MM4cM2bGALIy2FHeWp0PYg4+S/Tjr9MdywM4wcjpgDuEa0FkVbmqEo 8FMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WVAlsPWeRahVvN8DZNo2xuJkxSmAadH1arYjafpapa4=; fh=xfAWAqAfX205dWUcwbPkJ2R1puUzDBUwGB2vLSxI14c=; b=ehQDVxCFvj4GFoHKd0WY3mRE4+vh5s83E8JTchvsFknYAobVv2zUzCCMamSMzTLMAw Pe59krWPe1FJk1xsV336Of74hvF+bV3a2nN9NlXdlKYtYly7Q5Q1rZKOYewfW2FZ1Cme dw031lqTv3IpAzP+dPL0cBTAirs15g1v0eVGjhWil0lNL5eacoKUkkKVDc7HeIoMtRvg d+xf8wIoAWF3bG6KEu/lPbsKiI/wFH6+CYbMv0VAkQ69UGBHRqDUFRLbFCT6O09G9pna ADU9jsmoGy9vPiImvNjXPlXESBC5STh/O374yTwBed36QZ+Cd1XCg6e0jUDIyifxiVQp 1RHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QBTjQqGM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a170906854e00b00992ae2a902dsi1875069ejy.786.2023.08.10.10.21.41; Thu, 10 Aug 2023 10:22:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QBTjQqGM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234890AbjHJQa0 (ORCPT + 99 others); Thu, 10 Aug 2023 12:30:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236289AbjHJQaX (ORCPT ); Thu, 10 Aug 2023 12:30:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A962728; Thu, 10 Aug 2023 09:30:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 982BB63C09; Thu, 10 Aug 2023 16:30:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBC34C433C7; Thu, 10 Aug 2023 16:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691685019; bh=6q/Y46TIpsSPhXSxrFEF/VLkfW3O+0fXt+mKjW7zycU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QBTjQqGMrvrEx1cPGNDE6eBGCUIGSu7QfnO9qJ2fxmYvkPqU3uHCMgyBgqQTf/an2 Z+gn6DD3Hyi2/XpbY+JVY1qMgaDWQl+2hnwz0tVPTFJ/aQbIQmVZ1kcfhhPjRdTHQE pJIv156HmhMPVc4rUaGTnBIRVcIwyce9fqtZavbwMLCcXcb+iIRAvB+N8r6TXlneb4 UD2iv++wxJLA1MWi34RB4oGLv7/wnHhRqPZEFzgBWFZI+EWK5VqP8eJGXk5oRzCMEx VVvgWtIxSwNXI117isSSjrqm7FKpRTocaPXB2KmulJEbsgbDl0ASgz97yEvHnqUTRR 0d2hwTU0pEbDg== Date: Thu, 10 Aug 2023 17:30:07 +0100 From: Mark Brown To: Szabolcs Nagy Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v4 03/36] arm64/gcs: Document the ABI for Guarded Control Stacks Message-ID: References: <20230807-arm64-gcs-v4-0-68cfa37f9069@kernel.org> <20230807-arm64-gcs-v4-3-68cfa37f9069@kernel.org> <4e215e53-c7d1-4338-8df9-3f9bf783ced9@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="N3GIhup1qS9ZN5af" Content-Disposition: inline In-Reply-To: X-Cookie: Reunite Gondwondaland! X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --N3GIhup1qS9ZN5af Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 10, 2023 at 02:34:04PM +0100, Szabolcs Nagy wrote: > The 08/10/2023 12:41, Mark Brown wrote: > > I agree that it's going to be excessive for pretty much all > > applications, I adjusted it to match x86 as part of the general effort > > to avoid divergence and because I was a bit concerned about non-PCS > > cases (eg, JITed code) potentially running into trouble, especially with > is that even possible? > 16byte alignment is not a convention but architectural: > access via unaligned sp traps (at least in userspace). > it is possible to use bl such that the stack is not involved > e.g. if there is no bl/ret pairing, but if we base the gcs > size on the stack size then i'd expect one stack frame per > bl/ret pair with 16byte alignment, or is there a programming > model possible that uses 8byte stack per bl? That's definitely what I'd expect most of the time. You'd need to be tracking what needs pushing in some other register but it's possible. Quite why you'd do this is a separate question, I think I'm being overly cautious worrying about anyone actually having done it but it wouldn't be the first time I was surprised by someone doing something unexpected. Like I say I think it's excessive and was erring on the side of being conservative. --N3GIhup1qS9ZN5af Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTVEI4ACgkQJNaLcl1U h9A4Awf/bx8Lj3RQIsL13zO6Rcr8idtjPSrfssjIBQQtk+Ytcou3d6I0srD7ZcYS KIOrfTZRe8dRpA45iRARURQA9vzzzeS2pMY0bviaHVPz0kbfeiJ8x/PXOgLOHMkX EV2us3XQYCNpiGAozGpIK5m8GntmZotF3bJtqK8PDxzf+ujeo361xNzQFcBX7js/ YNED0FhW8OeI/+z7ztalZM26vZw05bE2MwbJmazHCO6L/flUyNSyrk+otZdC71s0 UEVhosgX4Ba4KFRmDBvl5JiCIohdEI+k5S3vJOAZiLauPFRDQuFlrNvs1SGkHcMv WbwxA1SwHdT5GRMpJCXjvIAWhkckqg== =j9pJ -----END PGP SIGNATURE----- --N3GIhup1qS9ZN5af--