Skip to content

Commit 302d185

Browse files
committed
Merge tag 's390-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull more s390 updates from Alexander Gordeev: - do not enable by default the support of 31-bit Enterprise Systems Architecture (ESA) ELF binaries - drop automatic CONFIG_KEXEC selection, while set CONFIG_KEXEC=y explicitly for defconfig and debug_defconfig only - fix zpci_get_max_io_size() to allow PCI block stores where normal PCI stores were used otherwise - remove unneeded tsk variable in do_exception() fault handler - __load_fpu_regs() is only called from the core kernel code. Therefore, remove not needed EXPORT_SYMBOL. - remove leftover comment from s390_fpregs_set() callback - few cleanups to Processor Activity Instrumentation (PAI) code (which perf framework is based on) - replace Wenjia Zhang with Thorsten Winkler as s390 Inter-User Communication Vehicle (IUCV) networking maintainer - Fix all scenarios where queues previously removed from a guest's Adjunct-Processor (AP) configuration do not re-appear in a reset state when they are subsequently made available to a guest again * tag 's390-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/vfio-ap: do not reset queue removed from host config s390/vfio-ap: reset queues associated with adapter for queue unbound from driver s390/vfio-ap: reset queues filtered from the guest's AP config s390/vfio-ap: let on_scan_complete() callback filter matrix and update guest's APCB s390/vfio-ap: loop over the shadow APCB when filtering guest's AP configuration s390/vfio-ap: always filter entire AP matrix s390/net: add Thorsten Winkler as maintainer s390/pai_ext: split function paiext_push_sample s390/pai_ext: rework function paiext_copy argments s390/pai: rework paiXXX_start and paiXXX_stop functions s390/pai_crypto: split function paicrypt_push_sample s390/pai: rework paixxxx_getctr interface s390/ptrace: remove leftover comment s390/fpu: remove __load_fpu_regs() export s390/mm,fault: remove not needed tsk variable s390/pci: fix max size calculation in zpci_memcpy_toio() s390/kexec: do not automatically select KEXEC option s390/compat: change default for CONFIG_COMPAT to "n"
2 parents b4442ca + b9bd10c commit 302d185

14 files changed

Lines changed: 299 additions & 195 deletions

File tree

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19124,7 +19124,7 @@ F: drivers/iommu/s390-iommu.c
1912419124

1912519125
S390 IUCV NETWORK LAYER
1912619126
M: Alexandra Winter <wintera@linux.ibm.com>
19127-
M: Wenjia Zhang <wenjia@linux.ibm.com>
19127+
M: Thorsten Winkler <twinkler@linux.ibm.com>
1912819128
L: linux-s390@vger.kernel.org
1912919129
L: netdev@vger.kernel.org
1913019130
S: Supported
@@ -19143,7 +19143,7 @@ F: arch/s390/mm
1914319143

1914419144
S390 NETWORK DRIVERS
1914519145
M: Alexandra Winter <wintera@linux.ibm.com>
19146-
M: Wenjia Zhang <wenjia@linux.ibm.com>
19146+
M: Thorsten Winkler <twinkler@linux.ibm.com>
1914719147
L: linux-s390@vger.kernel.org
1914819148
L: netdev@vger.kernel.org
1914919149
S: Supported

arch/s390/Kconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ config S390
216216
select HAVE_VIRT_CPU_ACCOUNTING_IDLE
217217
select IOMMU_HELPER if PCI
218218
select IOMMU_SUPPORT if PCI
219-
select KEXEC
220219
select MMU_GATHER_MERGE_VMAS
221220
select MMU_GATHER_NO_GATHER
222221
select MMU_GATHER_RCU_TABLE_FREE
@@ -443,7 +442,7 @@ config COMMAND_LINE_SIZE
443442
line.
444443

445444
config COMPAT
446-
def_bool y
445+
def_bool n
447446
prompt "Kernel support for 31 bit emulation"
448447
select ARCH_WANT_OLD_COMPAT_IPC
449448
select COMPAT_OLD_SIGACTION
@@ -454,7 +453,9 @@ config COMPAT
454453
Select this option if you want to enable your system kernel to
455454
handle system-calls from ELF binaries for 31 bit ESA. This option
456455
(and some other stuff like libraries and such) is needed for
457-
executing 31 bit applications. It is safe to say "Y".
456+
executing 31 bit applications.
457+
458+
If unsure say N.
458459

