From patchwork Thu Sep 8 21:54:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 12970714 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 4C701C38145 for ; Thu, 8 Sep 2022 22:00:24 +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=y5toU0EEQL01Ond11n7jxOAtjtkpVq5cmWp8qW6qk4g=; b=qFETWhDl0VYMgOuu0KK82DKDUl ZduIHWcoB7MM3rBm828nRnrmnPGy/m/Gzei58pkgSjxf6CH8pHlmh6cPnsZoJA9vK47l9Jki4hwFh 36PvJPDDSZAn2+FLxJxPQF/UDI7VuuUVWf4NNUKqhk2brRuFWv8GLE6dfIS43QH04UwoYQ8sOrfH7 xoNWS/AX1Fse5poaBrnCnAixwSLa9VA4v5XM6TXv9GWdIpIIf+Mc3I1gpSh4s+bQUsuF06ThyeafQ su+eya0WkeFBfpWUaKXpOl16LDj4oRMbLjxn9uTLrYyrLfW1kQpbG0AeScY9XLCMcBztH8oCeJzq/ labuFSWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWPYD-0097lF-KG; Thu, 08 Sep 2022 21:59:10 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWPUn-009595-EI for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 21:55:38 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id k126-20020a253d84000000b0068bb342010dso33624yba.1 for ; Thu, 08 Sep 2022 14:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date; bh=7KCsYNBshzyqwz+l0HUO/3yj7Ulbak1Wm5CokVvWHxw=; b=DIhHROG1myYjjEhpDDuovfl12YIR789djqDBc/0u/J1mp/jTmDj1ZA274AXNCs0wnQ lmt14cCOg5xAV7lpluAZTs012V2TcViqt6Fd409oZVvFj0p9wbyvt/LLFB+NybSwk91K u+9M7YxBEfhfH2yyQGo/p6f85J2cc94NIvHZ/LuVGNYFFtuYWd5VHEkjDRPgyPNMunJi e/ovvDDwGfEoxULnywfqVplYbYMPNWVdNE3/YMVhdGKHwKfEZzBXlGUkX/CD3xlhu3Gm oMSNueVp741XRM009sKhSfbf+/5jCQGMUjjw7oSD0hz+mRDipd5luQd+9JHtoAWUa3OS yXCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=7KCsYNBshzyqwz+l0HUO/3yj7Ulbak1Wm5CokVvWHxw=; b=rd3YbZbYKgyLwd8dWxgFYeMjPjb+pL/yqoo13AMvuT/JSoffpkZAQJVb16dcvJIfPz HjcQGejs3uXN3Q1Fva6vOY38MKjGhRu9XxecBa+hlQnsO7T2xJf8iwEFWleGm7j7NNnx dbrpfkwitq5zpSWmmY9VP0XC5QUpa/6KdMo4qveEB1iRlLTivicN1OYbKSB9kLkIFvGB Cao5ambgOM4NVcDppQY3dWm4tt+8BCKyLNhZ2koPduu0jKeEAtY4ITCZc9rxa/jNrLWl c/HDpuqjjZXmQa/CffnSPXPyrCnoALs1AzO3IxV8fB9mDX5QNMrqYQu7RWf+mZIIZxjZ dVAw== X-Gm-Message-State: ACgBeo1GduxBJdazUqOYLYK0KML5XAeyDOXG6VQlWm1fFdrzmqKp02/p f2z737eSD+4nMUGqiXJZHMXgb1ilxYgwMhP5HkU= X-Google-Smtp-Source: AA6agR5oVGKtFANNU7ak0LdUo3bvPwshuUK58VUOg3cK732UV0PIyD9J8Zk0uzMLvmO6Ic7KKJZaWyMaNzKdVNVUY2c= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:a4e4:e6ec:9fdd:1bdd]) (user=samitolvanen job=sendgmr) by 2002:a05:6902:1004:b0:6ad:aa9e:9116 with SMTP id w4-20020a056902100400b006adaa9e9116mr7779751ybt.559.1662674136099; Thu, 08 Sep 2022 14:55:36 -0700 (PDT) Date: Thu, 8 Sep 2022 14:54:53 -0700 In-Reply-To: <20220908215504.3686827-1-samitolvanen@google.com> Message-Id: <20220908215504.3686827-12-samitolvanen@google.com> Mime-Version: 1.0 References: <20220908215504.3686827-1-samitolvanen@google.com> X-Developer-Key: i=samitolvanen@google.com; a=openpgp; fpr=35CCFB63B283D6D3AEB783944CB5F6848BBC56EE X-Developer-Signature: v=1; a=openpgp-sha256; l=2488; i=samitolvanen@google.com; h=from:subject; bh=m1Q5lb7FoUHpFsHkDA6V80I7lJPiOUDvsppC/5IlC90=; b=owEB7QES/pANAwAKAUy19oSLvFbuAcsmYgBjGmS0+ybYcokQLe7u09cDWs1pssmZveUQDbXyShfl 0qFpXlqJAbMEAAEKAB0WIQQ1zPtjsoPW0663g5RMtfaEi7xW7gUCYxpktAAKCRBMtfaEi7xW7kQbC/ 0WWiPP1mHnTVz7t1OngMVyaUyb9neZlJ7OpbOI0EfIIimSACkarT2JkjTEAgQ6++DdZZqsf36LWQd+ 0ZWcdl0DBqmyCCGe+5XV0PpYBYXczvoQ1yR3TSanBdkj6bZLiHubjFuVvagyLlXgC3wgh3wVHSOf11 vQKDFRyM5YiUNuhYYzdUCRvP3PbSenGg7miRaKoQxsZJUaCp4emo5/1BwLM55BH9gh8SHH2yiy08Pm csUoyf2U9XeAmXvcEjeBRb5lRlkPpbrSR8lTtXSd32UpGpxjuH2+nJS78hEgDLEB9jgYYmE7lITsFQ M942EAKeJ5oZPGNa/DuLNOHA17MEfry/ZhOJZm2s69FLdlWIlLJwYt5LsJ291JgMTbfgIzcLoeeW3G +Ar89i8WELO94059y9xGW8R0mQnXUoZrUspfi+/WBxox0/tqZseCbvv3RC0dIHL8rt+Z22cvOZk1z0 SqsrbinWt5ANVjNqClElsYpuxViZTY7OFOaXinxzeJHeU= X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Subject: [PATCH v5 11/22] 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-20220908_145537_504081_BFC7DBA2 X-CRM114-Status: GOOD ( 13.49 ) 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 Tested-by: Kees Cook Tested-by: Nathan Chancellor --- 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 c7ccd82db1d2..bba0e630c8bc 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -147,7 +147,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, pgd_t *idmap) +static inline void cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap) { 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 9bcaa5eacf16..d2c66507398d 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 af4de817d712..ca6e5ca7104e 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1685,7 +1685,7 @@ static phys_addr_t kpti_ng_pgd_alloc(int shift) return kpti_ng_temp_alloc; } -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, unsigned long);