Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1335386pxb; Tue, 26 Oct 2021 07:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykx1vllfj1u5FF/Xn5T+wTq9sCUk+n+nI8xYSdFE7KVNqlAfqabSmSFsP+VsepGXG05QuH X-Received: by 2002:a17:90b:1812:: with SMTP id lw18mr9878828pjb.9.1635257637215; Tue, 26 Oct 2021 07:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635257637; cv=none; d=google.com; s=arc-20160816; b=QPy+caGfiDTAljEdtx/44orG6f6hWxm6Hb1D1bgXcc0OtkTgJ8ri/JhFoWGsRGu3ww 2r8xRQ4IqzDpwtYr22A0r0CgT/8vr/iK17wpkws64y0xb8SmJ78a34U0LqgLyfzya/O1 BJqvcGnZBlv2U72Vbcrmv9qR6uqD6h1xOP5GNK+jUZnnQoElnU2eP4z9XMnluBNn90rq wnig/ocZh0445HjcyJaxA1cjquGCoEZtfZG9bhlKHpPduv8K1CBT+mJTA4/n2Uxh6vTM Iz0xrgi+Ig0jNegksNdP8GgRva6Q+2ESf7rpUCBtdeBOyhE0sNyfjL5EumgAbsM6xn2H Pzuw== 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=79uDAhKkdgC1LO3hXXD2cl32wcIP7RXhvSvVaoiulL4=; b=PP4rQ90o28KHdvoP7HFyuzBgQAnRk//ZDJZHxe8Mj580WwW32CgtaDbbTmaAt1Uzub fqslmjIXL+ulZxzPSL/JPlpD0CwXQ/Onpm2FGSiJ43bEk3gohaduYbq1A2WhTAYLpiHU xCn3D1rb4mgJPByXLZIenD9fHVdwHy+0AVeCPtm3K2F6dCuU86d78JPSqdf0OzY9+/vq x8v/sw8TTsp5D0VeAPSSCLU/pC63zEcArfoMxREm3GlfXF60oWfrNK8C2oZOwyEzUjVN uPUy5HLTdXnlVhxAwCjzsqpWZUJPXfUksJ3EnGFzyrQVwXRpYDYTFGVq+OcGkllhiuNs rMmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OgC5++Q8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si18416352pgi.588.2021.10.26.07.13.43; Tue, 26 Oct 2021 07:13:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OgC5++Q8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235186AbhJZKsa (ORCPT + 99 others); Tue, 26 Oct 2021 06:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231345AbhJZKs1 (ORCPT ); Tue, 26 Oct 2021 06:48:27 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6B87C061745 for ; Tue, 26 Oct 2021 03:46:03 -0700 (PDT) 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=79uDAhKkdgC1LO3hXXD2cl32wcIP7RXhvSvVaoiulL4=; b=OgC5++Q8ShbPv4yb8XShbxCmU0 XEmK3Xes1qJj10SMnF4HtfdgQIiU2fZjeOxmrdluoDlPXDJWiaFQNWPuByxp+OGh3gnn4aKL3FR6T mLCYJdIxYKvKqKbm6b60WumMpgf8Py0iGmB/eH3+QWXMjFTEBkPG++tGDUMhz6BQpDy16p96NUpei Vg+OgBKZht9SdLQniIgaYOKKgZsHe/YW6Fu+gE2QDN2TTzVD3thDqzf1QQ347P7fW7aAOtOG1z3hw d0+xJnj4pGM/TmXupkWb70bkuYyobvEzWQtoEOfI2OyC/Ft1QvKvgeicbLuHi2AaPLxS0d9owpR2p xTb4gr6Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfJxt-00CLIR-CM; Tue, 26 Oct 2021 10:45:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 105AA300288; Tue, 26 Oct 2021 12:45:55 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B0F342024464C; Tue, 26 Oct 2021 12:45:55 +0200 (CEST) Date: Tue, 26 Oct 2021 12:45:55 +0200 From: Peter Zijlstra To: Mark Rutland Cc: Ard Biesheuvel , Frederic Weisbecker , LKML , James Morse , David Laight , Quentin Perret , Catalin Marinas , Will Deacon Subject: Re: [PATCH 2/4] arm64: implement support for static call trampolines Message-ID: References: <20211025122102.46089-1-frederic@kernel.org> <20211025122102.46089-3-frederic@kernel.org> <20211026103655.GB30152@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211026103655.GB30152@C02TD0UTHF1T.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 11:36:55AM +0100, Mark Rutland wrote: > 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 OK, fair enough. In that case: Acked-by: Peter Zijlstra (Intel) Although I do think that function can use a comment to explain the magic involved. > If we knew these were only called with IRQs enabled (and so we can take > an IPI to generate a context synchronization event), we could patch > to a RET and point the literal back at the BTI, e.g. Given the static_call() usage on x86 I'm pretty sure you'll want them with IRQs disabled.