mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
lib/crc: make the CPU feature static keys __ro_after_init
All of the CRC library's CPU feature static_keys are initialized by initcalls and never change afterwards, so there's no need for them to be in the regular .data section. Put them in .data..ro_after_init instead. Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Heiko Carstens <hca@linux.ibm.com> # s390 Link: https://lore.kernel.org/r/20250413154350.10819-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
parent
8ffd015db8
commit
7ef377c4d4
|
|
@ -16,8 +16,8 @@
|
|||
#include <asm/neon.h>
|
||||
#include <asm/simd.h>
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_neon);
|
||||
static DEFINE_STATIC_KEY_FALSE(have_pmull);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pmull);
|
||||
|
||||
#define CRC_T10DIF_PMULL_CHUNK_SIZE 16U
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
#include <asm/neon.h>
|
||||
#include <asm/simd.h>
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
static DEFINE_STATIC_KEY_FALSE(have_pmull);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pmull);
|
||||
|
||||
#define PMULL_MIN_LEN 64 /* min size of buffer for pmull functions */
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
#include <asm/neon.h>
|
||||
#include <asm/simd.h>
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_asimd);
|
||||
static DEFINE_STATIC_KEY_FALSE(have_pmull);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_asimd);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pmull);
|
||||
|
||||
#define CRC_T10DIF_PMULL_CHUNK_SIZE 16U
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ do { \
|
|||
#define CRC32(crc, value, size) _CRC32(crc, value, size, crc)
|
||||
#define CRC32C(crc, value, size) _CRC32(crc, value, size, crcc)
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
|
||||
u32 crc32_le_arch(u32 crc, const u8 *p, size_t len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ do { \
|
|||
#define CRC32C(crc, value, size) \
|
||||
_CRC32(crc, value, size, crc32c)
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
|
||||
u32 crc32_le_arch(u32 crc, const u8 *p, size_t len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#define VECTOR_BREAKPOINT 64
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_vec_crypto);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_vec_crypto);
|
||||
|
||||
u32 __crct10dif_vpmsum(u32 crc, unsigned char const *p, size_t len);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#define VECTOR_BREAKPOINT 512
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_vec_crypto);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_vec_crypto);
|
||||
|
||||
u32 __crc32c_vpmsum(u32 crc, const u8 *p, size_t len);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#define VX_ALIGNMENT 16L
|
||||
#define VX_ALIGN_MASK (VX_ALIGNMENT - 1)
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_vxrs);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_vxrs);
|
||||
|
||||
/*
|
||||
* DEFINE_CRC32_VX() - Define a CRC-32 function using the vector extension
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include <asm/pstate.h>
|
||||
#include <asm/elf.h>
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_crc32c_opcode);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32c_opcode);
|
||||
|
||||
u32 crc32_le_arch(u32 crc, const u8 *data, size_t len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <linux/module.h>
|
||||
#include "crc-pclmul-template.h"
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_pclmulqdq);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq);
|
||||
|
||||
DECLARE_CRC_PCLMUL_FUNCS(crc16_msb, u16);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
#include <linux/module.h>
|
||||
#include "crc-pclmul-template.h"
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
static DEFINE_STATIC_KEY_FALSE(have_pclmulqdq);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_crc32);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq);
|
||||
|
||||
DECLARE_CRC_PCLMUL_FUNCS(crc32_lsb, u32);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <linux/module.h>
|
||||
#include "crc-pclmul-template.h"
|
||||
|
||||
static DEFINE_STATIC_KEY_FALSE(have_pclmulqdq);
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_pclmulqdq);
|
||||
|
||||
DECLARE_CRC_PCLMUL_FUNCS(crc64_msb, u64);
|
||||
DECLARE_CRC_PCLMUL_FUNCS(crc64_lsb, u64);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user