Unverified Commit c2f62f1b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5482 [OLK-6.6] crypto: update zhaoxin-aes for __pcpu_unique_paes_last_cword

Merge Pull Request from: @leoliu-oc 
 
Eliminate compilation issues when compiling the kernel using allyesconfig.

### Issue
https://gitee.com/openeuler/kernel/issues/I99V97

### Test
build pass. 
 
Link:https://gitee.com/openeuler/kernel/pulls/5482

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parents df325a53 3b017e71
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ struct aes_ctx {
	u32 *D;
};

static DEFINE_PER_CPU(struct cword *, paes_last_cword);
static DEFINE_PER_CPU(struct cword *, zx_paes_last_cword);

/* Tells whether the ACE is capable to generate the extended key for a given key_len. */
static inline int aes_hw_extkey_available(uint8_t key_len)
@@ -142,9 +142,9 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, unsigned int ke

ok:
	for_each_online_cpu(cpu)
		if (&ctx->cword.encrypt == per_cpu(paes_last_cword, cpu) ||
			&ctx->cword.decrypt == per_cpu(paes_last_cword, cpu))
			per_cpu(paes_last_cword, cpu) = NULL;
		if (&ctx->cword.encrypt == per_cpu(zx_paes_last_cword, cpu) ||
			&ctx->cword.decrypt == per_cpu(zx_paes_last_cword, cpu))
			per_cpu(zx_paes_last_cword, cpu) = NULL;

	return 0;
}
@@ -162,7 +162,7 @@ static inline void padlock_reset_key(struct cword *cword)
{
	int cpu = raw_smp_processor_id();

	if (cword != per_cpu(paes_last_cword, cpu))
	if (cword != per_cpu(zx_paes_last_cword, cpu))
#ifndef CONFIG_X86_64
		asm volatile ("pushfl; popfl");
#else
@@ -172,7 +172,7 @@ static inline void padlock_reset_key(struct cword *cword)

static inline void padlock_store_cword(struct cword *cword)
{
	per_cpu(paes_last_cword, raw_smp_processor_id()) = cword;
	per_cpu(zx_paes_last_cword, raw_smp_processor_id()) = cword;
}

/*