Skip to content

Commit cff2d3a

Browse files
juergenchristhcahca
authored andcommitted
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>
1 parent 2484207 commit cff2d3a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎drivers/s390/crypto/zcrypt_api.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,14 +878,13 @@ static long _zcrypt_send_cprb(bool userspace, struct ap_perms *perms,
878878

879879
/*
880880
* 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.
882882
*/
883883
tdom = *domain;
884884
if (tdom < AP_DOMAINS &&
885885
!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;
889888

890889
pref_zc = NULL;
891890
pref_zq = NULL;

0 commit comments

Comments
 (0)