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
Unified · Split
| @@ -651,9 +651,9 @@ ENDPROC(stack_overflow) · 650 unmodified lines | ||
| 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) |
| @@ -135,12 +135,13 @@ static struct ap_queue_status ap_sm_recv(struct ap_queue *aq) · 134 unmodified lines | ||
| 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); |
| @@ -150,8 +151,14 @@ static struct ap_queue_status ap_sm_recv(struct ap_queue *aq) · 3 unmodified lines | ||
| 150 | 151 | list_del_init(&ap_msg->list); |
| 151 | 152 | aq->pendingq_count--; |
| 152 | 153 | ap_msg->receive(aq, ap_msg, aq->reply); |
| 154 | + found = true; | |
| 153 | 155 | break; |
| 154 | 156 | } |
| 157 | + if (!found) { | |
| 158 | + AP_DBF_WARN("%s unassociated reply psmid=0x%016llx on 0x%02x.%04x\n", | |
| 159 | + __func__, aq->reply->psmid, | |
| 160 | + AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); | |
| 161 | + } | |
| 155 | 162 | fallthrough; |
| 156 | 163 | case AP_RESPONSE_NO_PENDING_REPLY: |
| 157 | 164 | if (!status.queue_empty || aq->queue_count <= 0) |
| @@ -232,7 +239,7 @@ static enum ap_sm_wait ap_sm_write(struct ap_queue *aq) · 74 unmodified lines | ||
| 232 | 239 | ap_msg->flags & AP_MSG_FLAG_SPECIAL); |
| 233 | 240 | switch (status.response_code) { |
| 234 | 241 | case AP_RESPONSE_NORMAL: |
| 235 | − aq->queue_count++; | |
| 242 | + aq->queue_count = max_t(int, 1, aq->queue_count + 1); | |
| 236 | 243 | if (aq->queue_count == 1) |
| 237 | 244 | mod_timer(&aq->timeout, jiffies + aq->request_timeout); |
| 238 | 245 | list_move_tail(&ap_msg->list, &aq->pendingq); |