linux/drivers/s390
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
..
block s390/dasd: Establish DMA alignment 2022-08-04 16:19:15 -06:00
char s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
cio VFIO updates for v6.0-rc1 2022-08-06 08:59:35 -07:00
crypto s390/ap: fix crash on older machines based on QCI info missing 2022-08-15 17:19:52 +02:00
net s390/qeth: cache link_info for ethtool 2022-08-08 20:57:56 -07:00
scsi scsi: zfcp: Fix missing auto port scan and thus missing target ports 2022-08-01 19:50:00 -04:00
virtio virtio: fatures, fixes 2022-08-12 09:50:34 -07:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00