From patchwork Mon Feb 17 19:32:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 866263 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A7131624F9; Mon, 17 Feb 2025 19:33:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739820796; cv=none; b=kFHzkNApp2wm8g8fW3ZJj54YFRNpVNPhQvPAlifA62qdqaKYre+A9QWrewWIZbgQGNDQTY6yUEYrUGFn1PJcdrVmEMnyEhmLGK4oxAZ9UwZJkh4wtPGTGHZOwz4qGLyXKcm6RQPaXKFiPT9BJZKN1NQmjTGjgS81MPXL5oC/TFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739820796; c=relaxed/simple; bh=QRYn2tlxtBIuftxdI5L0QHqXmcuITHD8bFpHAON7MbQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=L6s/TKYeTzpwnk9Sk5e96a2g81AuiBe2BNc+HtOaWbsbDG2FQmlmftZRCKxuR5ebGE/7gqf/G6sY6atF0oa57iREy3UG2S5YH1KBK+hNO2Pem4qQiIgXJaC53qnQeX13VK8HQzMrM8kFiIya7yVZh1rtsbsXItETcRT9S5Qj96s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lkPcmPmE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lkPcmPmE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9790C4CEE8; Mon, 17 Feb 2025 19:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739820794; bh=QRYn2tlxtBIuftxdI5L0QHqXmcuITHD8bFpHAON7MbQ=; h=From:To:Cc:Subject:Date:From; b=lkPcmPmEVZ3u2Q6TNVLQlqHi9/XOKT0rF7zB25P7N+QTjPUZYLoQhyUPbw3rxcm9E AxCISAuUqFwYgxJ8vELLO2GT34qfDNUvBnQR4/S9SIM5aY+xC2DXAl2q+yAD6P8tSn 8HDaDtoXSyteTzMFJPB3zI0GxgP08JTHuJmrrSvUKIyO42VmDKLyZTs/aO4Uu5W8ot 4gO0E9rsWzOrp+UsPqzPvvAtMTnt1TzfN3n+08rRV2wg+eOaJqJU7NfutXwp01gpX6 xLnRSrlFRJ0wa53uucr5C7iL+xsq5TsdTEvS+8rSsISqdHWB3bO3f87ct8SMjrxHtu 9odGEc/bNQGbw== From: Eric Biggers To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-crypto@vger.kernel.org, Ard Biesheuvel , Stephen Rothwell , Peter Zijlstra Subject: [PATCH] x86/crc: add ANNOTATE_NOENDBR to suppress objtool warnings Date: Mon, 17 Feb 2025 11:32:30 -0800 Message-ID: <20250217193230.100443-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Eric Biggers The assembly functions generated by crc-pclmul-template.S are called only via static_call, so they do not need to begin with an endbr instruction. But objtool still warns about a missing endbr by default. Add ANNOTATE_NOENDBR to suppress these warnings: vmlinux.o: warning: objtool: crc32_x86_init+0x1c0: relocation to !ENDBR: crc32_lsb_vpclmul_avx10_256+0x0 vmlinux.o: warning: objtool: crc64_x86_init+0x183: relocation to !ENDBR: crc64_msb_vpclmul_avx10_256+0x0 vmlinux.o: warning: objtool: crc_t10dif_x86_init+0x183: relocation to !ENDBR: crc16_msb_vpclmul_avx10_256+0x0 vmlinux.o: warning: objtool: __SCK__crc32_lsb_pclmul+0x0: data relocation to !ENDBR: crc32_lsb_pclmul_sse+0x0 vmlinux.o: warning: objtool: __SCK__crc64_lsb_pclmul+0x0: data relocation to !ENDBR: crc64_lsb_pclmul_sse+0x0 vmlinux.o: warning: objtool: __SCK__crc64_msb_pclmul+0x0: data relocation to !ENDBR: crc64_msb_pclmul_sse+0x0 vmlinux.o: warning: objtool: __SCK__crc16_msb_pclmul+0x0: data relocation to !ENDBR: crc16_msb_pclmul_sse+0x0 Fixes: 8d2d3e72e35b ("x86/crc: add "template" for [V]PCLMULQDQ based CRC functions") Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/r/20250217170555.3d14df62@canb.auug.org.au/ Suggested-by: Peter Zijlstra Signed-off-by: Eric Biggers --- This applies to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=crc-next arch/x86/lib/crc-pclmul-template.S | 5 +++++ 1 file changed, 5 insertions(+) base-commit: cf1ea3a7c1f63cba7d1dd313ee3accde0c0c8988 diff --git a/arch/x86/lib/crc-pclmul-template.S b/arch/x86/lib/crc-pclmul-template.S index dc91cc074b300..a19b730b642d3 100644 --- a/arch/x86/lib/crc-pclmul-template.S +++ b/arch/x86/lib/crc-pclmul-template.S @@ -5,10 +5,11 @@ // Copyright 2025 Google LLC // // Author: Eric Biggers #include +#include // Offsets within the generated constants table .set OFFSETOF_BSWAP_MASK, -5*16 // msb-first CRCs only .set OFFSETOF_FOLD_ACROSS_2048_BITS_CONSTS, -4*16 // must precede next .set OFFSETOF_FOLD_ACROSS_1024_BITS_CONSTS, -3*16 // must precede next @@ -270,10 +271,14 @@ .set BSWAP_MASK_XMM, %xmm6 .set CONSTS, V7 .set CONSTS_YMM, %ymm7 .set CONSTS_XMM, %xmm7 + // Use ANNOTATE_NOENDBR to suppress an objtool warning, since the + // functions generated by this macro are called only by static_call. + ANNOTATE_NOENDBR + #ifdef __i386__ push CONSTS_PTR mov 8(%esp), CONSTS_PTR #endif