459460
config SMP
460461
def_bool y

arch/s390/configs/debug_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ CONFIG_SCHED_AUTOGROUP=y
4040
CONFIG_EXPERT=y
4141
# CONFIG_SYSFS_SYSCALL is not set
4242
CONFIG_PROFILING=y
43+
CONFIG_KEXEC=y
4344
CONFIG_KEXEC_FILE=y
4445
CONFIG_KEXEC_SIG=y
4546
CONFIG_CRASH_DUMP=y

arch/s390/configs/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ CONFIG_SCHED_AUTOGROUP=y
3838
CONFIG_EXPERT=y
3939
# CONFIG_SYSFS_SYSCALL is not set
4040
CONFIG_PROFILING=y
41+
CONFIG_KEXEC=y
4142
CONFIG_KEXEC_FILE=y
4243
CONFIG_KEXEC_SIG=y
4344
CONFIG_CRASH_DUMP=y

arch/s390/configs/zfcpdump_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ CONFIG_BLK_DEV_INITRD=y
1010
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
1111
CONFIG_CRASH_DUMP=y
1212
CONFIG_MARCH_Z13=y
13-
# CONFIG_COMPAT is not set
1413
CONFIG_NR_CPUS=2
1514
CONFIG_HZ_100=y
1615
# CONFIG_CHSC_SCH is not set

arch/s390/include/asm/pci_io.h

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
/* I/O size constraints */
1212
#define ZPCI_MAX_READ_SIZE 8
1313
#define ZPCI_MAX_WRITE_SIZE 128
14+
#define ZPCI_BOUNDARY_SIZE (1 << 12)
15+
#define ZPCI_BOUNDARY_MASK (ZPCI_BOUNDARY_SIZE - 1)
1416

1517
/* I/O Map */
1618
#define ZPCI_IOMAP_SHIFT 48
@@ -125,16 +127,18 @@ static inline int zpci_read_single(void *dst, const volatile void __iomem *src,
125127
int zpci_write_block(volatile void __iomem *dst, const void *src,
126128
unsigned long len);
127129

128-
static inline u8 zpci_get_max_write_size(u64 src, u64 dst, int len, int max)
130+
static inline int zpci_get_max_io_size(u64 src, u64 dst, int len, int max)
129131
{
130-
int count = len > max ? max : len, size = 1;
132+
int offset = dst & ZPCI_BOUNDARY_MASK;
133+
int size;
131134

132-
while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
133-
dst = dst >> 1;
134-
src = src >> 1;
135-
size = size << 1;
136-
}
137-
return size;
135+
size = min3(len, ZPCI_BOUNDARY_SIZE - offset, max);
136+
if (IS_ALIGNED(src, 8) && IS_ALIGNED(dst, 8) && IS_ALIGNED(size, 8))
137+
return size;
138+
139+
if (size >= 8)
140+
return 8;
141+
return rounddown_pow_of_two(size);
138142
}
139143

