diff options
Diffstat (limited to 'arch/sparc')
| -rw-r--r-- | arch/sparc/Kconfig | 1 | ||||
| -rw-r--r-- | arch/sparc/crypto/aes_glue.c | 8 | ||||
| -rw-r--r-- | arch/sparc/crypto/des_glue.c | 37 | ||||
| -rw-r--r-- | arch/sparc/include/asm/pci.h | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/sys_sparc_64.c | 33 | 
5 files changed, 39 insertions, 42 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 7926a2e11bdc..fbc1aecf0f94 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -17,6 +17,7 @@ config SPARC  	select ARCH_MIGHT_HAVE_PC_SERIO  	select OF  	select OF_PROMTREE +	select HAVE_ASM_MODVERSIONS  	select HAVE_IDE  	select HAVE_OPROFILE  	select HAVE_ARCH_KGDB if !SMP || SPARC64 diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c index 57b474113168..7b946b3dee9d 100644 --- a/arch/sparc/crypto/aes_glue.c +++ b/arch/sparc/crypto/aes_glue.c @@ -197,14 +197,14 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,  	return 0;  } -static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  {  	struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm);  	ctx->ops->encrypt(&ctx->key[0], (const u32 *) src, (u32 *) dst);  } -static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void crypto_aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  {  	struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); @@ -396,8 +396,8 @@ static struct crypto_alg algs[] = { {  			.cia_min_keysize	= AES_MIN_KEY_SIZE,  			.cia_max_keysize	= AES_MAX_KEY_SIZE,  			.cia_setkey		= aes_set_key, -			.cia_encrypt		= aes_encrypt, -			.cia_decrypt		= aes_decrypt +			.cia_encrypt		= crypto_aes_encrypt, +			.cia_decrypt		= crypto_aes_decrypt  		}  	}  }, { diff --git a/arch/sparc/crypto/des_glue.c b/arch/sparc/crypto/des_glue.c index 281448f72c90..db6010b4e52e 100644 --- a/arch/sparc/crypto/des_glue.c +++ b/arch/sparc/crypto/des_glue.c @@ -12,7 +12,7 @@  #include <linux/mm.h>  #include <linux/types.h>  #include <crypto/algapi.h> -#include <crypto/des.h> +#include <crypto/internal/des.h>  #include <asm/fpumacro.h>  #include <asm/pstate.h> @@ -45,19 +45,15 @@ static int des_set_key(struct crypto_tfm *tfm, const u8 *key,  		       unsigned int keylen)  {  	struct des_sparc64_ctx *dctx = crypto_tfm_ctx(tfm); -	u32 *flags = &tfm->crt_flags; -	u32 tmp[DES_EXPKEY_WORDS]; -	int ret; +	int err;  	/* Even though we have special instructions for key expansion, -	 * we call des_ekey() so that we don't have to write our own +	 * we call des_verify_key() so that we don't have to write our own  	 * weak key detection code.  	 */ -	ret = des_ekey(tmp, key); -	if (unlikely(ret == 0) && (*flags & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS)) { -		*flags |= CRYPTO_TFM_RES_WEAK_KEY; -		return -EINVAL; -	} +	err = crypto_des_verify_key(tfm, key); +	if (err) +		return err;  	des_sparc64_key_expand((const u32 *) key, &dctx->encrypt_expkey[0]);  	encrypt_to_decrypt(&dctx->decrypt_expkey[0], &dctx->encrypt_expkey[0]); @@ -68,7 +64,7 @@ static int des_set_key(struct crypto_tfm *tfm, const u8 *key,  extern void des_sparc64_crypt(const u64 *key, const u64 *input,  			      u64 *output); -static void des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void sparc_des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  {  	struct des_sparc64_ctx *ctx = crypto_tfm_ctx(tfm);  	const u64 *K = ctx->encrypt_expkey; @@ -76,7 +72,7 @@ static void des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  	des_sparc64_crypt(K, (const u64 *) src, (u64 *) dst);  } -static void des_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void sparc_des_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  {  	struct des_sparc64_ctx *ctx = crypto_tfm_ctx(tfm);  	const u64 *K = ctx->decrypt_expkey; @@ -202,14 +198,13 @@ static int des3_ede_set_key(struct crypto_tfm *tfm, const u8 *key,  			    unsigned int keylen)  {  	struct des3_ede_sparc64_ctx *dctx = crypto_tfm_ctx(tfm); -	u32 *flags = &tfm->crt_flags;  	u64 k1[DES_EXPKEY_WORDS / 2];  	u64 k2[DES_EXPKEY_WORDS / 2];  	u64 k3[DES_EXPKEY_WORDS / 2];  	int err; -	err = __des3_verify_key(flags, key); -	if (unlikely(err)) +	err = crypto_des3_ede_verify_key(tfm, key); +	if (err)  		return err;  	des_sparc64_key_expand((const u32 *)key, k1); @@ -235,7 +230,7 @@ static int des3_ede_set_key(struct crypto_tfm *tfm, const u8 *key,  extern void des3_ede_sparc64_crypt(const u64 *key, const u64 *input,  				   u64 *output); -static void des3_ede_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void sparc_des3_ede_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  {  	struct des3_ede_sparc64_ctx *ctx = crypto_tfm_ctx(tfm);  	const u64 *K = ctx->encrypt_expkey; @@ -243,7 +238,7 @@ static void des3_ede_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  	des3_ede_sparc64_crypt(K, (const u64 *) src, (u64 *) dst);  } -static void des3_ede_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void sparc_des3_ede_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)  {  	struct des3_ede_sparc64_ctx *ctx = crypto_tfm_ctx(tfm);  	const u64 *K = ctx->decrypt_expkey; @@ -390,8 +385,8 @@ static struct crypto_alg algs[] = { {  			.cia_min_keysize	= DES_KEY_SIZE,  			.cia_max_keysize	= DES_KEY_SIZE,  			.cia_setkey		= des_set_key, -			.cia_encrypt		= des_encrypt, -			.cia_decrypt		= des_decrypt +			.cia_encrypt		= sparc_des_encrypt, +			.cia_decrypt		= sparc_des_decrypt  		}  	}  }, { @@ -447,8 +442,8 @@ static struct crypto_alg algs[] = { {  			.cia_min_keysize	= DES3_EDE_KEY_SIZE,  			.cia_max_keysize	= DES3_EDE_KEY_SIZE,  			.cia_setkey		= des3_ede_set_key, -			.cia_encrypt		= des3_ede_encrypt, -			.cia_decrypt		= des3_ede_decrypt +			.cia_encrypt		= sparc_des3_ede_encrypt, +			.cia_decrypt		= sparc_des3_ede_decrypt  		}  	}  }, { diff --git a/arch/sparc/include/asm/pci.h b/arch/sparc/include/asm/pci.h index cfec79bb1831..4deddf430e5d 100644 --- a/arch/sparc/include/asm/pci.h +++ b/arch/sparc/include/asm/pci.h @@ -38,8 +38,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)  #define arch_can_pci_mmap_io()	1  #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA  #define get_pci_unmapped_area get_fb_unmapped_area - -#define HAVE_ARCH_PCI_RESOURCE_TO_USER  #endif /* CONFIG_SPARC64 */  #if defined(CONFIG_SPARC64) || defined(CONFIG_LEON_PCI) diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index ccc88926bc00..9f41a6f5a032 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c @@ -336,25 +336,28 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second  {  	long err; +	if (!IS_ENABLED(CONFIG_SYSVIPC)) +		return -ENOSYS; +  	/* No need for backward compatibility. We can start fresh... */  	if (call <= SEMTIMEDOP) {  		switch (call) {  		case SEMOP: -			err = sys_semtimedop(first, ptr, -					     (unsigned int)second, NULL); +			err = ksys_semtimedop(first, ptr, +					      (unsigned int)second, NULL);  			goto out;  		case SEMTIMEDOP: -			err = sys_semtimedop(first, ptr, (unsigned int)second, +			err = ksys_semtimedop(first, ptr, (unsigned int)second,  				(const struct __kernel_timespec __user *) -					     (unsigned long) fifth); +					      (unsigned long) fifth);  			goto out;  		case SEMGET: -			err = sys_semget(first, (int)second, (int)third); +			err = ksys_semget(first, (int)second, (int)third);  			goto out;  		case SEMCTL: { -			err = sys_semctl(first, second, -					 (int)third | IPC_64, -					 (unsigned long) ptr); +			err = ksys_old_semctl(first, second, +					      (int)third | IPC_64, +					      (unsigned long) ptr);  			goto out;  		}  		default: @@ -365,18 +368,18 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second  	if (call <= MSGCTL) {  		switch (call) {  		case MSGSND: -			err = sys_msgsnd(first, ptr, (size_t)second, +			err = ksys_msgsnd(first, ptr, (size_t)second,  					 (int)third);  			goto out;  		case MSGRCV: -			err = sys_msgrcv(first, ptr, (size_t)second, fifth, +			err = ksys_msgrcv(first, ptr, (size_t)second, fifth,  					 (int)third);  			goto out;  		case MSGGET: -			err = sys_msgget((key_t)first, (int)second); +			err = ksys_msgget((key_t)first, (int)second);  			goto out;  		case MSGCTL: -			err = sys_msgctl(first, (int)second | IPC_64, ptr); +			err = ksys_old_msgctl(first, (int)second | IPC_64, ptr);  			goto out;  		default:  			err = -ENOSYS; @@ -396,13 +399,13 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second  			goto out;  		}  		case SHMDT: -			err = sys_shmdt(ptr); +			err = ksys_shmdt(ptr);  			goto out;  		case SHMGET: -			err = sys_shmget(first, (size_t)second, (int)third); +			err = ksys_shmget(first, (size_t)second, (int)third);  			goto out;  		case SHMCTL: -			err = sys_shmctl(first, (int)second | IPC_64, ptr); +			err = ksys_old_shmctl(first, (int)second | IPC_64, ptr);  			goto out;  		default:  			err = -ENOSYS;  |