mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 01:45:20 +07:00
64d85cc999
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation version 2 only this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 675 mass ave cambridge ma 02139 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 15 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141902.274594435@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
77 lines
1.8 KiB
C
77 lines
1.8 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/**
|
|
* Routines supporting VMX instructions on the Power 8
|
|
*
|
|
* Copyright (C) 2015 International Business Machines Inc.
|
|
*
|
|
* Author: Marcelo Henrique Cerri <mhcerri@br.ibm.com>
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/moduleparam.h>
|
|
#include <linux/types.h>
|
|
#include <linux/err.h>
|
|
#include <linux/cpufeature.h>
|
|
#include <linux/crypto.h>
|
|
#include <asm/cputable.h>
|
|
#include <crypto/internal/hash.h>
|
|
|
|
extern struct shash_alg p8_ghash_alg;
|
|
extern struct crypto_alg p8_aes_alg;
|
|
extern struct crypto_alg p8_aes_cbc_alg;
|
|
extern struct crypto_alg p8_aes_ctr_alg;
|
|
extern struct crypto_alg p8_aes_xts_alg;
|
|
static struct crypto_alg *algs[] = {
|
|
&p8_aes_alg,
|
|
&p8_aes_cbc_alg,
|
|
&p8_aes_ctr_alg,
|
|
&p8_aes_xts_alg,
|
|
NULL,
|
|
};
|
|
|
|
static int __init p8_init(void)
|
|
{
|
|
int ret = 0;
|
|
struct crypto_alg **alg_it;
|
|
|
|
for (alg_it = algs; *alg_it; alg_it++) {
|
|
ret = crypto_register_alg(*alg_it);
|
|
printk(KERN_INFO "crypto_register_alg '%s' = %d\n",
|
|
(*alg_it)->cra_name, ret);
|
|
if (ret) {
|
|
for (alg_it--; alg_it >= algs; alg_it--)
|
|
crypto_unregister_alg(*alg_it);
|
|
break;
|
|
}
|
|
}
|
|
if (ret)
|
|
return ret;
|
|
|
|
ret = crypto_register_shash(&p8_ghash_alg);
|
|
if (ret) {
|
|
for (alg_it = algs; *alg_it; alg_it++)
|
|
crypto_unregister_alg(*alg_it);
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
static void __exit p8_exit(void)
|
|
{
|
|
struct crypto_alg **alg_it;
|
|
|
|
for (alg_it = algs; *alg_it; alg_it++) {
|
|
printk(KERN_INFO "Removing '%s'\n", (*alg_it)->cra_name);
|
|
crypto_unregister_alg(*alg_it);
|
|
}
|
|
crypto_unregister_shash(&p8_ghash_alg);
|
|
}
|
|
|
|
module_cpu_feature_match(PPC_MODULE_FEATURE_VEC_CRYPTO, p8_init);
|
|
module_exit(p8_exit);
|
|
|
|
MODULE_AUTHOR("Marcelo Cerri<mhcerri@br.ibm.com>");
|
|
MODULE_DESCRIPTION("IBM VMX cryptographic acceleration instructions "
|
|
"support on Power 8");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_VERSION("1.0.0");
|