140144
static inline int zpci_memcpy_fromio(void *dst,
@@ -144,9 +148,9 @@ static inline int zpci_memcpy_fromio(void *dst,
144148
int size, rc = 0;
145149

146150
while (n > 0) {
147-
size = zpci_get_max_write_size((u64 __force) src,
148-
(u64) dst, n,
149-
ZPCI_MAX_READ_SIZE);
151+
size = zpci_get_max_io_size((u64 __force) src,
152+
(u64) dst, n,
153+
ZPCI_MAX_READ_SIZE);
150154
rc = zpci_read_single(dst, src, size);
151155
if (rc)
152156
break;
@@ -166,9 +170,9 @@ static inline int zpci_memcpy_toio(volatile void __iomem *dst,
166170
return -EINVAL;
167171

168172
while (n > 0) {
169-
size = zpci_get_max_write_size((u64 __force) dst,
170-
(u64) src, n,
171-
ZPCI_MAX_WRITE_SIZE);
173+
size = zpci_get_max_io_size((u64 __force) dst,
174+
(u64) src, n,
175+
ZPCI_MAX_WRITE_SIZE);
172176
if (size > 8) /* main path */
173177
rc = zpci_write_block(dst, src, size);
174178
else

arch/s390/kernel/fpu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ void __load_fpu_regs(void)
208208
}
209209
clear_cpu_flag(CIF_FPU);
210210
}
211-
EXPORT_SYMBOL(__load_fpu_regs);
212211

213212
void load_fpu_regs(void)
214213
{

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ static void paicrypt_event_destroy(struct perf_event *event)
111111
mutex_unlock(&pai_reserve_mutex);
112112
}
113113

114-
static u64 paicrypt_getctr(struct paicrypt_map *cpump, int nr, bool kernel)
114+
static u64 paicrypt_getctr(unsigned long *page, int nr, bool kernel)
115115
{
116116
if (kernel)
117117
nr += PAI_CRYPTO_MAXCTR;
118-
return cpump->page[nr];
118+
return page[nr];
119119
}
120120

121121
/* Read the counter values. Return value from location in CMP. For event
@@ -129,13 +129,13 @@ static u64 paicrypt_getdata(struct perf_event *event, bool kernel)
129129
int i;
130130

131131
if (event->attr.config != PAI_CRYPTO_BASE) {
132-
return paicrypt_getctr(cpump,
132+
return paicrypt_getctr(cpump->page,
133133
event->attr.config - PAI_CRYPTO_BASE,
134134
kernel);
135135
}
136136

137137
for (i = 1; i <= paicrypt_cnt; i++) {
138-
u64 val = paicrypt_getctr(cpump, i, kernel);
138+
u64 val = paicrypt_getctr(cpump->page, i, kernel);
139139

140140
if (!val)
141141
continue;
@@ -317,10 +317,14 @@ static void paicrypt_start(struct perf_event *event, int flags)
317317
* Events are added, deleted and re-added when 2 or more events
318318
* are active at the same time.
319319
*/
320-
if (!event->hw.last_tag) {
321-
event->hw.last_tag = 1;
322-
sum = paicrypt_getall(event); /* Get current value */
323-
local64_set(&event->hw.prev_count, sum);
320+
if (!event->attr.sample_period) { /* Counting */
321+
if (!event->hw.last_tag) {
322+
event->hw.last_tag = 1;
323+
sum = paicrypt_getall(event); /* Get current value */
324+
local64_set(&event->hw.prev_count, sum);
325+
}
326+
} else { /* Sampling */
327+
perf_sched_cb_inc(event->pmu);
324328
}
325329
}
326330

@@ -336,19 +340,18 @@ static int paicrypt_add(struct perf_event *event, int flags)
336340
local_ctl_set_bit(0, CR0_CRYPTOGRAPHY_COUNTER_BIT);
337341
}
338342
cpump->event = event;
339-
if (flags & PERF_EF_START && !event->attr.sample_period) {
340-
/* Only counting needs initial counter value */
343+
if (flags & PERF_EF_START)
341344
paicrypt_start(event, PERF_EF_RELOAD);
342-
}
343345
event->hw.state = 0;
344-
if (event->attr.sample_period)
345-
perf_sched_cb_inc(event->pmu);
346346
return 0;
347347
}
348348

349349
static void paicrypt_stop(struct perf_event *event, int flags)
350350
{
351-
paicrypt_read(event);
351+
if (!event->attr.sample_period) /* Counting */
352+
paicrypt_read(event);
353+
else /* Sampling */
354+
perf_sched_cb_dec(event->pmu);
352355
event->hw.state = PERF_HES_STOPPED;
353356
}
354357

@@ -357,11 +360,7 @@ static void paicrypt_del(struct perf_event *event, int flags)
357360
struct paicrypt_mapptr *mp = this_cpu_ptr(paicrypt_root.mapptr);
358361
struct paicrypt_map *cpump = mp->mapptr;
359362

360-
if (event->attr.sample_period)
361-
perf_sched_cb_dec(event->pmu);
362-
if (!event->attr.sample_period)
363-
/* Only counting needs to read counter */
364-
paicrypt_stop(event, PERF_EF_UPDATE);
363+
paicrypt_stop(event, PERF_EF_UPDATE);
365364
if (--cpump->active_events == 0) {
366365
local_ctl_clear_bit(0, CR0_CRYPTOGRAPHY_COUNTER_BIT);
367366
WRITE_ONCE(S390_lowcore.ccd, 0);
@@ -373,8 +372,7 @@ static void paicrypt_del(struct perf_event *event, int flags)
373372
* 2 bytes: Number of counter
374373
* 8 bytes: Value of counter
375374
*/
376-
static size_t paicrypt_copy(struct pai_userdata *userdata,
377-
struct paicrypt_map *cpump,
375+
static size_t paicrypt_copy(struct pai_userdata *userdata, unsigned long *page,
378376
bool exclude_user, bool exclude_kernel)
379377
{
380378
int i, outidx = 0;
@@ -383,9 +381,9 @@ static size_t paicrypt_copy(struct pai_userdata *userdata,
383381
u64 val = 0;
384382

385383
if (!exclude_kernel)
386-
val += paicrypt_getctr(cpump, i, true);
384+
val += paicrypt_getctr(page, i, true);
387385
if (!exclude_user)
388-
val += paicrypt_getctr(cpump, i, false);
386+
val += paicrypt_getctr(page, i, false);
389387
if (val) {
390388
userdata[outidx].num = i;
391389
userdata[outidx].value = val;
@@ -395,25 +393,14 @@ static size_t paicrypt_copy(struct pai_userdata *userdata,
395393
return outidx * sizeof(struct pai_userdata);
396394
}
397395

398-
static int paicrypt_push_sample(void)
396+
static int paicrypt_push_sample(size_t rawsize, struct paicrypt_map *cpump,
397+
struct perf_event *event)
399398
{
400-
struct paicrypt_mapptr *mp = this_cpu_ptr(paicrypt_root.mapptr);
401-
struct paicrypt_map *cpump = mp->mapptr;
402-
struct perf_event *event = cpump->event;
403399
struct perf_sample_data data;
404400
struct perf_raw_record raw;
405401
struct pt_regs regs;
406-
size_t rawsize;
407402
int overflow;
408403

409-
if (!cpump->event) /* No event active */
410-
return 0;
411-
rawsize = paicrypt_copy(cpump->save, cpump,
412-
cpump->event->attr.exclude_user,
413-
cpump->event->attr.exclude_kernel);
414-
if (!rawsize) /* No incremented counters */
415-
return 0;
416-
417404
/* Setup perf sample */
418405
memset(&regs, 0, sizeof(regs));
419406
memset(&raw, 0, sizeof(raw));
@@ -444,6 +431,25 @@ static int paicrypt_push_sample(void)
444431
return overflow;
445432
}
446433

434+
/* Check if there is data to be saved on schedule out of a task. */
435+
static int paicrypt_have_sample(void)
436+
{
437+
struct paicrypt_mapptr *mp = this_cpu_ptr(paicrypt_root.mapptr);
438+
struct paicrypt_map *cpump = mp->mapptr;
439+
struct perf_event *event = cpump->event;
440+
size_t rawsize;
441+
int rc = 0;
442+
443+
if (!event) /* No event active */
444+
return 0;
445+
rawsize = paicrypt_copy(cpump->save, cpump->page,
446+
cpump->event->attr.exclude_user,
447+
cpump->event->attr.exclude_kernel);
448+
if (rawsize) /* No incremented counters */
449+
rc = paicrypt_push_sample(rawsize, cpump, event);
450+
return rc;
451+
}
452+
447453
/* Called on schedule-in and schedule-out. No access to event structure,
448454
* but for sampling only event CRYPTO_ALL is allowed.
449455
*/
@@ -453,7 +459,7 @@ static void paicrypt_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sch
453459
* results on schedule_out and if page was dirty, clear values.
454460
*/
455461
if (!sched_in)
456-
paicrypt_push_sample();
462+
paicrypt_have_sample();
457463
}
458464

459465
/* Attribute definitions for paicrypt interface. As with other CPU

0 commit comments

Comments
 (0)