By analyzing the Log && latest QAT Driver code (qat1.7.l.4.5.0-00034.tar.gz), the basic sequence of the problem is as follows:
qat_rsa_init_tfm() |-->qat_crypto_get_instance_node(get_current_node()); |-->topology_physical_package_id(smp_processor_id()); ----------------------- Preemptive risk point: static inline int get_current_node(void) { return topology_physical_package_id(smp_processor_id()); } ---------------------- Solutions waiting to be discussed:
diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h b/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h index 35f0f44..bbe95d9 100644 --- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h +++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h @@ -100,7 +100,11 @@ struct service_hndl {
static inline int get_current_node(void) { - return topology_physical_package_id(smp_processor_id()); + unsigned int cpu; + preempt_disable(); + cpu = smp_processor_id(); + preempt_enable(); + return topology_physical_package_id(cpu); }
int adf_service_register(struct service_hndl *service); -- 2.7.4 ---------------------- Reference materials: https://www.kernel.org/doc/Documentation/preempt-locking.txt
By analyzing the Log && latest QAT Driver code (qat1.7. l.4.5.0- 00034.tar. gz),
the basic sequence of the problem is as follows:
qat_rsa_init_tfm() ->qat_crypto_ get_instance_ node(get_ current_ node()) ;
|- ->topology_ physical_ package_ id(smp_ processor_ id()); ------- ------- -- node(void) physical_ package_ id(smp_ processor_ id()); ------- ------- -
|-
-------
Preemptive risk point:
static inline int get_current_
{
return topology_
}
-------
Solutions waiting to be discussed:
diff --git a/quickassist/ qat/drivers/ crypto/ qat/qat_ common/ adf_common_ drv.h b/quickassist/ qat/drivers/ crypto/ qat/qat_ common/ adf_common_ drv.h qat/drivers/ crypto/ qat/qat_ common/ adf_common_ drv.h qat/drivers/ crypto/ qat/qat_ common/ adf_common_ drv.h
index 35f0f44..bbe95d9 100644
--- a/quickassist/
+++ b/quickassist/
@@ -100,7 +100,11 @@ struct service_hndl {
static inline int get_current_ node(void) physical_ package_ id(smp_ processor_ id()); physical_ package_ id(cpu) ;
{
- return topology_
+ unsigned int cpu;
+ preempt_disable();
+ cpu = smp_processor_id();
+ preempt_enable();
+ return topology_
}
int adf_service_ register( struct service_hndl *service); ------- ------- - /www.kernel. org/doc/ Documentation/ preempt- locking. txt
--
2.7.4
-------
Reference materials:
https:/