Skip to content

Commit 2324de6

Browse files
committed
Merge tag 's390-5.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Vasily Gorbik: - Fix printing misleading Secure-IPL enabled message when it is not. - Fix a race condition between host ap bus and guest ap bus doing device reset in crypto code. - Fix sanity check in CCA cipher key function (CCA AES cipher key support), which fails otherwise. * tag 's390-5.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/setup: Fix secure ipl message s390/zcrypt: move ap device reset from bus to driver code s390/zcrypt: Fix CCA cipher key gen with clear key value function
2 parents 8965de7 + 40260b0 commit 2324de6

File tree

8 files changed

+11
-8
lines changed

8 files changed

+11
-8
lines changed

arch/s390/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ static void __init log_component_list(void)
10521052

10531053
if (!early_ipl_comp_list_addr)
10541054
return;
1055-
if (ipl_block.hdr.flags & IPL_PL_FLAG_IPLSR)
1055+
if (ipl_block.hdr.flags & IPL_PL_FLAG_SIPL)
10561056
pr_info("Linux is running with Secure-IPL enabled\n");
10571057
else
10581058
pr_info("Linux is running with Secure-IPL disabled\n");

drivers/s390/crypto/ap_bus.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,6 @@ static int ap_device_probe(struct device *dev)
793793
drvres = ap_drv->flags & AP_DRIVER_FLAG_DEFAULT;
794794
if (!!devres != !!drvres)
795795
return -ENODEV;
796-
/* (re-)init queue's state machine */
797-
ap_queue_reinit_state(to_ap_queue(dev));
798796
}
799797

800798
/* Add queue/card to list of active queues/cards */

drivers/s390/crypto/ap_bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void ap_queue_prepare_remove(struct ap_queue *aq);
261261
void ap_queue_remove(struct ap_queue *aq);
262262
void ap_queue_suspend(struct ap_device *ap_dev);
263263
void ap_queue_resume(struct ap_device *ap_dev);
264-
void ap_queue_reinit_state(struct ap_queue *aq);
264+
void ap_queue_init_state(struct ap_queue *aq);
265265

266266
struct ap_card *ap_card_create(int id, int queue_depth, int raw_device_type,
267267
int comp_device_type, unsigned int functions);

drivers/s390/crypto/ap_queue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type)
638638
aq->ap_dev.device.type = &ap_queue_type;
639639
aq->ap_dev.device_type = device_type;
640640
aq->qid = qid;
641-
aq->state = AP_STATE_RESET_START;
641+
aq->state = AP_STATE_UNBOUND;
642642
aq->interrupt = AP_INTR_DISABLED;
643643
spin_lock_init(&aq->lock);
644644
INIT_LIST_HEAD(&aq->list);
@@ -771,10 +771,11 @@ void ap_queue_remove(struct ap_queue *aq)
771771
spin_unlock_bh(&aq->lock);
772772
}
773773

774-
void ap_queue_reinit_state(struct ap_queue *aq)
774+
void ap_queue_init_state(struct ap_queue *aq)
775775
{
776776
spin_lock_bh(&aq->lock);
777777
aq->state = AP_STATE_RESET_START;
778778
ap_wait(ap_sm_event(aq, AP_EVENT_POLL));
779779
spin_unlock_bh(&aq->lock);
780780
}
781+
EXPORT_SYMBOL(ap_queue_init_state);

drivers/s390/crypto/zcrypt_ccamisc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,8 +1037,8 @@ static int _ip_cprb_helper(u16 cardnr, u16 domain,
10371037
prepparm = (struct iprepparm *) prepcblk->rpl_parmb;
10381038

10391039
/* do some plausibility checks on the key block */
1040-
if (prepparm->kb.len < 120 + 5 * sizeof(uint16_t) ||
1041-
prepparm->kb.len > 136 + 5 * sizeof(uint16_t)) {
1040+
if (prepparm->kb.len < 120 + 3 * sizeof(uint16_t) ||
1041+
prepparm->kb.len > 136 + 3 * sizeof(uint16_t)) {
10421042
DEBUG_ERR("%s reply with invalid or unknown key block\n",
10431043
__func__);
10441044
rc = -EIO;

drivers/s390/crypto/zcrypt_cex2a.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ static int zcrypt_cex2a_queue_probe(struct ap_device *ap_dev)
175175
zq->queue = aq;
176176
zq->online = 1;
177177
atomic_set(&zq->load, 0);
178+
ap_queue_init_state(aq);
178179
ap_queue_init_reply(aq, &zq->reply);
179180
aq->request_timeout = CEX2A_CLEANUP_TIME,
180181
aq->private = zq;

drivers/s390/crypto/zcrypt_cex2c.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev)
220220
zq->queue = aq;
221221
zq->online = 1;
222222
atomic_set(&zq->load, 0);
223+
ap_rapq(aq->qid);
223224
rc = zcrypt_cex2c_rng_supported(aq);
224225
if (rc < 0) {
225226
zcrypt_queue_free(zq);
@@ -231,6 +232,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev)
231232
else
232233
zq->ops = zcrypt_msgtype(MSGTYPE06_NAME,
233234
MSGTYPE06_VARIANT_NORNG);
235+
ap_queue_init_state(aq);
234236
ap_queue_init_reply(aq, &zq->reply);
235237
aq->request_timeout = CEX2C_CLEANUP_TIME;
236238
aq->private = zq;

drivers/s390/crypto/zcrypt_cex4.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ static int zcrypt_cex4_queue_probe(struct ap_device *ap_dev)
381381
zq->queue = aq;
382382
zq->online = 1;
383383
atomic_set(&zq->load, 0);
384+
ap_queue_init_state(aq);
384385
ap_queue_init_reply(aq, &zq->reply);
385386
aq->request_timeout = CEX4_CLEANUP_TIME,
386387
aq->private = zq;

0 commit comments

Comments
 (0)