Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/zcrypt: CCA control CPRB sending

When sending a CCA CPRB to a control domain, the CPRB has to be sent via a
usage domain. Previous code used the default domain to route this message.
If the default domain is not online and ready to send the CPRB, the ioctl will
fail even if other usage domains could be used to send the CPRB.

To improve this, instead of using the default domain, switch to auto-select of
the domain.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Juergen Christ and committed by
Heiko Carstens
cff2d3ab 24842079

+3 -4
+3 -4
drivers/s390/crypto/zcrypt_api.c
··· 878 878 879 879 /* 880 880 * If a valid target domain is set and this domain is NOT a usage 881 - * domain but a control only domain, use the default domain as target. 881 + * domain but a control only domain, autoselect target domain. 882 882 */ 883 883 tdom = *domain; 884 884 if (tdom < AP_DOMAINS && 885 885 !ap_test_config_usage_domain(tdom) && 886 - ap_test_config_ctrl_domain(tdom) && 887 - ap_domain_index >= 0) 888 - tdom = ap_domain_index; 886 + ap_test_config_ctrl_domain(tdom)) 887 + tdom = AUTOSEL_DOM; 889 888 890 889 pref_zc = NULL; 891 890 pref_zq = NULL;