Skip to content

Commit 3e71e12

Browse files
committed
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
2 parents bd51613 + c7ff857 commit 3e71e12

File tree

13 files changed

+75
-46
lines changed

13 files changed

+75
-46
lines changed

arch/s390/boot/uv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ void uv_query_info(void)
1515
if (!test_facility(158))
1616
return;
1717

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)
1920
return;
2021

2122
if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&

arch/s390/include/asm/timex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static inline void get_tod_clock_ext(char *clk)
155155

156156
static inline unsigned long long get_tod_clock(void)
157157
{
158-
unsigned char clk[STORE_CLOCK_EXT_SIZE];
158+
char clk[STORE_CLOCK_EXT_SIZE];
159159

160160
get_tod_clock_ext(clk);
161161
return *((unsigned long long *)&clk[1]);

crypto/testmgr.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4436,6 +4436,15 @@ static const struct alg_test_desc alg_test_descs[] = {
44364436
.cipher = __VECS(tf_cbc_tv_template)
44374437
},
44384438
}, {
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
44394448
.alg = "cbcmac(aes)",
44404449
.fips_allowed = 1,
44414450
.test = alg_test_hash,
@@ -4587,6 +4596,15 @@ static const struct alg_test_desc alg_test_descs[] = {
45874596
.cipher = __VECS(tf_ctr_tv_template)
45884597
}
45894598
}, {
4599+
#if IS_ENABLED(CONFIG_CRYPTO_PAES_S390)
4600+
.alg = "ctr-paes-s390",
4601+
.fips_allowed = 1,
4602+
.test = alg_test_skcipher,
4603+
.suite = {
4604+
.cipher = __VECS(aes_ctr_tv_template)
4605+
}
4606+
}, {
4607+
#endif
45904608
.alg = "cts(cbc(aes))",
45914609
.test = alg_test_skcipher,
45924610
.fips_allowed = 1,
@@ -4879,6 +4897,15 @@ static const struct alg_test_desc alg_test_descs[] = {
48794897
.cipher = __VECS(xtea_tv_template)
48804898
}
48814899
}, {
4900+
#if IS_ENABLED(CONFIG_CRYPTO_PAES_S390)
4901+
.alg = "ecb-paes-s390",
4902+
.fips_allowed = 1,
4903+
.test = alg_test_skcipher,
4904+
.suite = {
4905+
.cipher = __VECS(aes_tv_template)
4906+
}
4907+
}, {
4908+
#endif
48824909
.alg = "ecdh",
48834910
.test = alg_test_kpp,
48844911
.fips_allowed = 1,
@@ -5465,6 +5492,15 @@ static const struct alg_test_desc alg_test_descs[] = {
54655492
.cipher = __VECS(tf_xts_tv_template)
54665493
}
54675494
}, {
5495+
#if IS_ENABLED(CONFIG_CRYPTO_PAES_S390)
5496+
.alg = "xts-paes-s390",
5497+
.fips_allowed = 1,
5498+
.test = alg_test_skcipher,
5499+
.suite = {
5500+
.cipher = __VECS(aes_xts_tv_template)
5501+
}
5502+
}, {
5503+
#endif
54685504
.alg = "xts4096(paes)",
54695505
.test = alg_test_null,
54705506
.fips_allowed = 1,

drivers/s390/cio/qdio.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,9 @@ enum qdio_queue_irq_states {
182182
};
183183

184184
struct qdio_input_q {
185-
/* input buffer acknowledgement flag */
186-
int polling;
187185
/* first ACK'ed buffer */
188186
int ack_start;
189-
/* how much sbals are acknowledged with qebsm */
187+
/* how many SBALs are acknowledged */
190188
int ack_count;
191189
/* last time of noticing incoming data */
192190
u64 timestamp;

drivers/s390/cio/qdio_debug.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,8 @@ static int qstat_show(struct seq_file *m, void *v)
124124
seq_printf(m, "nr_used: %d ftc: %d\n",
125125
atomic_read(&q->nr_buf_used), q->first_to_check);
126126
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);
130129
seq_printf(m, "DSCI: %x IRQs disabled: %u\n",
131130
*(u8 *)q->irq_ptr->dsci,
132131
test_bit(QDIO_QUEUE_IRQS_DISABLED,

drivers/s390/cio/qdio_main.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -393,19 +393,15 @@ int debug_get_buf_state(struct qdio_q *q, unsigned int bufnr,
393393

394394
static inline void qdio_stop_polling(struct qdio_q *q)
395395
{
396-
if (!q->u.in.polling)
396+
if (!q->u.in.ack_count)
397397
return;
398398

399-
q->u.in.polling = 0;
400399
qperf_inc(q, stop_polling);
401400

402401
/* 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;
409405
}
410406

411407
static inline void account_sbals(struct qdio_q *q, unsigned int count)
@@ -451,8 +447,7 @@ static inline void inbound_primed(struct qdio_q *q, unsigned int start,
451447

452448
/* for QEBSM the ACK was already set by EQBS */
453449
if (is_qebsm(q)) {
454-
if (!q->u.in.polling) {
455-
q->u.in.polling = 1;
450+
if (!q->u.in.ack_count) {
456451
q->u.in.ack_count = count;
457452
q->u.in.ack_start = start;
458453
return;
@@ -471,12 +466,12 @@ static inline void inbound_primed(struct qdio_q *q, unsigned int start,
471466
* or by the next inbound run.
472467
*/
473468
new = add_buf(start, count - 1);
474-
if (q->u.in.polling) {
469+
if (q->u.in.ack_count) {
475470
/* reset the previous ACK but first set the new one */
476471
set_buf_state(q, new, SLSB_P_INPUT_ACK);
477472
set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT);
478473
} else {
479-
q->u.in.polling = 1;
474+
q->u.in.ack_count = 1;
480475
set_buf_state(q, new, SLSB_P_INPUT_ACK);
481476
}
482477

@@ -1479,13 +1474,12 @@ static int handle_inbound(struct qdio_q *q, unsigned int callflags,
14791474

14801475
qperf_inc(q, inbound_call);
14811476

1482-
if (!q->u.in.polling)
1477+
if (!q->u.in.ack_count)
14831478
goto set;
14841479

14851480
/* protect against stop polling setting an ACK for an emptied slsb */
14861481
if (count == QDIO_MAX_BUFFERS_PER_Q) {
14871482
/* overwriting everything, just delete polling status */
1488-
q->u.in.polling = 0;
14891483
q->u.in.ack_count = 0;
14901484
goto set;
14911485
} else if (buf_in_between(q->u.in.ack_start, bufnr, count)) {
@@ -1495,15 +1489,14 @@ static int handle_inbound(struct qdio_q *q, unsigned int callflags,
14951489
diff = sub_buf(diff, q->u.in.ack_start);
14961490
q->u.in.ack_count -= diff;
14971491
if (q->u.in.ack_count <= 0) {
1498-
q->u.in.polling = 0;
14991492
q->u.in.ack_count = 0;
15001493
goto set;
15011494
}
15021495
q->u.in.ack_start = add_buf(q->u.in.ack_start, diff);
1496+
} else {
1497+
/* the only ACK will be deleted */
1498+
q->u.in.ack_count = 0;
15031499
}
1504-
else
1505-
/* the only ACK will be deleted, so stop polling */
1506-
q->u.in.polling = 0;
15071500
}
15081501

15091502
set:

drivers/s390/cio/qdio_setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,
536536
int qdio_enable_async_operation(struct qdio_output_q *outq)
537537
{
538538
outq->aobs = kcalloc(QDIO_MAX_BUFFERS_PER_Q, sizeof(struct qaob *),
539-
GFP_ATOMIC);
539+
GFP_KERNEL);
540540
if (!outq->aobs) {
541541
outq->use_cq = 0;
542542
return -ENOMEM;

drivers/s390/cio/vfio_ccw_trace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
33
*
44
* Copyright IBM Corp. 2018
55
*

drivers/s390/crypto/ap_bus.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ struct ap_card {
162162
unsigned int functions; /* AP device function bitfield. */
163163
int queue_depth; /* AP queue depth.*/
164164
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.*/
166166
};
167167

168168
#define to_ap_card(x) container_of((x), struct ap_card, ap_dev.device)
@@ -179,7 +179,7 @@ struct ap_queue {
179179
enum ap_state state; /* State of the AP device. */
180180
int pendingq_count; /* # requests on pendingq list. */
181181
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.*/
183183
int request_timeout; /* Request timeout in jiffies. */
184184
struct timer_list timeout; /* Timer for request timeouts. */
185185
struct list_head pendingq; /* List of message sent to AP queue. */

drivers/s390/crypto/ap_card.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ static ssize_t request_count_show(struct device *dev,
6363
char *buf)
6464
{
6565
struct ap_card *ac = to_ap_card(dev);
66-
unsigned int req_cnt;
66+
u64 req_cnt;
6767

6868
req_cnt = 0;
6969
spin_lock_bh(&ap_list_lock);
70-
req_cnt = atomic_read(&ac->total_request_count);
70+
req_cnt = atomic64_read(&ac->total_request_count);
7171
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);
7373
}
7474

7575
static ssize_t request_count_store(struct device *dev,
@@ -83,7 +83,7 @@ static ssize_t request_count_store(struct device *dev,
8383
for_each_ap_queue(aq, ac)
8484
aq->total_request_count = 0;
8585
spin_unlock_bh(&ap_list_lock);
86-
atomic_set(&ac->total_request_count, 0);
86+
atomic64_set(&ac->total_request_count, 0);
8787

8888
return count;
8989
}

0 commit comments

Comments
 (0)