summaryrefslogtreecommitdiff
path: root/include/linux/hisi_acc_qm.h
diff options
context:
space:
mode:
authorWeili Qian <qianweili@huawei.com>2023-10-08 20:36:17 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-10-14 12:05:39 +0800
commit5b90073defd1a52aa8120403d79f6e0fc10c87ee (patch)
tree7945a8b1f45dc33ec1e2f1621a9ced2791d43696 /include/linux/hisi_acc_qm.h
parent8405ec8e3c02df8b3720874c3e2169fef4553868 (diff)
downloadlwn-5b90073defd1a52aa8120403d79f6e0fc10c87ee.tar.gz
lwn-5b90073defd1a52aa8120403d79f6e0fc10c87ee.zip
crypto: hisilicon/qm - alloc buffer to set and get xqc
If the temporarily applied memory is used to set or get the xqc information, the driver releases the memory immediately after the hardware mailbox operation time exceeds the driver waiting time. However, the hardware does not cancel the operation, so the hardware may write data to released memory. Therefore, when the driver is bound to a device, the driver reserves memory for the xqc configuration. The subsequent xqc configuration uses the reserved memory to prevent hardware from accessing the released memory. Signed-off-by: Weili Qian <qianweili@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/hisi_acc_qm.h')
-rw-r--r--include/linux/hisi_acc_qm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/hisi_acc_qm.h b/include/linux/hisi_acc_qm.h
index 34c64a02712c..44e0c44a2e20 100644
--- a/include/linux/hisi_acc_qm.h
+++ b/include/linux/hisi_acc_qm.h
@@ -292,6 +292,18 @@ struct qm_err_isolate {
struct list_head qm_hw_errs;
};
+struct qm_rsv_buf {
+ struct qm_sqc *sqc;
+ struct qm_cqc *cqc;
+ struct qm_eqc *eqc;
+ struct qm_aeqc *aeqc;
+ dma_addr_t sqc_dma;
+ dma_addr_t cqc_dma;
+ dma_addr_t eqc_dma;
+ dma_addr_t aeqc_dma;
+ struct qm_dma qcdma;
+};
+
struct hisi_qm {
enum qm_hw_ver ver;
enum qm_fun_type fun_type;
@@ -324,6 +336,7 @@ struct hisi_qm {
dma_addr_t cqc_dma;
dma_addr_t eqe_dma;
dma_addr_t aeqe_dma;
+ struct qm_rsv_buf xqc_buf;
struct hisi_qm_status status;
const struct hisi_qm_err_ini *err_ini;