WSL2-Linux-Kernel/drivers/s390/crypto
Harald Freudenberger 0fef40be5d s390/ap: fix crash on older machines based on QCI info missing
On older z series machines (z12 and older) there is no QCI info
available. The AP code took care of this and the AP bus scan then
switched to simple probing via TAPQ.

With commit
283915850a ("s390/ap: notify drivers on config changed and scan complete callbacks")
some code was introduced which silently assumed that the QCI info is
always available. However, with KVM simulating an older machine (z12)
the result was a kernel crash. Funnily the same crash does not happen
on LPAR - maybe because NULL is a valid pointer and reading some data
from address 0 also works fine.

This fix now improves the code to be aware that the QCI instruction
may not be available on older machines and thus the two pointers to
QCI info structs may simple be NULL.

However, on a machine not providing the QCI info the two callbacks to
the zcrypt device drivers on_config_changed() and on_scan_complete()
provide parameters which are pointers to a QCI info struct.
These both callbacks are NOT served if there is no QCI info available.
The only consumer of these callbacks is the vfio device driver. This
driver only supports CEX4 and higher. All physical machines which are
able to provide CEX4 cards have QCI support available. So there is
no sense in for example fill the QCI info struct by hand with looping
over cards and queues and TAPQ each APQN.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Cc: stable@vger.kernel.org
Fixes: 283915850a ("s390/ap: notify drivers on config changed and scan complete callbacks")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
2022-08-15 17:19:52 +02:00
..
Makefile
ap_bus.c s390/ap: fix crash on older machines based on QCI info missing 2022-08-15 17:19:52 +02:00
ap_bus.h s390/ap: fix crash on older machines based on QCI info missing 2022-08-15 17:19:52 +02:00
ap_card.c s390/zcrypt: handle checkstopped cards with new state 2022-03-08 00:33:00 +01:00
ap_debug.h s390/zcrypt: rework of debug feature messages 2021-10-26 15:21:27 +02:00
ap_queue.c vfio/ap: Pass in physical address of ind to ap_aqic() 2022-07-23 07:29:10 -06:00
pkey_api.c s390/cpufeature: rework to allow more than only hwcap bits 2022-07-19 16:18:49 +02:00
vfio_ap_debug.h s390-vfio-ap: introduces s390 kernel debug feature for vfio_ap device driver 2022-02-06 23:31:29 +01:00
vfio_ap_drv.c s390/vfio-ap: handle config changed and scan complete notification 2022-07-19 16:18:12 +02:00
vfio_ap_ops.c s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
vfio_ap_private.h s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
zcrypt_api.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_api.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_card.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cca_key.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_ccamisc.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_ccamisc.h s390/zcrypt: add display of ASYM master key verification pattern 2022-04-25 13:54:13 +02:00
zcrypt_cex2a.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cex2a.h
zcrypt_cex2c.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cex2c.h
zcrypt_cex4.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cex4.h
zcrypt_debug.h s390/zcrypt: rework of debug feature messages 2021-10-26 15:21:27 +02:00
zcrypt_ep11misc.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_ep11misc.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_error.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype6.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype6.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype50.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype50.h s390/zcrypt: Support CPRB minor version T7 2022-03-08 00:33:00 +01:00
zcrypt_queue.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00