From patchwork Fri Jun 10 23:35:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 12878202 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 7671DC43334 for ; Fri, 10 Jun 2022 23:39:05 +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:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=68t4/je11Wn1lnInmS6nE/n/Zp24xnBsKgjC9O/Zz7g=; b=Ul1QBXRd6MHOz1XnHcRLWRd4AM Zxszju3rxLQlZ7cA3O0YzEVJ0Rfoza8IrWErtwKazPxB18SrBdCQcd46aI+6LPYW9lZStk0+vDHD5 48ihccryYFvLSyf+pU/tJE1GjuSXLVMserdw0AbCeOeWS5pGpi73QZ1Py/T4LFJTi2bpdqJVK/Ggt eif9/pLEHo+TI3JZIoCESFx1wOrUt7jNP47GivJNyGz2x6xNFOWLpupfDPWv8Ntt9WXDOmzovhX63 teCm3xHrpNH9CbgZwMfk2UI/g38b5QJ7gPILRnLmT5fFpP5VYMYXYipKVUvfPgoqi+j0Kkv6fvpLV 5YiD5DIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzoCP-00ASB7-HC; Fri, 10 Jun 2022 23:37:53 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzoAH-00AQsN-4c for linux-arm-kernel@lists.infradead.org; Fri, 10 Jun 2022 23:35:42 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-31384ac6813so6156177b3.8 for ; Fri, 10 Jun 2022 16:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=XQzoa9Hbm2J1FC5lebup2zdYvg5ee8G3jglBmtbWdMA=; b=US507XUeqVBOul77B/VFOWIwS4pd3nIRPg+pGiozRhuxzzq2ZnTjYUWOH5Wd6LLiYe odE9mwv9yV9x0+KlQ/9R+5gEDSTkmcRlkll00lTsC6yUBgkIjuT+tFphrdbUGExqAKFz WzP1Qu5a+FDuRY847PYNDCZS4fzfn4KJZ9dadgjIE7gN0eya/Z/TI5ux/cASDbBX2TWf rNsdxf4qMXc8dQh7Ya7uf8Jznp8DQsF8asaWuv4VvhY46bn853FzwbM3IHpR3/Au+skp GQNKqDqu7sOBaiy0hkdkdtF0+Ertcwcm0ztyAe1iJkbSCGIXyeh8AvXFl6Q4XZmo/a3f 4jqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=XQzoa9Hbm2J1FC5lebup2zdYvg5ee8G3jglBmtbWdMA=; b=VR+8OIkQ012mERQadl8aHrt9kdeWkgTcDw+rFVOSLpr2HihxaGQ3eYGHAyDjmQw6ty jZcgafxZO1fmbkVB1S6qsXe1uq01sjpAp+EBtCN/nR/AlK9BmDNzplHv+VksTpv7xkub uTe2KTmwOuwSLu5qLLHoSBi8p/oPdrt9TP9aLdUNsB5mSgmSp5XX3zgcyqXUo9zG3zAg 9oHd5/VACDp6jS8vUcCJ8qPx0z9rRshsa1DwiU4TUL8v+6ZQ8hz2ET3xJMLnZK1sIy4q 3Xj5V7vX7NbndIqyHmBR4JFDU0ACqoptevnrj0urCG/P3SPeUGQN1UExi88gnNZYNZEx NF9w== X-Gm-Message-State: AOAM533Brig9tmz2eza47DGUI+7Vk47Nw7cSTQu8/+CLNmoFjv/7AxRG hf4iYdr3cZcGxuGvkSuvzzsj/CeOWN65JwyXsKM= X-Google-Smtp-Source: ABdhPJxOnfCH6DmxniOqq2LkeH9gEZ3RgiYPiLFCUyVjRAHWiCSIASDSQFq5utQqSEA9eUYUOU+8UPE87gxIjEN26Og= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f464:6db6:3d47:ed14]) (user=samitolvanen job=sendgmr) by 2002:a05:6902:1109:b0:663:62f6:7f3e with SMTP id o9-20020a056902110900b0066362f67f3emr32789459ybu.516.1654904140205; Fri, 10 Jun 2022 16:35:40 -0700 (PDT) Date: Fri, 10 Jun 2022 16:35:03 -0700 In-Reply-To: <20220610233513.1798771-1-samitolvanen@google.com> Message-Id: <20220610233513.1798771-11-samitolvanen@google.com> Mime-Version: 1.0 References: <20220610233513.1798771-1-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=2383; h=from:subject; bh=gUQdQPsX7uTYFsHphyP8RuFjJc28btkAaQrsu/mKELw=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBio9UuEWWSmMhEikQU/hTXdinKYos9UVVSPfvxrQiP ClWVaKeJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCYqPVLgAKCRBMtfaEi7xW7kZGDA COpVnTMk0wBQa7hTfdzIF4Ot91or7ZDsSbiPCq1+UcotRG/hvz9f7vHFLNSiP89hfxEvavNqjwV4Jm OTY0iPVk4K3Wa6znkh1BopxAj6JlwZHgreOk4ErPvm+Siw78HaVMI/mSFQY9F1fkAHM7oq0p45Buge qTxH3b+yIsdrzk4Ezns5qRjuQR6NneX+YLOECH/JyNvebJnc+EhShXdBdM9Pk+DgYRv7w4cdf7XhDz q/W5n5pxD3JcmG1ubc5OZzs576mGicLLcjJo4Uy1eG00c7ve5/wGx/1oFlUvz71kJXKKBybjDyLFyH pU2Wrrmx9Zss3VzZeghtF8OgIiP5KD9g1YZ3xdLTlQqqWZbkDesd9KJND9PbD/jGz7jtkfvWfuCvJN YFNG8BeeUs9Qv1lNWXyXsDnr/tS2tkgoNrEqXPLMzBDC87C4siR44Xvtl59iNhmdnk2vwNmfw1wnTt KzcKq5PR5AGUDfbwTKrDzWvZZdTjeuETSpGdZ15XGWrE0= X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog Subject: [RFC PATCH v3 10/20] arm64: Drop unneeded __nocfi attributes From: Sami Tolvanen To: linux-kernel@vger.kernel.org Cc: Kees Cook , Josh Poimboeuf , Peter Zijlstra , x86@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, Sami Tolvanen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220610_163541_202152_84AF6567 X-CRM114-Status: GOOD ( 13.22 ) 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 With -fsanitize=kcfi, CONFIG_CFI_CLANG no longer has issues with address space confusion in functions that switch to linear mapping. Now that the indirectly called assembly functions have type annotations, drop the __nocfi attributes. Suggested-by: Mark Rutland Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook --- arch/arm64/include/asm/mmu_context.h | 2 +- arch/arm64/kernel/alternative.c | 2 +- arch/arm64/kernel/cpufeature.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index 6770667b34a3..ca0140d0b8cf 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -143,7 +143,7 @@ static inline void cpu_install_ttbr0(phys_addr_t ttbr0, unsigned long t0sz) * Atomically replaces the active TTBR1_EL1 PGD with a new VA-compatible PGD, * avoiding the possibility of conflicting TLB entries being allocated. */ -static inline void __nocfi cpu_replace_ttbr1(pgd_t *pgdp) +static inline void cpu_replace_ttbr1(pgd_t *pgdp) { typedef void (ttbr_replace_func)(phys_addr_t); extern ttbr_replace_func idmap_cpu_replace_ttbr1; diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c index 7bbf5104b7b7..e98466bab633 100644 --- a/arch/arm64/kernel/alternative.c +++ b/arch/arm64/kernel/alternative.c @@ -133,7 +133,7 @@ static void clean_dcache_range_nopatch(u64 start, u64 end) } while (cur += d_size, cur < end); } -static void __nocfi __apply_alternatives(struct alt_region *region, bool is_module, +static void __apply_alternatives(struct alt_region *region, bool is_module, unsigned long *feature_mask) { struct alt_instr *alt; diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 42ea2bd856c6..f6f9694d0448 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1645,7 +1645,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, } #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 -static void __nocfi +static void kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused) { typedef void (kpti_remap_fn)(int, int, phys_addr_t);