From patchwork Tue May 16 16:06:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13243375 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 1EA96C7EE25 for ; Tue, 16 May 2023 16:07:51 +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:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=77M5FJpH8yeeK6AecwZL7uuwln7GADmD/SnMkVmG2/Y=; b=mM+aal5TnBm5nA /A/0zCgtncWuhnYt/1ksnhu0Cqc8AUChiu7Ir+byDtri07RojnQOq4VU16BUavJ9rFDQCjKcc0SOr f7pO1M2hadEfEOZON6NAiCh4AUrA4gEw9rTCadOYa+YnyPRkzPQXcwZjayqzCxK3iJthb09ydQ8SW JajsSjP/xoHv2QkSuncFKt/eZ/9Aj50ko1IdSHNwbAvHLa5+PX8Wfh+l4zXFY65tbYQD2oKo3h4x9 c70gvj6VNquA/wbD3SdV/mhkDGN0HPfJ4pZxaeIZWuS6Eh3JMqGWIDplTw0vnDI6kQy6VzG3Bf80i xdCxDoKJsXuOFtRDYVgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyxCx-006Omc-1o; Tue, 16 May 2023 16:07:27 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyxCn-006Ogo-2N for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 16:07:19 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 371D363982; Tue, 16 May 2023 16:07:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D293C433A0; Tue, 16 May 2023 16:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684253236; bh=EHdgQS3JVDabaHQOJdS0gJKrLl6Cs3hgsTqLxLbiG+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oo9iUFG8feFpl5pKA57H04XS7oaoARqG7b5QnuM5PK3LjaDltlbCaFGctTg81C1a8 ae5CCSt2RyeXYIHarFcUaPzVzc3ursJ85yCMZig+JC5wUXhs1ZI5+QJbUpvyk5Vcgr H6KoGu8XZAXrBmcO4T2+U3WglszuFpKfRp/GLOO6C0V8wg+rbZbhf8W2b84UngLIHI Hb2OQJ2+1gIeRDvw7cFwYBm8Q7OH/Jv/U6HF4Yr3og3O8Vi8RLj//f5KEBGOQegLQG 5iC4CsVI/8lBKbMPJato932wBhCHlHjXynWxW1jIfoQr++1cD1PeMPj6zDcicuEPeX c49NXLQd5lv5Q== From: Arnd Bergmann To: Catalin Marinas , Will Deacon Cc: Arnd Bergmann , Ard Biesheuvel , Mark Rutland , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Anshuman Khandual , Kees Cook , Suren Baghdasaryan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, kvmarm@lists.linux.dev Subject: [PATCH 05/15] arm64: spectre: provide prototypes for internal functions Date: Tue, 16 May 2023 18:06:32 +0200 Message-Id: <20230516160642.523862-6-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516160642.523862-1-arnd@kernel.org> References: <20230516160642.523862-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_090717_854326_15412D52 X-CRM114-Status: GOOD ( 11.72 ) 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 From: Arnd Bergmann The helpers in proton-pack.c are called from assembler and have no prototype in a header, which causes a W=1 warning: arch/arm64/kernel/proton-pack.c:568:13: error: no previous prototype for 'spectre_v4_patch_fw_mitigation_enable' [-Werror=missing-prototypes] arch/arm64/kernel/proton-pack.c:588:13: error: no previous prototype for 'smccc_patch_fw_mitigation_conduit' [-Werror=missing-prototypes] arch/arm64/kernel/proton-pack.c:1064:14: error: no previous prototype for 'spectre_bhb_patch_loop_mitigation_enable' [-Werror=missing-prototypes] arch/arm64/kernel/proton-pack.c:1075:14: error: no previous prototype for 'spectre_bhb_patch_fw_mitigation_enabled' [-Werror=missing-prototypes] Add these to asm/spectre.h, which contains related declarations already. Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/spectre.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/include/asm/spectre.h b/arch/arm64/include/asm/spectre.h index db7b371b367c..9cc501450486 100644 --- a/arch/arm64/include/asm/spectre.h +++ b/arch/arm64/include/asm/spectre.h @@ -100,5 +100,21 @@ bool is_spectre_bhb_affected(const struct arm64_cpu_capabilities *entry, int sco u8 spectre_bhb_loop_affected(int scope); void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *__unused); bool try_emulate_el1_ssbs(struct pt_regs *regs, u32 instr); + +void spectre_v4_patch_fw_mitigation_enable(struct alt_instr *alt, __le32 *origptr, + __le32 *updptr, int nr_inst); +void smccc_patch_fw_mitigation_conduit(struct alt_instr *alt, __le32 *origptr, + __le32 *updptr, int nr_inst); +void spectre_bhb_patch_loop_mitigation_enable(struct alt_instr *alt, __le32 *origptr, + __le32 *updptr, int nr_inst); +void spectre_bhb_patch_fw_mitigation_enabled(struct alt_instr *alt, __le32 *origptr, + __le32 *updptr, int nr_inst); +void spectre_bhb_patch_loop_iter(struct alt_instr *alt, + __le32 *origptr, __le32 *updptr, int nr_inst); +void spectre_bhb_patch_wa3(struct alt_instr *alt, + __le32 *origptr, __le32 *updptr, int nr_inst); +void spectre_bhb_patch_clearbhb(struct alt_instr *alt, + __le32 *origptr, __le32 *updptr, int nr_inst); + #endif /* __ASSEMBLY__ */ #endif /* __ASM_SPECTRE_H */