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 0192AC433F5 for ; Fri, 5 Nov 2021 15:01:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B5DDF6120E for ; Fri, 5 Nov 2021 15:01:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B5DDF6120E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MEwTyvWsH7j95kiqNjKDCajD2sFnNftbVr002aiggRc=; b=KZTB1q3vlbrSHj S1l+aq8X29YkevQK4DH7qxekB720AteHtP4RNR5ITBjy1Gqe++joC3ZkwDRekBi3FH+lr0lnPND/l UsVGnVPvjeticCF8K27xBniYmNlNZom/c6nAQN94Wvw9gtek/USz6jpCYg073KwOH6fL0dYuM3o0w Z+dSHtfoMCkV3x33e0yA9EqdHisuuHI8yctW3BvEwTxjG5p1UTVyHxsj0qz/TIZAqaJkjZIlY6T56 7h5YpQXZR7ka7a5ckCyvyB7K5jkYLO/gewWYPZXGSAI5hz6X/wVT0pnICifjSaIrJDjITZZ8nwLef J5NpvuMq13tdbqudL9JA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mj0gj-00BdGn-5t; Fri, 05 Nov 2021 14:59:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mj0ge-00BdFY-Qs for linux-arm-kernel@lists.infradead.org; Fri, 05 Nov 2021 14:59:26 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F1EF611C0; Fri, 5 Nov 2021 14:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636124364; bh=pKL79R6e/6XFSt3xwJ9CLWqM2WH3RKaSvXVeu+Riva8=; h=From:To:Cc:Subject:Date:From; b=STO1ghN4zaCF5IOzyYOj6Ff3mkZPthU7Jl8FcSWcjF7begjBgU4eRF9AWyvCZlj2h /q2/7GHX0sPDqAIT7aLttfpmonsLzAOhXT26w3dzeFkFeimq3GmpNvjf33b63bofXe SQmLWGYS6qmw2lFUrpBMOITGM1ZIvECPprmLTpNFVucBlhETHzmn26/vOxm3smwXmh 8PmIlxm2j9sD2bMN8dErb4ZtjGw0o2Os0eQ1/ZIJZFihREQVwC7IQHD7/1tBHZD7mM rMekz8dZD2XIT5l+8tr4v3vWzDNz2hdo1/pd7asr6rwG4gLSm4QqJCZ4M2bbtJxLQu bortuVTSAA9fQ== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Mark Rutland , Quentin Perret , Catalin Marinas , James Morse , Will Deacon , Frederic Weisbecker , Peter Zijlstra , Kees Cook , Sami Tolvanen , Andy Lutomirski , Josh Poimboeuf , Steven Rostedt Subject: [PATCH v6 0/2] static call support for arm64 Date: Fri, 5 Nov 2021 15:59:15 +0100 Message-Id: <20211105145917.2828911-1-ardb@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2148; h=from:subject; bh=pKL79R6e/6XFSt3xwJ9CLWqM2WH3RKaSvXVeu+Riva8=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBhhUbAj5SBIcvjKtxaOssCNZgQWw/pHGgDQICvYqHa 6zjLF4+JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYYVGwAAKCRDDTyI5ktmPJBUdC/ 0T1Dc01GVgdNiLpzvWkonon53HTdb9vEYTLLXfwNKsjnI3kcz6LRWtjpSTcxNcryANcq7X+L9ofz59 6E+iEqAMlAKovbJlF4E99DPgtpEM50bn96RAk7eDbESggSRW5JD4OHK/6HlHPk3rjrGLrDPIeC5PJy noVUMVClmR07CPEniOq4FDwBTkEfEk9LwKjCfsQu0gAozt9APTnk0xKi/GkJriwKnozkrEWbSnwuZy qmuLorCxBAZmxWVG4Uh4XPBWNPHruLB4PAcxXrp1Dz+P1w8NOs2mt6pOxxecVCiPK+ITkhmOwyTgVc pTsWlmWrtXdOH4qKr4LGph0PQwVFJhBRWbMlQq8W/2ZLeHDcAsl0WiGnvM1EVW17al/Xs0S/05l6Ne PINHHrYdhlHKXjDK6WTAoroh8Sq9it5dG2FyihmJqyINHjNju/4zGHrHUYzeuAcYadHUJad+pz7KOd kHuYusJV+htQgWVsSyvXE648BA98I+8649MFyyadZRSMc= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211105_075924_934223_385BED5C X-CRM114-Status: GOOD ( 14.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 This implements non-inline static calls for arm64. This is rather straight-forward, as we don't rely on any tooling to look for static call sites etc. The only minor complication is Clang CFI, which is already in mainline for arm64, and requires a little tweak to ensure that we don't end up patching the CFI jump table instead of the static call trampoline itself. Changes since v5: - drop the patch that works around issues with references to symbols with static linkage from asm blocks; this is specific to Clang+ThinLTO in versions before 13, so we can just decide not to support that config. - add a patch to use non-function type symbols for the trampolines, to ensure that taking the address gives us the trampoline itself rather than the address of a CFI jump table entry that branches to it. Changes since v4: - add preparatory patch to address generic CFI/LTO issues with static calls - add comment to patch #2 describing the trampoline layout - add handling of Clang CFI jump table entries - add PeterZ's ack to patch #2 Cc: Mark Rutland Cc: Quentin Perret Cc: Catalin Marinas Cc: James Morse Cc: Will Deacon Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Kees Cook Cc: Sami Tolvanen Cc: Andy Lutomirski Cc: Josh Poimboeuf Cc: Steven Rostedt Ard Biesheuvel (2): static_call: use non-function types to refer to the trampolines arm64: implement support for static call trampolines arch/arm64/Kconfig | 2 + arch/arm64/include/asm/static_call.h | 40 ++++++++++ arch/arm64/kernel/patching.c | 77 +++++++++++++++++++- arch/arm64/kernel/vmlinux.lds.S | 1 + include/linux/static_call.h | 4 +- include/linux/static_call_types.h | 11 ++- 6 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 arch/arm64/include/asm/static_call.h -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel