diff options
author | Yongxin Liu <yongxin.liu@windriver.com> | 2020-12-07 14:32:08 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2020-12-08 09:39:30 +0800 |
commit | 5ddfed134623a0d7dc7fb15d68c0ae9b5a977b44 (patch) | |
tree | eb9aac92d53b532b01d7cdf2fd389d82800932f5 | |
parent | 8b151bae801d0f9a8be4aaf960531f020880714b (diff) | |
download | meta-intel-qat-5ddfed134623a0d7dc7fb15d68c0ae9b5a977b44.tar.gz |
qat17: silence smp_processor_id() warning
Fix the following call trace by backporting patch from mainline kernel.
BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/956
caller is debug_smp_processor_id+0x17/0x20
CPU: 19 PID: 956 Comm: modprobe Tainted: G IO 5.10.0-rc4-yoctodev-standard #1
Hardware name: Intel Corporation S2600WFS/S2600WFS, BIOS SE5C620.86B.01.00.0694.120620170818 12/06/2017
Call Trace:
dump_stack+0x60/0x76
check_preemption_disabled+0xc4/0xd0
debug_smp_processor_id+0x17/0x20
qat_rsa_init_tfm+0x1b/0x60 [intel_qat]
crypto_akcipher_init_tfm+0x2c/0x30
crypto_create_tfm_node+0x5f/0x110
crypto_spawn_tfm2+0x34/0x60
pkcs1pad_init_tfm+0x1d/0x40
crypto_akcipher_init_tfm+0x2c/0x30
crypto_create_tfm_node+0x5f/0x110
crypto_alloc_tfm_node+0x6c/0xd0
crypto_alloc_akcipher+0x1f/0x30
public_key_verify_signature+0x7b/0x3e0
? sha256_update+0x65/0xe0
? sha256_final+0x65/0xb0
? crypto_shash_finup+0x2c/0x90
? __kmalloc+0x5c/0x550
x509_check_for_self_signed+0xad/0x100
x509_cert_parse+0x1aa/0x200
x509_key_preparse+0x26/0x1f0
asymmetric_key_preparse+0x50/0x80
key_create_or_update+0x1d0/0x520
regulatory_init+0x17d/0x265 [cfg80211]
cfg80211_init+0x6b/0xd4 [cfg80211]
? 0xffffffffc131b000
do_one_initcall+0x51/0x210
? kmem_cache_alloc_trace+0x32/0x500
do_init_module+0x62/0x270
load_module+0x268e/0x2850
__do_sys_finit_module+0xb1/0xf0
__x64_sys_finit_module+0x1a/0x20
do_syscall_64+0x38/0x50
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r-- | recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch | 72 | ||||
-rw-r--r-- | recipes-extended/qat/qat17_4.7.0-00006.bb | 1 |
2 files changed, 73 insertions, 0 deletions
diff --git a/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch b/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch new file mode 100644 index 0000000..262651f --- /dev/null +++ b/recipes-extended/qat/files/qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | From 21b67ec634271aafd73cffb3e73c0ba494dce3cd Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Sverdlin <alexander.sverdlin@nokia.com> | ||
3 | Date: Tue, 23 Jul 2019 07:24:01 +0000 | ||
4 | Subject: [PATCH] crypto: qat - Silence smp_processor_id() warning | ||
5 | |||
6 | It seems that smp_processor_id() is only used for a best-effort | ||
7 | load-balancing, refer to qat_crypto_get_instance_node(). It's not feasible | ||
8 | to disable preemption for the duration of the crypto requests. Therefore, | ||
9 | just silence the warning. This commit is similar to e7a9b05ca4 | ||
10 | ("crypto: cavium - Fix smp_processor_id() warnings"). | ||
11 | |||
12 | Silences the following splat: | ||
13 | BUG: using smp_processor_id() in preemptible [00000000] code: cryptomgr_test/2904 | ||
14 | caller is qat_alg_ablkcipher_setkey+0x300/0x4a0 [intel_qat] | ||
15 | CPU: 1 PID: 2904 Comm: cryptomgr_test Tainted: P O 4.14.69 #1 | ||
16 | ... | ||
17 | Call Trace: | ||
18 | dump_stack+0x5f/0x86 | ||
19 | check_preemption_disabled+0xd3/0xe0 | ||
20 | qat_alg_ablkcipher_setkey+0x300/0x4a0 [intel_qat] | ||
21 | skcipher_setkey_ablkcipher+0x2b/0x40 | ||
22 | __test_skcipher+0x1f3/0xb20 | ||
23 | ? cpumask_next_and+0x26/0x40 | ||
24 | ? find_busiest_group+0x10e/0x9d0 | ||
25 | ? preempt_count_add+0x49/0xa0 | ||
26 | ? try_module_get+0x61/0xf0 | ||
27 | ? crypto_mod_get+0x15/0x30 | ||
28 | ? __kmalloc+0x1df/0x1f0 | ||
29 | ? __crypto_alloc_tfm+0x116/0x180 | ||
30 | ? crypto_skcipher_init_tfm+0xa6/0x180 | ||
31 | ? crypto_create_tfm+0x4b/0xf0 | ||
32 | test_skcipher+0x21/0xa0 | ||
33 | alg_test_skcipher+0x3f/0xa0 | ||
34 | alg_test.part.6+0x126/0x2a0 | ||
35 | ? finish_task_switch+0x21b/0x260 | ||
36 | ? __schedule+0x1e9/0x800 | ||
37 | ? __wake_up_common+0x8d/0x140 | ||
38 | cryptomgr_test+0x40/0x50 | ||
39 | kthread+0xff/0x130 | ||
40 | ? cryptomgr_notify+0x540/0x540 | ||
41 | ? kthread_create_on_node+0x70/0x70 | ||
42 | ret_from_fork+0x24/0x50 | ||
43 | |||
44 | Fixes: ed8ccaef52 ("crypto: qat - Add support for SRIOV") | ||
45 | Cc: stable@vger.kernel.org | ||
46 | Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> | ||
47 | Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ||
48 | |||
49 | Upstream-Status: Backport | ||
50 | [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1b82feb6c5e1996513d0fb0bbb475417088b4954] | ||
51 | |||
52 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
53 | --- | ||
54 | quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h | 2 +- | ||
55 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
56 | |||
57 | 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 | ||
58 | index 08e3519..87dd5f1 100644 | ||
59 | --- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h | ||
60 | +++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_common_drv.h | ||
61 | @@ -100,7 +100,7 @@ struct service_hndl { | ||
62 | |||
63 | static inline int get_current_node(void) | ||
64 | { | ||
65 | - return topology_physical_package_id(smp_processor_id()); | ||
66 | + return topology_physical_package_id(raw_smp_processor_id()); | ||
67 | } | ||
68 | |||
69 | int adf_service_register(struct service_hndl *service); | ||
70 | -- | ||
71 | 2.14.4 | ||
72 | |||
diff --git a/recipes-extended/qat/qat17_4.7.0-00006.bb b/recipes-extended/qat/qat17_4.7.0-00006.bb index af292cf..e1c619d 100644 --- a/recipes-extended/qat/qat17_4.7.0-00006.bb +++ b/recipes-extended/qat/qat17_4.7.0-00006.bb | |||
@@ -26,6 +26,7 @@ SRC_URI = "https://01.org/sites/default/files/downloads/qat1.7.l.4.7.0-00006.tar | |||
26 | file://qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch \ | 26 | file://qat17_4.7.0-00006-crypto-qat-adf_aer-Remove-pci_cleanup_aer_uncorrect_.patch \ |
27 | file://qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch \ | 27 | file://qat17_4.7.0-00006-qat-replace-linux-cryptohash.h-with-crypto-sha.h-for.patch \ |
28 | file://qat17_4.7.0-00006-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch \ | 28 | file://qat17_4.7.0-00006-overwrite-KBUILD_BUILTIN-in-kernel-s-Makefile.patch \ |
29 | file://qat17_4.7.0-00006-crypto-qat-Silence-smp_processor_id-warning.patch \ | ||
29 | " | 30 | " |
30 | 31 | ||
31 | do_fetch[depends] += "virtual/kernel:do_shared_workdir" | 32 | do_fetch[depends] += "virtual/kernel:do_shared_workdir" |