From patchwork Fri Apr 1 20:19:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 12798775 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AD5A4C433F5 for ; Fri, 1 Apr 2022 20:38:26 +0000 (UTC) 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:Cc:To:From:Subject:Mime-Version: Message-Id:Date: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=q1f1wfy1EkqK2Dnw8tB2Scp4OXx7n1z84F3CH19lLeY=; b=X68 asV5ZBUwyS0nl2VrbSA4dNgl6xCnVRnqmYL/u3llIaYyLcjBtS/uDZeTmLdLq8sX69qT9jMsgCknh 36szKU7eHjMe5/KZnD7qW7E+IBf+4WMvAVMCcStPhR5velrO2cyd6zmEF5XITL9JL1dl4R5bknxt/ 5txfGEnvx5dnpeA1quw4OsXEM/Ns71R6ezW8yb3cYpk095inPrtVVsP6lJTuegwYSfp5NqVXUB2Pj U7SmxSDj8SnArNwjLkWfdB5a3X0Y0RusFrRqNWEZOk/POsxd5/8f1NWiFfUpnoxZxvCMGAvQzwlin WZvv3zxBadJEnQE1DESKis9SMDRBxYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1naO1B-007EMi-T3; Fri, 01 Apr 2022 20:37:15 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1naNjt-0075Xz-IU for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2022 20:19:24 +0000 Received: by mail-yb1-xb49.google.com with SMTP id k62-20020a252441000000b0063d91fd00c1so332173ybk.10 for ; Fri, 01 Apr 2022 13:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=MzDAtS181K28awKeVRl3qYn1BJqlBjys5Tr9TP3rlP4=; b=QOgDbsi0Jkp536F8U3evqUrA5teUQPwd1J3oZVmL+ceW77Te9PiOo30oFh5I+Cfnhk JRSBlrE2TEWRY9lp5O1ExdJ3rZ9tfHfrX12HIXnDBsywa2HTxTYfrUExdO5O8Mc+CXYr +VcSZEAIn2TgQuCpwRPrZzCk6qPTjQeOMd0ydmwzGr9JKJ2gcUkb9xCkMMam9FGwIlcX I33j6enXrKAymZJ+EdW0R1h5SNan1gb07PokkU/kScowj+gVxDmYYzu/QgCPhjm0q8EV IKcE5cJMHuqqlrQzg5mj8ST5/OrbGo/QFKGmOIxcvChc3wGvv2gW5KJlZfG0TNiGur72 8KFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=MzDAtS181K28awKeVRl3qYn1BJqlBjys5Tr9TP3rlP4=; b=WhlGbKDGtB2neCX+V1daVDaGyVgm+/NKO6E1sq6jNWvsy5XPQ9yJ5zGR/amgaTPstx vhsvltSyrfg9eYki3H5wR84n8DJMUpZBZjk19ZngGUtSxyyG4fDsKY6PhCmi2ZF3ajYR d8UBd+F18mMtr5BJvz6ocVRbeVGUe680XRNLkjS7whae62bF5xw8LMrBdFahwvame2xv eGbhGDg9UYT6DtVbD08N9L3eyTROwQiICqN0gRNSh1GeWZIAZgPXaZOm4JM/F/WDaBXz MPm8fY36S2y9juJrbs5tsCuRVvLykQcbLywtPL/E/mcEliDh5j/z5Z1sG6MJ4uvhIV2p Z/iA== X-Gm-Message-State: AOAM530omq2MBNrMFy0pd0Z6DnLLGyIvMoMM8cCBisbOUpnph+F9P6p5 n1nosnbzUls2FfPxiscj+DfvIyXQDTqS1MAq17s= X-Google-Smtp-Source: ABdhPJzVa2+iD5w2wZiAll+bNYAh4Woiw4BvSeE/HM1A5wWyO8tbc7KvmBfTDvYoGqyu9lJ2HX/YyH0IRTBMNj5XBOQ= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:ebe8:1acf:913c:f19e]) (user=samitolvanen job=sendgmr) by 2002:a81:4754:0:b0:2e5:9447:b1a0 with SMTP id u81-20020a814754000000b002e59447b1a0mr12543646ywa.66.1648844358691; Fri, 01 Apr 2022 13:19:18 -0700 (PDT) Date: Fri, 1 Apr 2022 13:19:13 -0700 Message-Id: <20220401201916.1487500-1-samitolvanen@google.com> Mime-Version: 1.0 X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=755; h=from:subject; bh=WH/8OyJEi9p/hM5wZbbTiaLpH/4ppY4IMtyv+KlnWGQ=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBiR15CtFhTIHqRjcowQZaTOrS5xpFZwIuWGKgZH9QY 9U9tLmuJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCYkdeQgAKCRBMtfaEi7xW7nC8C/ 9PyrDAAwDUSsKHBXM2cS1o2I7dEFr0YXswqSVooDhekKHMqQvLQ36MLEJKCXvGOq4Hp4BEeyFauzi2 gVFFOC8aM0YY+vuiYObacWitVa/ZXz91yRIIRdFKsrvSdMalN+Nei37wUcBtyaoleFlwe/kP4jwCxr ap9Mwf152DR57HwdQAwfJNXDPk2l+xkGh43Bsw4Bvkc5JZHl7q68+SvHZuYnTySOhdfE1x2NJo2o9a g+BYwOVTkyQv3ktPgnCIPmwmj1JNKQXrYcoDOTfvRd5RmFKIzA/zYXypH/FEb3D3EY76bkdIuNg44S 30bclKxDr7N/BgTQFumcNdOVgnvgm9ZcDNkT7xT/NpdvfM1HyHHW72wwtWmT5e1aZARYcVTsCdY0Wh GqEJoMP3nQuyozhUqhU3WKFtKjvO5PYkGimKFod4mrEl4hJ/mUu5YFzJC4UVJ1xYqXrWa/K+oScIl9 dq8P2Qvs08jBmPDSxm8nEE8HlUHh+7VC6SIgRPcXP2F/8= X-Mailer: git-send-email 2.35.0 Subject: [PATCH 0/3] cfi: Use __builtin_function_start From: Sami Tolvanen To: Kees Cook Cc: Catalin Marinas , Mark Rutland , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Sami Tolvanen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220401_131921_649668_FA62808B X-CRM114-Status: GOOD ( 10.15 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Clang 14 introduced the __builtin_function_start intrinsic, which makes it possible to cleanly implement the function_nocfi() macro in a way that also works with static initializers. Add a default function_nocfi() implementation and drop the arm64 inline assembly version. Sami Tolvanen (3): kbuild: Change CFI_CLANG to depend on __builtin_function_start linux/compiler-clang.h: define function_nocfi arm64: Drop the inline assembly implementation of function_nocfi arch/Kconfig | 5 +---- arch/arm64/include/asm/compiler.h | 16 ---------------- include/linux/compiler-clang.h | 10 ++++++++++ init/Kconfig | 3 +++ 4 files changed, 14 insertions(+), 20 deletions(-) Reviewed-by: Nick Desaulniers