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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 's390-5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 updates from Vasily Gorbik:

- Enable paes-s390 cipher selftests in testmgr (acked-by Herbert Xu).

- Fix protected key length update in PKEY_SEC2PROTK ioctl and increase
card/queue requests counter to 64-bit in crypto code.

- Fix clang warning in get_tod_clock.

- Fix ultravisor info length extensions handling.

- Fix style of SPDX License Identifier in vfio-ccw.

- Avoid unnecessary GFP_ATOMIC and simplify ACK tracking in qdio.

* tag 's390-5.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
crypto/testmgr: enable selftests for paes-s390 ciphers
s390/time: Fix clk type in get_tod_clock
s390/uv: Fix handling of length extensions
s390/qdio: don't allocate *aob array with GFP_ATOMIC
s390/qdio: simplify ACK tracking
s390/zcrypt: fix card and queue total counter wrap
s390/pkey: fix missing length of protected key on return
vfio-ccw: Use the correct style for SPDX License Identifier

+75 -46
+2 -1
arch/s390/boot/uv.c
··· 15 15 if (!test_facility(158)) 16 16 return; 17 17 18 - if (uv_call(0, (uint64_t)&uvcb)) 18 + /* rc==0x100 means that there is additional data we do not process */ 19 + if (uv_call(0, (uint64_t)&uvcb) && uvcb.header.rc != 0x100) 19 20 return; 20 21 21 22 if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&
+1 -1
arch/s390/include/asm/timex.h
··· 155 155 156 156 static inline unsigned long long get_tod_clock(void) 157 157 { 158 - unsigned char clk[STORE_CLOCK_EXT_SIZE]; 158 + char clk[STORE_CLOCK_EXT_SIZE]; 159 159 160 160 get_tod_clock_ext(clk); 161 161 return *((unsigned long long *)&clk[1]);
+36
crypto/testmgr.c
··· 4436 4436 .cipher = __VECS(tf_cbc_tv_template) 4437 4437 }, 4438 4438 }, { 4439 + #if IS_ENABLED(CONFIG_CRYPTO_PAES_S390) 4440 + .alg = "cbc-paes-s390", 4441 + .fips_allowed = 1, 4442 + .test = alg_test_skcipher, 4443 + .suite = { 4444 + .cipher = __VECS(aes_cbc_tv_template) 4445 + } 4446 + }, { 4447 + #endif 4439 4448 .alg = "cbcmac(aes)", 4440 4449 .fips_allowed = 1, 4441 4450 .test = alg_test_hash, ··· 4596 4587 .cipher = __VECS(tf_ctr_tv_template) 4597 4588 } 4598 4589 }, { 4590 + #if IS_ENABLED(CONFIG_CRYPTO_PAES_S390) 4591 + .alg = "ctr-paes-s390", 4592 + .fips_allowed = 1, 4593 + .test = alg_test_skcipher, 4594 + .suite = { 4595 + .cipher = __VECS(aes_ctr_tv_template) 4596 + } 4597 + }, { 4598 + #endif 4599 4599 .alg = "cts(cbc(aes))", 4600 4600 .test = alg_test_skcipher, 4601 4601 .fips_allowed = 1, ··· 4897 4879 .cipher = __VECS(xtea_tv_template) 4898 4880 } 4899 4881 }, { 4882 + #if IS_ENABLED(CONFIG_CRYPTO_PAES_S390) 4883 + .alg = "ecb-paes-s390", 4884 + .fips_allowed = 1, 4885 + .test = alg_test_skcipher, 4886 + .suite = { 4887 + .cipher = __VECS(aes_tv_template) 4888 + } 4889 + }, { 4890 + #endif 4900 4891 .alg = "ecdh", 4901 4892 .test = alg_test_kpp, 4902 4893 .fips_allowed = 1, ··· 5492 5465 .cipher = __VECS(tf_xts_tv_template) 5493 5466 } 5494 5467 }, { 5468 + #if IS_ENABLED(CONFIG_CRYPTO_PAES_S390) 5469 + .alg = "xts-paes-s390", 5470 + .fips_allowed = 1, 5471 + .test = alg_test_skcipher, 5472 + .suite = { 5473 + .cipher = __VECS(aes_xts_tv_template) 5474 + } 5475 + }, { 5476 + #endif 5495 5477 .alg = "xts4096(paes)", 5496 5478 .test = alg_test_null, 5497 5479 .fips_allowed = 1,
+1 -3
drivers/s390/cio/qdio.h
··· 182 182 }; 183 183 184 184 struct qdio_input_q { 185 - /* input buffer acknowledgement flag */ 186 - int polling; 187 185 /* first ACK'ed buffer */ 188 186 int ack_start; 189 - /* how much sbals are acknowledged with qebsm */ 187 + /* how many SBALs are acknowledged */ 190 188 int ack_count; 191 189 /* last time of noticing incoming data */ 192 190 u64 timestamp;
+2 -3
drivers/s390/cio/qdio_debug.c
··· 124 124 seq_printf(m, "nr_used: %d ftc: %d\n", 125 125 atomic_read(&q->nr_buf_used), q->first_to_check); 126 126 if (q->is_input_q) { 127 - seq_printf(m, "polling: %d ack start: %d ack count: %d\n", 128 - q->u.in.polling, q->u.in.ack_start, 129 - q->u.in.ack_count); 127 + seq_printf(m, "ack start: %d ack count: %d\n", 128 + q->u.in.ack_start, q->u.in.ack_count); 130 129 seq_printf(m, "DSCI: %x IRQs disabled: %u\n", 131 130 *(u8 *)q->irq_ptr->dsci, 132 131 test_bit(QDIO_QUEUE_IRQS_DISABLED,
+11 -18
drivers/s390/cio/qdio_main.c
··· 393 393 394 394 static inline void qdio_stop_polling(struct qdio_q *q) 395 395 { 396 - if (!q->u.in.polling) 396 + if (!q->u.in.ack_count) 397 397 return; 398 398 399 - q->u.in.polling = 0; 400 399 qperf_inc(q, stop_polling); 401 400 402 401 /* show the card that we are not polling anymore */ 403 - if (is_qebsm(q)) { 404 - set_buf_states(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT, 405 - q->u.in.ack_count); 406 - q->u.in.ack_count = 0; 407 - } else 408 - set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT); 402 + set_buf_states(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT, 403 + q->u.in.ack_count); 404 + q->u.in.ack_count = 0; 409 405 } 410 406 411 407 static inline void account_sbals(struct qdio_q *q, unsigned int count) ··· 447 451 448 452 /* for QEBSM the ACK was already set by EQBS */ 449 453 if (is_qebsm(q)) { 450 - if (!q->u.in.polling) { 451 - q->u.in.polling = 1; 454 + if (!q->u.in.ack_count) { 452 455 q->u.in.ack_count = count; 453 456 q->u.in.ack_start = start; 454 457 return; ··· 466 471 * or by the next inbound run. 467 472 */ 468 473 new = add_buf(start, count - 1); 469 - if (q->u.in.polling) { 474 + if (q->u.in.ack_count) { 470 475 /* reset the previous ACK but first set the new one */ 471 476 set_buf_state(q, new, SLSB_P_INPUT_ACK); 472 477 set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT); 473 478 } else { 474 - q->u.in.polling = 1; 479 + q->u.in.ack_count = 1; 475 480 set_buf_state(q, new, SLSB_P_INPUT_ACK); 476 481 } 477 482 ··· 1474 1479 1475 1480 qperf_inc(q, inbound_call); 1476 1481 1477 - if (!q->u.in.polling) 1482 + if (!q->u.in.ack_count) 1478 1483 goto set; 1479 1484 1480 1485 /* protect against stop polling setting an ACK for an emptied slsb */ 1481 1486 if (count == QDIO_MAX_BUFFERS_PER_Q) { 1482 1487 /* overwriting everything, just delete polling status */ 1483 - q->u.in.polling = 0; 1484 1488 q->u.in.ack_count = 0; 1485 1489 goto set; 1486 1490 } else if (buf_in_between(q->u.in.ack_start, bufnr, count)) { ··· 1489 1495 diff = sub_buf(diff, q->u.in.ack_start); 1490 1496 q->u.in.ack_count -= diff; 1491 1497 if (q->u.in.ack_count <= 0) { 1492 - q->u.in.polling = 0; 1493 1498 q->u.in.ack_count = 0; 1494 1499 goto set; 1495 1500 } 1496 1501 q->u.in.ack_start = add_buf(q->u.in.ack_start, diff); 1502 + } else { 1503 + /* the only ACK will be deleted */ 1504 + q->u.in.ack_count = 0; 1497 1505 } 1498 - else 1499 - /* the only ACK will be deleted, so stop polling */ 1500 - q->u.in.polling = 0; 1501 1506 } 1502 1507 1503 1508 set:
+1 -1
drivers/s390/cio/qdio_setup.c
··· 536 536 int qdio_enable_async_operation(struct qdio_output_q *outq) 537 537 { 538 538 outq->aobs = kcalloc(QDIO_MAX_BUFFERS_PER_Q, sizeof(struct qaob *), 539 - GFP_ATOMIC); 539 + GFP_KERNEL); 540 540 if (!outq->aobs) { 541 541 outq->use_cq = 0; 542 542 return -ENOMEM;
+2 -2
drivers/s390/cio/vfio_ccw_trace.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 2 - * Tracepoints for vfio_ccw driver 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* Tracepoints for vfio_ccw driver 3 3 * 4 4 * Copyright IBM Corp. 2018 5 5 *
+2 -2
drivers/s390/crypto/ap_bus.h
··· 162 162 unsigned int functions; /* AP device function bitfield. */ 163 163 int queue_depth; /* AP queue depth.*/ 164 164 int id; /* AP card number. */ 165 - atomic_t total_request_count; /* # requests ever for this AP device.*/ 165 + atomic64_t total_request_count; /* # requests ever for this AP device.*/ 166 166 }; 167 167 168 168 #define to_ap_card(x) container_of((x), struct ap_card, ap_dev.device) ··· 179 179 enum ap_state state; /* State of the AP device. */ 180 180 int pendingq_count; /* # requests on pendingq list. */ 181 181 int requestq_count; /* # requests on requestq list. */ 182 - int total_request_count; /* # requests ever for this AP device.*/ 182 + u64 total_request_count; /* # requests ever for this AP device.*/ 183 183 int request_timeout; /* Request timeout in jiffies. */ 184 184 struct timer_list timeout; /* Timer for request timeouts. */ 185 185 struct list_head pendingq; /* List of message sent to AP queue. */
+4 -4
drivers/s390/crypto/ap_card.c
··· 63 63 char *buf) 64 64 { 65 65 struct ap_card *ac = to_ap_card(dev); 66 - unsigned int req_cnt; 66 + u64 req_cnt; 67 67 68 68 req_cnt = 0; 69 69 spin_lock_bh(&ap_list_lock); 70 - req_cnt = atomic_read(&ac->total_request_count); 70 + req_cnt = atomic64_read(&ac->total_request_count); 71 71 spin_unlock_bh(&ap_list_lock); 72 - return snprintf(buf, PAGE_SIZE, "%d\n", req_cnt); 72 + return snprintf(buf, PAGE_SIZE, "%llu\n", req_cnt); 73 73 } 74 74 75 75 static ssize_t request_count_store(struct device *dev, ··· 83 83 for_each_ap_queue(aq, ac) 84 84 aq->total_request_count = 0; 85 85 spin_unlock_bh(&ap_list_lock); 86 - atomic_set(&ac->total_request_count, 0); 86 + atomic64_set(&ac->total_request_count, 0); 87 87 88 88 return count; 89 89 }
+3 -3
drivers/s390/crypto/ap_queue.c
··· 479 479 char *buf) 480 480 { 481 481 struct ap_queue *aq = to_ap_queue(dev); 482 - unsigned int req_cnt; 482 + u64 req_cnt; 483 483 484 484 spin_lock_bh(&aq->lock); 485 485 req_cnt = aq->total_request_count; 486 486 spin_unlock_bh(&aq->lock); 487 - return snprintf(buf, PAGE_SIZE, "%d\n", req_cnt); 487 + return snprintf(buf, PAGE_SIZE, "%llu\n", req_cnt); 488 488 } 489 489 490 490 static ssize_t request_count_store(struct device *dev, ··· 676 676 list_add_tail(&ap_msg->list, &aq->requestq); 677 677 aq->requestq_count++; 678 678 aq->total_request_count++; 679 - atomic_inc(&aq->card->total_request_count); 679 + atomic64_inc(&aq->card->total_request_count); 680 680 /* Send/receive as many request from the queue as possible. */ 681 681 ap_wait(ap_sm_event_loop(aq, AP_EVENT_POLL)); 682 682 spin_unlock_bh(&aq->lock);
+1 -1
drivers/s390/crypto/pkey_api.c
··· 994 994 return -EFAULT; 995 995 rc = cca_sec2protkey(ksp.cardnr, ksp.domain, 996 996 ksp.seckey.seckey, ksp.protkey.protkey, 997 - NULL, &ksp.protkey.type); 997 + &ksp.protkey.len, &ksp.protkey.type); 998 998 DEBUG_DBG("%s cca_sec2protkey()=%d\n", __func__, rc); 999 999 if (rc) 1000 1000 break;
+9 -7
drivers/s390/crypto/zcrypt_api.c
··· 606 606 weight += atomic_read(&zc->load); 607 607 pref_weight += atomic_read(&pref_zc->load); 608 608 if (weight == pref_weight) 609 - return atomic_read(&zc->card->total_request_count) > 610 - atomic_read(&pref_zc->card->total_request_count); 609 + return atomic64_read(&zc->card->total_request_count) > 610 + atomic64_read(&pref_zc->card->total_request_count); 611 611 return weight > pref_weight; 612 612 } 613 613 ··· 1226 1226 spin_unlock(&zcrypt_list_lock); 1227 1227 } 1228 1228 1229 - static void zcrypt_perdev_reqcnt(int reqcnt[], size_t max_adapters) 1229 + static void zcrypt_perdev_reqcnt(u32 reqcnt[], size_t max_adapters) 1230 1230 { 1231 1231 struct zcrypt_card *zc; 1232 1232 struct zcrypt_queue *zq; 1233 1233 int card; 1234 + u64 cnt; 1234 1235 1235 1236 memset(reqcnt, 0, sizeof(int) * max_adapters); 1236 1237 spin_lock(&zcrypt_list_lock); ··· 1243 1242 || card >= max_adapters) 1244 1243 continue; 1245 1244 spin_lock(&zq->queue->lock); 1246 - reqcnt[card] = zq->queue->total_request_count; 1245 + cnt = zq->queue->total_request_count; 1247 1246 spin_unlock(&zq->queue->lock); 1247 + reqcnt[card] = (cnt < UINT_MAX) ? (u32) cnt : UINT_MAX; 1248 1248 } 1249 1249 } 1250 1250 local_bh_enable(); ··· 1423 1421 return 0; 1424 1422 } 1425 1423 case ZCRYPT_PERDEV_REQCNT: { 1426 - int *reqcnt; 1424 + u32 *reqcnt; 1427 1425 1428 - reqcnt = kcalloc(AP_DEVICES, sizeof(int), GFP_KERNEL); 1426 + reqcnt = kcalloc(AP_DEVICES, sizeof(u32), GFP_KERNEL); 1429 1427 if (!reqcnt) 1430 1428 return -ENOMEM; 1431 1429 zcrypt_perdev_reqcnt(reqcnt, AP_DEVICES); ··· 1482 1480 } 1483 1481 case Z90STAT_PERDEV_REQCNT: { 1484 1482 /* the old ioctl supports only 64 adapters */ 1485 - int reqcnt[MAX_ZDEV_CARDIDS]; 1483 + u32 reqcnt[MAX_ZDEV_CARDIDS]; 1486 1484 1487 1485 zcrypt_perdev_reqcnt(reqcnt, MAX_ZDEV_CARDIDS); 1488 1486 if (copy_to_user((int __user *) arg, reqcnt, sizeof(reqcnt)))