From patchwork Wed Mar 16 18:38:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12783037 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 EEED6C433F5 for ; Wed, 16 Mar 2022 18:39:52 +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: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=xSbnI4T1R8OndGrc1GSX7KAJHldMNewYRt13JWhzY+s=; b=JOO2minuDUMAtB rRZp/u0vdU4Iu/HaYffkaOQ1hOwWXBdFrhfMlI98ghpDcboXONJV/qqLvnR65qLUWFjXhZBUBy4v7 Afy3Dj78qBbhtSpiQD0/BuIG/kLGQ+o0Leq3/gDg87C5UZN02rKRELdonkZaT1InxEMcQn7g7SUje tMFZy67oGWqXTZAfKT5c2hZvKAxgzLquTp1rShMRyQPF6RF2OfE8UKpbjYvRNoFybT6cXtKa3W89I 0U83zN0/zC+JrN1Snhcy26bTJ4TSdvwPw9NNWlmM4/iva/HTHiNWAcSP67cpmwshzFxn/t64zEslt aRQC/SfqGYwwp/MFgMug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUYXl-00E5vp-4c; Wed, 16 Mar 2022 18:38:45 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nUYXh-00E5v5-PF for linux-arm-kernel@lists.infradead.org; Wed, 16 Mar 2022 18:38:43 +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 ams.source.kernel.org (Postfix) with ESMTPS id F1870B81CA1; Wed, 16 Mar 2022 18:38:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 808AFC340E9; Wed, 16 Mar 2022 18:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647455918; bh=4I2dqIsVLhZjm8CnyFJ7pDn7LPMROJTBLGpZPLGAP1Y=; h=From:To:Cc:Subject:Date:From; b=t8k6kmURw5+vEqAankWi7xR5393jq2B2dTT6kRbbvlzSuA3N9Wzxe5sR5t4IiJ7hS MF8jtysqZtFol5FQSA2ItMQbSuOeOSno8XJJVq69g8QwwroQo3meoToEM5Y2A4XbKp lZGjVUX7Yxom72fOEIHmsin0Q8O0GCvdcVfkQxSwJ+0BNIe7xlP2JIuxYfcqyVEnyJ BJCugmhH6pIBKU72w0XIjzRzQccQYx5cJQsQyZ2i9H4/trUXekogPPq4abFL3CE8wO F0PzVZGGXhXL8hjV6FGBiOi13fAmbcrmy1Dm/TmIZJC02opyIs/PF4RCO6hrJVp2SK AFs9eozuUQDjQ== From: Arnd Bergmann To: Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , James Morse Cc: Arnd Bergmann , "Russell King (Oracle)" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] arm64: fix clang warning about TRAMP_VALIAS Date: Wed, 16 Mar 2022 19:38:18 +0100 Message-Id: <20220316183833.1563139-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220316_113841_997477_263F3284 X-CRM114-Status: GOOD ( 13.20 ) 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 newly introduced TRAMP_VALIAS definition causes a build warning with clang-14: arch/arm64/include/asm/vectors.h:66:31: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] return (char *)TRAMP_VALIAS + SZ_2K * slot; Change the addition to something clang does not complain about. Fixes: bd09128d16fa ("arm64: Add percpu vectors for EL1") Signed-off-by: Arnd Bergmann Acked-by: James Morse --- arch/arm64/include/asm/vectors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) I see this warning on 5.17-rc8, but did not test it on linux-next, which may already have a fix. diff --git a/arch/arm64/include/asm/vectors.h b/arch/arm64/include/asm/vectors.h index f64613a96d53..bc9a2145f419 100644 --- a/arch/arm64/include/asm/vectors.h +++ b/arch/arm64/include/asm/vectors.h @@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors { DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector); #ifndef CONFIG_UNMAP_KERNEL_AT_EL0 -#define TRAMP_VALIAS 0 +#define TRAMP_VALIAS 0ul #endif static inline const char * arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot) { if (arm64_kernel_unmapped_at_el0()) - return (char *)TRAMP_VALIAS + SZ_2K * slot; + return (char *)(TRAMP_VALIAS + SZ_2K * slot); WARN_ON_ONCE(slot == EL1_VECTOR_KPTI);