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

Merge tag 's390-5.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Vasily Gorbik:

- Fix zcrypt ioctl hang due to AP queue msg counter dropping below 0
when pending requests are purged.

- Two fixes for the machine check handler in the entry code.

* tag 's390-5.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/ap: Fix hanging ioctl caused by wrong msg counter
s390/mcck: fix invalid KVM guest condition check
s390/mcck: fix calculation of SIE critical section size

+11 -4
+2 -2
arch/s390/kernel/entry.S
··· 651 651 .Lcleanup_sie_mcck: 652 652 larl %r13,.Lsie_entry 653 653 slgr %r9,%r13 654 - larl %r13,.Lsie_skip 654 + lghi %r13,.Lsie_skip - .Lsie_entry 655 655 clgr %r9,%r13 656 - jh .Lcleanup_sie_int 656 + jhe .Lcleanup_sie_int 657 657 oi __LC_CPU_FLAGS+7, _CIF_MCCK_GUEST 658 658 .Lcleanup_sie_int: 659 659 BPENTER __SF_SIE_FLAGS(%r15),(_TIF_ISOLATE_BP|_TIF_ISOLATE_BP_GUEST)
+9 -2
drivers/s390/crypto/ap_queue.c
··· 135 135 { 136 136 struct ap_queue_status status; 137 137 struct ap_message *ap_msg; 138 + bool found = false; 138 139 139 140 status = ap_dqap(aq->qid, &aq->reply->psmid, 140 141 aq->reply->msg, aq->reply->len); 141 142 switch (status.response_code) { 142 143 case AP_RESPONSE_NORMAL: 143 - aq->queue_count--; 144 + aq->queue_count = max_t(int, 0, aq->queue_count - 1); 144 145 if (aq->queue_count > 0) 145 146 mod_timer(&aq->timeout, 146 147 jiffies + aq->request_timeout); ··· 151 150 list_del_init(&ap_msg->list); 152 151 aq->pendingq_count--; 153 152 ap_msg->receive(aq, ap_msg, aq->reply); 153 + found = true; 154 154 break; 155 + } 156 + if (!found) { 157 + AP_DBF_WARN("%s unassociated reply psmid=0x%016llx on 0x%02x.%04x\n", 158 + __func__, aq->reply->psmid, 159 + AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); 155 160 } 156 161 fallthrough; 157 162 case AP_RESPONSE_NO_PENDING_REPLY: ··· 239 232 ap_msg->flags & AP_MSG_FLAG_SPECIAL); 240 233 switch (status.response_code) { 241 234 case AP_RESPONSE_NORMAL: 242 - aq->queue_count++; 235 + aq->queue_count = max_t(int, 1, aq->queue_count + 1); 243 236 if (aq->queue_count == 1) 244 237 mod_timer(&aq->timeout, jiffies + aq->request_timeout); 245 238 list_move_tail(&ap_msg->list, &aq->pendingq);