Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D6ECC433DF for ; Mon, 19 Oct 2020 17:07:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8AF37205ED for ; Mon, 19 Oct 2020 17:07:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="x0k823lj"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dNBmb+Vs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AF37205ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VnjC5roowbeUtHaVN9/q/3veUc7hKTBLk+w3zoU23cA=; b=x0k823ljPPYkQ3JfiOM4imBrY ofK67a158ZMN1A+j0SLP6vG3qoMqidSKgZNHML1LpRiPHZfICe3Yb0x3teeqSmMLIjM7VFSzHnhU5 s5BtXAgwTrC3apED7ykwwzaoVeKr1m1aICx/Awel6DacEcNc+j79tiIs8MlnKtl89dZ62So3h+goZ LJ+eJ9Jp9zz+Fh+5cJKuB8V0xTWpAGLRjmnBtBsMJdHcd/aQbfXm3NOC2qqhQ+zf12XCfs+t2hKbL xboIAF784+V7MeawN6v77xSD1IYn5+AT5cF4wd46WJJ1V0tQJHDc4PlmkkeGLzaq3qDAfgMBYS/Cz sIQnmH6Hg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUYbb-0007kc-62; Mon, 19 Oct 2020 17:05:55 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUYbY-0007kJ-U8 for linux-arm-kernel@merlin.infradead.org; Mon, 19 Oct 2020 17:05:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=UO2kzxbWCUBE+qzNLwIgq4kLso3MqtNAioIfXIX8qPo=; b=dNBmb+VsRDJjnXYF/4E7i4gA7O aXRHinj10bwAaG99pUYi2xdpzDQVGfT3Ho+4lxgjzJJRztOEE5gV1Z50+5AGnbElEAKPsp52mKFjc auqICEPxqYie4wdmcj3MSAlI8dL6WqQ8QmgK5kN5hWBywy4MGGY1d/DBQqieDkKUUZSC3Yn9Y4x4a dLevNVaZ62DAL2gy11BxKqByP05s7h3oMx2CoklayoPWZExZUzWhm6pInYQpBTAEkumFg3lvcx5Wr WJNmrnMrhEMQsJOpNi4azu/+M6aG1XKB7Q5DsT0RGlbK/NalHbuAkAY6cojZ6QuLOFcOhsCk5qZE7 rNGorZnA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUYbX-0006mf-Ib; Mon, 19 Oct 2020 17:05:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7D7D83060C5; Mon, 19 Oct 2020 19:05:50 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4D64320417E0D; Mon, 19 Oct 2020 19:05:50 +0200 (CEST) Date: Mon, 19 Oct 2020 19:05:50 +0200 From: Peter Zijlstra To: Ard Biesheuvel Subject: Re: [PATCH] arm64: implement support for static call trampolines Message-ID: <20201019170550.GR2611@hirez.programming.kicks-ass.net> References: <20201019141247.25122-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201019141247.25122-1-ardb@kernel.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com, broonie@kernel.org, will@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 19, 2020 at 04:12:47PM +0200, Ard Biesheuvel wrote: > Implement arm64 support for the 'unoptimized' static call variety, > which routes all calls through a single trampoline that is patched > to perform a tail call to the selected function. > > Since static call targets may be located in modules loaded out of > direct branching range, we need to be able to fall back to issuing > a ADRP/ADD pair to load the branch target into R16 and use a BR > instruction. As this involves patching more than a single B or NOP > instruction (for which the architecture makes special provisions > in terms of the synchronization needed), we should take care to > only use aarch64_insn_patch_text_nosync() if the subsequent > instruction is still a 'RET' (which guarantees that the one being > patched is a B or a NOP) Aside of lacking objtool support (which is being worked on), is there anything else in the way of also doing inline patching for ARM64? That is; if the function is not reachable by the immediate you can always leave (re-instate) the call to the trampoline after patching that. Anyway, nice to see ARM64 support, thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel