From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A5CFC433EF for ; Wed, 27 Oct 2021 12:47:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB6E66103C for ; Wed, 27 Oct 2021 12:47:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240367AbhJ0MuR (ORCPT ); Wed, 27 Oct 2021 08:50:17 -0400 Received: from foss.arm.com ([217.140.110.172]:42982 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231542AbhJ0MuP (ORCPT ); Wed, 27 Oct 2021 08:50:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 046931FB; Wed, 27 Oct 2021 05:47:50 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.72.240]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 08DC73F73D; Wed, 27 Oct 2021 05:47:46 -0700 (PDT) Date: Wed, 27 Oct 2021 13:47:44 +0100 From: Mark Rutland Cc: Ard Biesheuvel , Peter Zijlstra , Frederic Weisbecker , LKML , James Morse , Quentin Perret , Catalin Marinas , Will Deacon Subject: Re: [PATCH 2/4] arm64: implement support for static call trampolines Message-ID: <20211027124744.GE54628@C02TD0UTHF1T.local> References: <20211025122102.46089-3-frederic@kernel.org> <20211026103655.GB30152@C02TD0UTHF1T.local> <7d807624275a4938871f8e433e510e3c@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7d807624275a4938871f8e433e510e3c@AcuMS.aculab.com> To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 11:06:11AM +0000, David Laight wrote: > From: Mark Rutland > > Sent: 26 October 2021 11:37 > ... > > My preference overall is to keep the trampoline self-contained, and I'd > > prefer to keep the RET inline in the trampoline rather than trying to > > factor it out so that all the control-flow is clearly in one place. > > > > So I'd prefer that we have the sequence as-is: > > > > | 0: .quad 0x0 > > | bti c > > | < insn > > > | ldr x16, 0b > > | cbz x16, 1f > > | br x16 > > | 1: ret > > What is wrong with: > 0: .quad 1f > bti c > < insn > > ldr x16, 0b > br x16 > 1: bti c > ret > > Self-contained and reasonably easy to read. FWIW, that would work for me too. Thanks, Mark.