Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/s390/boot/pgm_check_info.c | void decompressor_printk(const char *fmt, ...) {
char buf[1024] = {0};
char *end = buf + sizeof(buf) - 1;
unsigned long pad;
char *p = buf;
va_list args;
va_start(args, fmt);
for (; p < end && *fmt; fmt++) {
if (*fmt != '%') {
*p++ = *fmt;
continue;
}
pad = isdigit(*++fmt) ? simpl... | [
1,
0
] |
Linux Kernel | arch/s390/boot/pgm_check_info.c |
static noinline void print_stacktrace(void) {
struct stack_info boot_stack = {STACK_TYPE_TASK, (unsigned long)_stack_start,
(unsigned long)_stack_end};
unsigned long sp = S390_lowcore.gpregs_save_area[15];
bool first = true;
decompressor_printk("Call Trace:\n");
while (!(sp... | [
1,
0
] |
Linux Kernel | arch/s390/boot/startup.c |
static void offset_vmlinux_info(unsigned long offset) {
vmlinux.default_lma += offset;
*(unsigned long *)(&vmlinux.entry) += offset;
vmlinux.bootdata_off += offset;
vmlinux.bootdata_preserved_off += offset;
vmlinux.rela_dyn_start += offset;
vmlinux.rela_dyn_end += offset;
vmlinux.dynsym_start += offset;
... | [
1,
0
] |
Linux Kernel | arch/s390/boot/string.c |
int strncmp(const char *cs, const char *ct, size_t count) {
unsigned char c1, c2;
while (count) {
c1 = *cs++;
c2 = *ct++;
if (c1 != c2)
return c1 < c2 ? -1 : 1;
if (!c1)
break;
count--;
}
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/boot/string.c | char *strim(char *s) {
size_t size;
char *end;
size = strlen(s);
if (!size)
return s;
end = s + size - 1;
while (end >= s && isspace(*end))
end--;
*(end + 1) = '\0';
return skip_spaces(s);
} | [
0,
0
] |
Linux Kernel | arch/s390/boot/string.c | unsigned long long simple_strtoull(const char *cp, char **endp,
unsigned int base) {
unsigned long long result = 0;
if (!base)
base = simple_guess_base(cp);
if (base == 16 && cp[0] == '0' && TOLOWER(cp[1]) == 'x')
cp += 2;
while (isxdigit(*cp)) {
unsigned int va... | [
1,
0
] |
Linux Kernel | arch/s390/boot/uv.c | void uv_query_info(void) {
struct uv_cb_qui uvcb = {.header.cmd = UVC_CMD_QUI,
.header.len = sizeof(uvcb)};
if (!test_facility(158))
return;
if (uv_call(0, (uint64_t)&uvcb) && uvcb.header.rc != 0x100)
return;
if (IS_ENABLED(CONFIG_KVM)) {
memcpy(uv_info.inst_calls_list,... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static void fallback_exit_cip(struct crypto_tfm *tfm) {
struct s390_aes_ctx *sctx = crypto_tfm_ctx(tfm);
crypto_free_cipher(sctx->fallback.cip);
sctx->fallback.cip = NULL;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static int ecb_aes_encrypt(struct skcipher_request *req) {
return ecb_aes_crypt(req, 0);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static int ecb_aes_decrypt(struct skcipher_request *req) {
return ecb_aes_crypt(req, CPACF_DECRYPT);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c | static int cbc_aes_set_key(struct crypto_skcipher *tfm, const u8 *in_key,
unsigned int key_len) {
struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm);
unsigned long fc;
fc = (key_len == 16) ? CPACF_KMC_AES_128
: (key_len == 24) ? CPACF_KMC_AES_192
: (key_len == 32) ? C... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c | static int cbc_aes_crypt(struct skcipher_request *req, unsigned long modifier) {
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
struct s390_aes_ctx *sctx = crypto_skcipher_ctx(tfm);
struct skcipher_walk walk;
unsigned int nbytes, n;
int ret;
struct {
u8 iv[AES_BLOCK_SIZE];
u8 key[AES_MAX... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static int cbc_aes_decrypt(struct skcipher_request *req) {
return cbc_aes_crypt(req, CPACF_DECRYPT);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c | static int xts_aes_set_key(struct crypto_skcipher *tfm, const u8 *in_key,
unsigned int key_len) {
struct s390_xts_ctx *xts_ctx = crypto_skcipher_ctx(tfm);
unsigned long fc;
int err;
err = xts_fallback_setkey(tfm, in_key, key_len);
if (err)
return err;
if (fips_enabled && key... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static int xts_aes_encrypt(struct skcipher_request *req) {
return xts_aes_crypt(req, 0);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static int xts_aes_decrypt(struct skcipher_request *req) {
return xts_aes_crypt(req, CPACF_DECRYPT);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c | static unsigned int __ctrblk_init(u8 *ctrptr, u8 *iv, unsigned int nbytes) {
unsigned int i, n;
memcpy(ctrptr, iv, AES_BLOCK_SIZE);
n = (nbytes > PAGE_SIZE) ? PAGE_SIZE : nbytes & ~(AES_BLOCK_SIZE - 1);
for (i = (n / AES_BLOCK_SIZE) - 1; i > 0; i--) {
memcpy(ctrptr + AES_BLOCK_SIZE, ctrptr, AES_BLOCK_SIZE)... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static inline void _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw,
unsigned int nbytes) {
gw->walk_bytes_remain -= nbytes;
scatterwalk_unmap(gw->walk_ptr);
scatterwalk_advance(&gw->walk, nbytes);
scatterwalk_done(&gw->walk, 0, gw->walk_bytes_remain);
gw->walk_pt... | [
0,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static int gcm_out_walk_done(struct gcm_sg_walk *gw, unsigned int bytesdone) {
int i, n;
if (gw->ptr == NULL)
return 0;
if (gw->ptr == gw->buf) {
for (i = 0; i < bytesdone; i += n) {
if (!_gcm_sg_clamp_and_map(gw))
return i;
n = min(gw->walk_bytes, bytesdone - i);
memcpy(gw->w... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/aes_s390.c |
static int aes_s390_register_skcipher(struct skcipher_alg *alg) {
int ret;
ret = crypto_register_skcipher(alg);
if (!ret)
aes_s390_skcipher_algs[aes_s390_skciphers_num++] = alg;
return ret;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/chacha-glue.c |
static void chacha20_crypt_s390(u32 *state, u8 *dst, const u8 *src,
unsigned int nbytes, const u32 *key,
u32 *counter) {
struct kernel_fpu vxstate;
kernel_fpu_begin(&vxstate, KERNEL_VXR);
chacha20_vx(dst, src, nbytes, key, counter);
kernel_fpu_en... | [
0,
0
] |
Linux Kernel | arch/s390/crypto/chacha-glue.c |
static int chacha20_s390(struct skcipher_request *req) {
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm);
u32 state[CHACHA_STATE_WORDS] __aligned(16);
struct skcipher_walk walk;
unsigned int nbytes;
int rc;
rc = skcipher_walk_virt(&walk, req, ... | [
0,
0
] |
Linux Kernel | arch/s390/crypto/chacha-glue.c |
static int __init chacha_mod_init(void) {
return IS_REACHABLE(CONFIG_CRYPTO_SKCIPHER)
? crypto_register_skciphers(chacha_algs, ARRAY_SIZE(chacha_algs))
: 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/chacha-glue.c |
static void __exit chacha_mod_fini(void) {
if (IS_REACHABLE(CONFIG_CRYPTO_SKCIPHER))
crypto_unregister_skciphers(chacha_algs, ARRAY_SIZE(chacha_algs));
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/crc32-vx.c |
static int crc32_vx_cra_init_zero(struct crypto_tfm *tfm) {
struct crc_ctx *mctx = crypto_tfm_ctx(tfm);
mctx->key = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/crc32-vx.c |
static int crc32_vx_cra_init_invert(struct crypto_tfm *tfm) {
struct crc_ctx *mctx = crypto_tfm_ctx(tfm);
mctx->key = ~0;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/crc32-vx.c |
static int __crc32be_vx_finup(u32 *crc, const u8 *data, unsigned int len,
u8 *out) {
*(__be32 *)out = cpu_to_be32(crc32_be_vx(*crc, data, len));
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/crc32-vx.c |
static int __init crc_vx_mod_init(void) {
return crypto_register_shashes(crc32_vx_algs, ARRAY_SIZE(crc32_vx_algs));
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/des_s390.c |
static void s390_des_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) {
struct s390_des_ctx *ctx = crypto_tfm_ctx(tfm);
cpacf_km(CPACF_KM_DEA | CPACF_DECRYPT, ctx->key, out, in, DES_BLOCK_SIZE);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/des_s390.c | static int cbc_desall_crypt(struct skcipher_request *req, unsigned long fc) {
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
struct s390_des_ctx *ctx = crypto_skcipher_ctx(tfm);
struct skcipher_walk walk;
unsigned int nbytes, n;
int ret;
struct {
u8 iv[DES_BLOCK_SIZE];
u8 key[DES3_KEY_SI... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/des_s390.c |
static int ecb_des_decrypt(struct skcipher_request *req) {
return ecb_desall_crypt(req, CPACF_KM_DEA | CPACF_DECRYPT);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/des_s390.c |
static int cbc_des_decrypt(struct skcipher_request *req) {
return cbc_desall_crypt(req, CPACF_KMC_DEA | CPACF_DECRYPT);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/des_s390.c |
static int ecb_des3_encrypt(struct skcipher_request *req) {
return ecb_desall_crypt(req, CPACF_KM_TDEA_192);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/des_s390.c |
static int cbc_des3_decrypt(struct skcipher_request *req) {
return cbc_desall_crypt(req, CPACF_KMC_TDEA_192 | CPACF_DECRYPT);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/des_s390.c |
static int des_s390_register_skcipher(struct skcipher_alg *alg) {
int ret;
ret = crypto_register_skcipher(alg);
if (!ret)
des_s390_skciphers_ptr[des_s390_skciphers_num++] = alg;
return ret;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/ghash_s390.c |
static int ghash_setkey(struct crypto_shash *tfm, const u8 *key,
unsigned int keylen) {
struct ghash_ctx *ctx = crypto_shash_ctx(tfm);
if (keylen != GHASH_BLOCK_SIZE)
return -EINVAL;
memcpy(ctx->key, key, GHASH_BLOCK_SIZE);
return 0;
} | [
1,
0
] |
Linux Kernel | arch/s390/crypto/ghash_s390.c |
static void __exit ghash_mod_exit(void) { crypto_unregister_shash(&ghash_alg); } | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c | static inline int _key_to_kb(struct key_blob *kb, const u8 *key,
unsigned int keylen) {
struct clearkey_header {
u8 type;
u8 res0[3];
u8 version;
u8 res1[3];
u32 keytype;
u32 len;
} __packed *h;
switch (keylen) {
case 16:
case 24:
case 32:
memset(kb... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c | static inline int __paes_keyblob2pkey(struct key_blob *kb,
struct pkey_protkey *pk) {
int i, ret;
for (i = 0; i < 3; i++) {
if (i > 0 && ret == -EAGAIN && in_task())
if (msleep_interruptible(1000))
return -EINTR;
ret = pkey_keyblob2pkey(kb->key, kb->keyle... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static inline int __paes_convert_key(struct s390_paes_ctx *ctx) {
int ret;
struct pkey_protkey pkey;
ret = __paes_keyblob2pkey(&ctx->kb, &pkey);
if (ret)
return ret;
spin_lock_bh(&ctx->pk_lock);
memcpy(&ctx->pk, &pkey, sizeof(pkey));
spin_unlock_bh(&ctx->pk_lock);
return 0;
} | [
1,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c | static int ecb_paes_crypt(struct skcipher_request *req,
unsigned long modifier) {
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
struct skcipher_walk walk;
unsigned int nbytes, n, k;
int ret;
struct {
u8 key[MAXP... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c | static inline int __cbc_paes_set_key(struct s390_paes_ctx *ctx) {
int rc;
unsigned long fc;
rc = __paes_convert_key(ctx);
if (rc)
return rc;
fc = (ctx->pk.type == PKEY_KEYTYPE_AES_128) ? CPACF_KMC_PAES_128
: (ctx->pk.type == PKEY_KEYTYPE_AES_192) ? CPACF_KMC_PAES_192
: (ctx->pk.type == P... | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static int cbc_paes_set_key(struct crypto_skcipher *tfm, const u8 *in_key,
unsigned int key_len) {
int rc;
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
_free_kb_keybuf(&ctx->kb);
rc = _key_to_kb(&ctx->kb, in_key, key_len);
if (rc)
return rc;
return __cbc_paes_set_... | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c | static int cbc_paes_crypt(struct skcipher_request *req,
unsigned long modifier) {
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
struct skcipher_walk walk;
unsigned int nbytes, n, k;
int ret;
struct {
u8 iv[AES_B... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static int cbc_paes_decrypt(struct skcipher_request *req) {
return cbc_paes_crypt(req, CPACF_DECRYPT);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static int xts_paes_init(struct crypto_skcipher *tfm) {
struct s390_pxts_ctx *ctx = crypto_skcipher_ctx(tfm);
ctx->kb[0].key = NULL;
ctx->kb[1].key = NULL;
spin_lock_init(&ctx->pk_lock);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static int xts_paes_encrypt(struct skcipher_request *req) {
return xts_paes_crypt(req, 0);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static int ctr_paes_init(struct crypto_skcipher *tfm) {
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
ctx->kb.key = NULL;
spin_lock_init(&ctx->pk_lock);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static void ctr_paes_exit(struct crypto_skcipher *tfm) {
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
_free_kb_keybuf(&ctx->kb);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static int ctr_paes_set_key(struct crypto_skcipher *tfm, const u8 *in_key,
unsigned int key_len) {
int rc;
struct s390_paes_ctx *ctx = crypto_skcipher_ctx(tfm);
_free_kb_keybuf(&ctx->kb);
rc = _key_to_kb(&ctx->kb, in_key, key_len);
if (rc)
return rc;
return __ctr_paes_set_... | [
0,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c | static unsigned int __ctrblk_init(u8 *ctrptr, u8 *iv, unsigned int nbytes) {
unsigned int i, n;
memcpy(ctrptr, iv, AES_BLOCK_SIZE);
n = (nbytes > PAGE_SIZE) ? PAGE_SIZE : nbytes & ~(AES_BLOCK_SIZE - 1);
for (i = (n / AES_BLOCK_SIZE) - 1; i > 0; i--) {
memcpy(ctrptr + AES_BLOCK_SIZE, ctrptr, AES_BLOCK_SIZE)... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/paes_s390.c |
static inline void __crypto_unregister_skcipher(struct skcipher_alg *alg) {
if (!list_empty(&alg->base.cra_list))
crypto_unregister_skcipher(alg);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/prng.c | static int prng_sha512_reseed(void) {
int ret, seedlen;
u8 seed[64];
if (trng_available) {
/* trng produces 256 bits entropy in 32 bytes */
seedlen = 32;
cpacf_trng(NULL, 0, seed, seedlen);
} else {
/* generate_entropy() produces 256 bits entropy in 64 bytes */
seedlen = 64;
ret = gener... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/prng.c | static ssize_t prng_chunksize_show(struct device *dev,
struct device_attribute *attr, char *buf) {
return scnprintf(buf, PAGE_SIZE, "%u\n", prng_chunk_size);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/prng.c | static ssize_t prng_mode_show(struct device *dev, struct device_attribute *attr,
char *buf) {
if (prng_mode == PRNG_MODE_TDES)
return scnprintf(buf, PAGE_SIZE, "TDES\n");
else
return scnprintf(buf, PAGE_SIZE, "SHA512\n");
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/prng.c |
static void __exit prng_exit(void) {
if (prng_mode == PRNG_MODE_SHA512) {
misc_deregister(&prng_sha512_dev);
prng_sha512_deinstantiate();
} else {
misc_deregister(&prng_tdes_dev);
prng_tdes_deinstantiate();
}
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/sha1_s390.c |
static int s390_sha1_init(struct shash_desc *desc) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
sctx->state[0] = SHA1_H0;
sctx->state[1] = SHA1_H1;
sctx->state[2] = SHA1_H2;
sctx->state[3] = SHA1_H3;
sctx->state[4] = SHA1_H4;
sctx->count = 0;
sctx->func = CPACF_KIMD_SHA_1;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/sha1_s390.c |
static int s390_sha1_export(struct shash_desc *desc, void *out) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
struct sha1_state *octx = out;
octx->count = sctx->count;
memcpy(octx->state, sctx->state, sizeof(octx->state));
memcpy(octx->buffer, sctx->buf, sizeof(octx->buffer));
return 0;
} | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha256_s390.c |
static int sha256_import(struct shash_desc *desc, const void *in) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
const struct sha256_state *ictx = in;
sctx->count = ictx->count;
memcpy(sctx->state, ictx->state, sizeof(ictx->state));
memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf));
sctx->func = CPACF_... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha3_256_s390.c |
static int sha3_256_export(struct shash_desc *desc, void *out) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
struct sha3_state *octx = out;
octx->rsiz = sctx->count;
memcpy(octx->st, sctx->state, sizeof(octx->st));
memcpy(octx->buf, sctx->buf, sizeof(octx->buf));
return 0;
} | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha3_256_s390.c |
static int sha3_256_import(struct shash_desc *desc, const void *in) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
const struct sha3_state *ictx = in;
sctx->count = ictx->rsiz;
memcpy(sctx->state, ictx->st, sizeof(ictx->st));
memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf));
sctx->func = CPACF_KIMD_SH... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha3_256_s390.c |
static int sha3_224_import(struct shash_desc *desc, const void *in) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
const struct sha3_state *ictx = in;
sctx->count = ictx->rsiz;
memcpy(sctx->state, ictx->st, sizeof(ictx->st));
memcpy(sctx->buf, ictx->buf, sizeof(ictx->buf));
sctx->func = CPACF_KIMD_SH... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha3_256_s390.c |
static int sha3_224_init(struct shash_desc *desc) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
memset(sctx->state, 0, sizeof(sctx->state));
sctx->count = 0;
sctx->func = CPACF_KIMD_SHA3_224;
return 0;
} | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha3_512_s390.c |
static int sha3_384_import(struct shash_desc *desc, const void *in) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
const struct sha3_state *ictx = in;
if (unlikely(ictx->rsizw))
return -ERANGE;
sctx->count = ictx->rsiz;
memcpy(sctx->state, ictx->st, sizeof(ictx->st));
memcpy(sctx->buf, ictx->buf... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha3_512_s390.c |
static int sha3_384_init(struct shash_desc *desc) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
memset(sctx->state, 0, sizeof(sctx->state));
sctx->count = 0;
sctx->func = CPACF_KIMD_SHA3_384;
return 0;
} | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha3_512_s390.c |
static void __exit fini(void) {
crypto_unregister_shash(&sha3_512_alg);
crypto_unregister_shash(&sha3_384_alg);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/sha512_s390.c |
static int sha512_export(struct shash_desc *desc, void *out) {
struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
struct sha512_state *octx = out;
octx->count[0] = sctx->count;
octx->count[1] = 0;
memcpy(octx->state, sctx->state, sizeof(octx->state));
memcpy(octx->buf, sctx->buf, sizeof(octx->buf));
retu... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha512_s390.c |
static int sha384_init(struct shash_desc *desc) {
struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
*(__u64 *)&ctx->state[0] = SHA384_H0;
*(__u64 *)&ctx->state[2] = SHA384_H1;
*(__u64 *)&ctx->state[4] = SHA384_H2;
*(__u64 *)&ctx->state[6] = SHA384_H3;
*(__u64 *)&ctx->state[8] = SHA384_H4;
*(__u64 *)&ctx-... | [
0,
0
] |
Linux Kernel | arch/s390/crypto/sha512_s390.c |
static void __exit fini(void) {
crypto_unregister_shash(&sha512_alg);
crypto_unregister_shash(&sha384_alg);
} | [
0,
0
] |
Linux Kernel | arch/s390/crypto/sha_common.c | int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len) {
struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
unsigned int bsize = crypto_shash_blocksize(desc->tfm);
unsigned int index, n;
index = ctx->count % bsize;
ctx->count += len;
if ((index + len) < bsize)
goto store;
/* p... | [
1,
0
] |
Linux Kernel | arch/s390/crypto/sha_common.c | int s390_sha_final(struct shash_desc *desc, u8 *out) {
struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
unsigned int bsize = crypto_shash_blocksize(desc->tfm);
u64 bits;
unsigned int n;
int mbl_offset;
n = ctx->count % bsize;
bits = ctx->count * 8;
mbl_offset = s390_crypto_shash_parmsize(ctx->func);
... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_dbfs.c |
static struct hypfs_dbfs_data *
hypfs_dbfs_data_alloc(struct hypfs_dbfs_file *f) {
struct hypfs_dbfs_data *data;
data = kmalloc(sizeof(*data), GFP_KERNEL);
if (!data)
return NULL;
data->dbfs_file = f;
return data;
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_dbfs.c |
static void hypfs_dbfs_data_free(struct hypfs_dbfs_data *data) {
data->dbfs_file->data_free(data->buf_free_ptr);
kfree(data);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_dbfs.c |
void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df) {
debugfs_remove(df->dentry);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_dbfs.c |
void hypfs_dbfs_init(void) {
dbfs_dir = debugfs_create_dir("s390_hypfs", NULL);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c | static inline int info_blk_hdr__size(enum diag204_format type) {
if (type == DIAG204_INFO_SIMPLE)
return sizeof(struct diag204_info_blk_hdr);
else
return sizeof(struct diag204_x_info_blk_hdr);
} | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c | static inline void part_hdr__part_name(enum diag204_format type, void *hdr,
char *name) {
if (type == DIAG204_INFO_SIMPLE)
memcpy(name, ((struct diag204_part_hdr *)hdr)->part_name,
DIAG204_LPAR_NAME_LEN);
else
memcpy(name, ((struct diag204_x_part_hdr *)hdr)-... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c | static inline int cpu_info__size(enum diag204_format type) {
if (type == DIAG204_INFO_SIMPLE)
return sizeof(struct diag204_cpu_info);
else
return sizeof(struct diag204_x_cpu_info);
} | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c | static inline __u64 cpu_info__online_time(enum diag204_format type, void *hdr) {
if (type == DIAG204_INFO_SIMPLE)
return 0;
else /* DIAG204_INFO_EXT */
return ((struct diag204_x_cpu_info *)hdr)->online_time;
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c | static inline int phys_hdr__size(enum diag204_format type) {
if (type == DIAG204_INFO_SIMPLE)
return sizeof(struct diag204_phys_hdr);
else
return sizeof(struct diag204_x_phys_hdr);
} | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c | static inline int phys_cpu__size(enum diag204_format type) {
if (type == DIAG204_INFO_SIMPLE)
return sizeof(struct diag204_phys_cpu);
else
return sizeof(struct diag204_x_phys_cpu);
} | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c | static void *diag204_alloc_vbuf(int pages) {
diag204_buf_vmalloc = vmalloc(array_size(PAGE_SIZE, (pages + 1)));
if (!diag204_buf_vmalloc)
return ERR_PTR(-ENOMEM);
diag204_buf = page_align_ptr(diag204_buf_vmalloc);
diag204_buf_pages = pages;
return diag204_buf;
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c |
static void *diag204_alloc_rbuf(void) {
diag204_buf = (void *)__get_free_pages(GFP_KERNEL, 0);
if (!diag204_buf)
return ERR_PTR(-ENOMEM);
diag204_buf_pages = 1;
return diag204_buf;
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c |
static int diag204_do_store(void *buf, int pages) {
int rc;
rc = diag204((unsigned long)diag204_store_sc |
(unsigned long)diag204_info_type,
pages, buf);
return rc < 0 ? -ENOSYS : 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c |
static void *diag204_store(void) {
void *buf;
int pages, rc;
buf = diag204_get_buffer(diag204_info_type, &pages);
if (IS_ERR(buf))
goto out;
rc = diag204_do_store(buf, pages);
if (rc)
return ERR_PTR(rc);
out:
return buf;
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c |
static int dbfs_d204_create(void **data, void **data_free_ptr, size_t *size) {
struct dbfs_d204 *d204;
int rc, buf_size;
void *base;
buf_size = PAGE_SIZE * (diag204_buf_pages + 1) + sizeof(d204->hdr);
base = vzalloc(buf_size);
if (!base)
return -ENOMEM;
d204 = page_align_ptr(base + sizeof(d204->hdr)... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag.c |
void hypfs_diag_exit(void) {
debugfs_remove(dbfs_d204_file);
diag224_delete_name_table();
diag204_free_buffer();
hypfs_dbfs_remove_file(&dbfs_file_d204);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag0c.c | static void diag0c_fn(void *data) {
diag_stat_inc(DIAG_STAT_X00C);
diag_amode31_ops.diag0c(((void **)data)[smp_processor_id()]);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag0c.c | static void *diag0c_store(unsigned int *count) {
struct hypfs_diag0c_data *diag0c_data;
unsigned int cpu_count, cpu, i;
void **cpu_vec;
cpus_read_lock();
cpu_count = num_online_cpus();
cpu_vec = kmalloc_array(num_possible_cpus(), sizeof(*cpu_vec), GFP_KERNEL);
if (!cpu_vec)
goto fail_unlock_cpus;
... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag0c.c | static int dbfs_diag0c_create(void **data, void **data_free_ptr, size_t *size) {
struct hypfs_diag0c_data *diag0c_data;
unsigned int count;
diag0c_data = diag0c_store(&count);
if (IS_ERR(diag0c_data))
return PTR_ERR(diag0c_data);
memset(&diag0c_data->hdr, 0, sizeof(diag0c_data->hdr));
store_tod_clock_e... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag0c.c | int __init hypfs_diag0c_init(void) {
if (!MACHINE_IS_VM)
return 0;
hypfs_dbfs_create_file(&dbfs_file_0c);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_diag0c.c | void hypfs_diag0c_exit(void) {
if (!MACHINE_IS_VM)
return;
hypfs_dbfs_remove_file(&dbfs_file_0c);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_sprp.c |
static void hypfs_sprp_free(const void *data) {
free_page((unsigned long)data);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_sprp.c |
static int __hypfs_sprp_ioctl(void __user *user_area) {
struct hypfs_diag304 *diag304;
unsigned long cmd;
void __user *udata;
void *data;
int rc;
rc = -ENOMEM;
data = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
diag304 = kzalloc(sizeof(*diag304), GFP_KERNEL);
if (!data || !diag304)
goto out;
... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_sprp.c |
void hypfs_sprp_init(void) {
if (!sclp.has_sprp)
return;
hypfs_dbfs_create_file(&hypfs_sprp_file);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_vm.c | static void *diag2fc_store(char *query, unsigned int *count, int offset) {
void *data;
int size;
do {
size = diag2fc(0, query, NULL);
if (size < 0)
return ERR_PTR(-EACCES);
data = vmalloc(size + offset);
if (!data)
return ERR_PTR(-ENOMEM);
if (diag2fc(size, query, data + offset) =... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/hypfs_vm.c |
static void diag2fc_free(const void *data) { vfree(data); }
#define ATTRIBUTE(dir, name, member) \
do { \
void *rc; \
rc = hypfs_... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/inode.c |
static void hypfs_evict_inode(struct inode *inode) {
clear_inode(inode);
kfree(inode->i_private);
} | [
0,
0
] |
Linux Kernel | arch/s390/hypfs/inode.c |
static int hypfs_parse_param(struct fs_context *fc,
struct fs_parameter *param) {
struct hypfs_sb_info *hypfs_info = fc->s_fs_info;
struct fs_parse_result result;
kuid_t uid;
kgid_t gid;
int opt;
opt = fs_parse(fc, hypfs_fs_parameters, param, &result);
if (opt < 0)
retur... | [
1,
0
] |
Linux Kernel | arch/s390/hypfs/inode.c |
static int hypfs_get_tree(struct fs_context *fc) {
return get_tree_single(fc, hypfs_fill_super);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.