mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
module/*.ko: prune .data, global .rodata
Evaluated every variable that lives in .data (and globals in .rodata) in the kernel modules, and constified/eliminated/localised them appropriately. This means that all read-only data is now actually read-only data, and, if possible, at file scope. A lot of previously- global-symbols became inlinable (and inlined!) constants. Probably not in a big Wowee Performance Moment, but hey. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12899
This commit is contained in:
@@ -225,7 +225,7 @@ static aes_impl_ops_t aes_fastest_impl = {
|
||||
};
|
||||
|
||||
/* All compiled in implementations */
|
||||
const aes_impl_ops_t *aes_all_impl[] = {
|
||||
static const aes_impl_ops_t *aes_all_impl[] = {
|
||||
&aes_generic_impl,
|
||||
#if defined(__x86_64)
|
||||
&aes_x86_64_impl,
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
#endif /* !MACHINE_IS_BIG_ENDIAN && !MACHINE_IS_LITTLE_ENDIAN */
|
||||
|
||||
#if !defined(MACHINE_IS_BIG_ENDIAN) && !defined(MACHINE_IS_LITTLE_ENDIAN)
|
||||
#error unknown machine byte sex
|
||||
#error unknown machine byte order
|
||||
#endif
|
||||
|
||||
#define BYTEORDER_INCLUDED
|
||||
|
||||
@@ -779,7 +779,7 @@ static gcm_impl_ops_t gcm_fastest_impl = {
|
||||
};
|
||||
|
||||
/* All compiled in implementations */
|
||||
const gcm_impl_ops_t *gcm_all_impl[] = {
|
||||
static const gcm_impl_ops_t *gcm_all_impl[] = {
|
||||
&gcm_generic_impl,
|
||||
#if defined(__x86_64) && defined(HAVE_PCLMULQDQ)
|
||||
&gcm_pclmulqdq_impl,
|
||||
@@ -1046,9 +1046,6 @@ MODULE_PARM_DESC(icp_gcm_impl, "Select gcm implementation.");
|
||||
#define GCM_AVX_MAX_CHUNK_SIZE \
|
||||
(((128*1024)/GCM_AVX_MIN_DECRYPT_BYTES) * GCM_AVX_MIN_DECRYPT_BYTES)
|
||||
|
||||
/* Get the chunk size module parameter. */
|
||||
#define GCM_CHUNK_SIZE_READ *(volatile uint32_t *) &gcm_avx_chunk_size
|
||||
|
||||
/* Clear the FPU registers since they hold sensitive internal state. */
|
||||
#define clear_fpu_regs() clear_fpu_regs_avx()
|
||||
#define GHASH_AVX(ctx, in, len) \
|
||||
@@ -1057,6 +1054,9 @@ MODULE_PARM_DESC(icp_gcm_impl, "Select gcm implementation.");
|
||||
|
||||
#define gcm_incr_counter_block(ctx) gcm_incr_counter_block_by(ctx, 1)
|
||||
|
||||
/* Get the chunk size module parameter. */
|
||||
#define GCM_CHUNK_SIZE_READ *(volatile uint32_t *) &gcm_avx_chunk_size
|
||||
|
||||
/*
|
||||
* Module parameter: number of bytes to process at once while owning the FPU.
|
||||
* Rounded down to the next GCM_AVX_MIN_DECRYPT_BYTES byte boundary and is
|
||||
|
||||
@@ -65,7 +65,7 @@ static void SHA256Transform(SHA2_CTX *, const uint8_t *);
|
||||
static void SHA512Transform(SHA2_CTX *, const uint8_t *);
|
||||
#endif /* __amd64 && _KERNEL */
|
||||
|
||||
static uint8_t PADDING[128] = { 0x80, /* all zeros */ };
|
||||
static const uint8_t PADDING[128] = { 0x80, /* all zeros */ };
|
||||
|
||||
/*
|
||||
* The low-level checksum routines use a lot of stack space. On systems where
|
||||
|
||||
@@ -263,8 +263,6 @@ extern const uint64_t SKEIN_256_IV_128[];
|
||||
extern const uint64_t SKEIN_256_IV_160[];
|
||||
extern const uint64_t SKEIN_256_IV_224[];
|
||||
extern const uint64_t SKEIN_256_IV_256[];
|
||||
extern const uint64_t SKEIN_512_IV_128[];
|
||||
extern const uint64_t SKEIN_512_IV_160[];
|
||||
extern const uint64_t SKEIN_512_IV_224[];
|
||||
extern const uint64_t SKEIN_512_IV_256[];
|
||||
extern const uint64_t SKEIN_512_IV_384[];
|
||||
|
||||
@@ -52,30 +52,6 @@ const uint64_t SKEIN_256_IV_256[] = {
|
||||
MK_64(0x6A54E920, 0xFDE8DA69)
|
||||
};
|
||||
|
||||
/* blkSize = 512 bits. hashSize = 128 bits */
|
||||
const uint64_t SKEIN_512_IV_128[] = {
|
||||
MK_64(0xA8BC7BF3, 0x6FBF9F52),
|
||||
MK_64(0x1E9872CE, 0xBD1AF0AA),
|
||||
MK_64(0x309B1790, 0xB32190D3),
|
||||
MK_64(0xBCFBB854, 0x3F94805C),
|
||||
MK_64(0x0DA61BCD, 0x6E31B11B),
|
||||
MK_64(0x1A18EBEA, 0xD46A32E3),
|
||||
MK_64(0xA2CC5B18, 0xCE84AA82),
|
||||
MK_64(0x6982AB28, 0x9D46982D)
|
||||
};
|
||||
|
||||
/* blkSize = 512 bits. hashSize = 160 bits */
|
||||
const uint64_t SKEIN_512_IV_160[] = {
|
||||
MK_64(0x28B81A2A, 0xE013BD91),
|
||||
MK_64(0xC2F11668, 0xB5BDF78F),
|
||||
MK_64(0x1760D8F3, 0xF6A56F12),
|
||||
MK_64(0x4FB74758, 0x8239904F),
|
||||
MK_64(0x21EDE07F, 0x7EAF5056),
|
||||
MK_64(0xD908922E, 0x63ED70B8),
|
||||
MK_64(0xB8EC76FF, 0xECCB52FA),
|
||||
MK_64(0x01A47BB8, 0xA3F27A6E)
|
||||
};
|
||||
|
||||
/* blkSize = 512 bits. hashSize = 224 bits */
|
||||
const uint64_t SKEIN_512_IV_224[] = {
|
||||
MK_64(0xCCD06162, 0x48677224),
|
||||
|
||||
Reference in New Issue
Block a user