Skip to content

Commit 43e317c

Browse files
committed
Merge tag 's390-5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Heiko Carstens: - Add ABI to kernel image file which allows e.g. the file utility to figure out the kernel version. - Wire up clone3 system call. - Add support for kasan bitops instrumentation. - uapi header cleanup: use __u{16,32,64} instead of uint{16,32,64}_t. - Provide proper ARCH_ZONE_DMA_BITS so the s390 DMA zone is correctly defined with 2 GB instead of the default value of 1 MB. - Farhan Ali leaves the group of vfio-ccw maintainers. - Various small vfio-ccw fixes. - Add missing locking for airq_areas array in virtio code. - Minor qdio improvements. * tag 's390-5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: MAINTAINERS: vfio-ccw: Remove myself as the maintainer s390/mm: use shared variables for sysctl range check virtio/s390: fix race on airq_areas[] s390/dma: provide proper ARCH_ZONE_DMA_BITS value s390/kasan: add bitops instrumentation s390/bitops: make test functions return bool s390: wire up clone3 system call kbuild: enable arch/s390/include/uapi/asm/zcrypt.h for uapi header test s390: use __u{16,32,64} instead of uint{16,32,64}_t in uapi header s390/hypfs: fix a typo in the name of a function s390/qdio: restrict QAOB usage to IQD unicast queues s390/qdio: add sanity checks to the fast-requeue path s390: enable detection of kernel version from bzImage Documentation: fix vfio-ccw doc vfio-ccw: Update documentation for csch/hsch vfio-ccw: Don't call cp_free if we are processing a channel program vfio-ccw: Set pa_nr to 0 if memory allocation fails for pa_iova_pfn vfio-ccw: Fix memory leak and don't call cp_free in cp_init vfio-ccw: Fix misleading comment when setting orb.cmd.c64
2 parents 5efbd93 + 98abe02 commit 43e317c

File tree

19 files changed

+140
-92
lines changed

19 files changed

+140
-92
lines changed

Documentation/s390/vfio-ccw.rst

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ The process of how these work together.
180180
add it to an iommu_group and a vfio_group. Then we could pass through
181181
the mdev to a guest.
182182

183+
184+
VFIO-CCW Regions
185+
----------------
186+
187+
The vfio-ccw driver exposes MMIO regions to accept requests from and return
188+
results to userspace.
189+
183190
vfio-ccw I/O region
184191
-------------------
185192

@@ -205,6 +212,25 @@ irb_area stores the I/O result.
205212

206213
ret_code stores a return code for each access of the region.
207214

215+
This region is always available.
216+
217+
vfio-ccw cmd region
218+
-------------------
219+
220+
The vfio-ccw cmd region is used to accept asynchronous instructions
221+
from userspace::
222+
223+
#define VFIO_CCW_ASYNC_CMD_HSCH (1 << 0)
224+
#define VFIO_CCW_ASYNC_CMD_CSCH (1 << 1)
225+
struct ccw_cmd_region {
226+
__u32 command;
227+
__u32 ret_code;
228+
} __packed;
229+
230+
This region is exposed via region type VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD.
231+
232+
Currently, CLEAR SUBCHANNEL and HALT SUBCHANNEL use this region.
233+
208234
vfio-ccw operation details
209235
--------------------------
210236

@@ -306,9 +332,8 @@ Together with the corresponding work in QEMU, we can bring the passed
306332
through DASD/ECKD device online in a guest now and use it as a block
307333
device.
308334

309-
While the current code allows the guest to start channel programs via
310-
START SUBCHANNEL, support for HALT SUBCHANNEL or CLEAR SUBCHANNEL is
311-
not yet implemented.
335+
The current code allows the guest to start channel programs via
336+
START SUBCHANNEL, and to issue HALT SUBCHANNEL and CLEAR SUBCHANNEL.
312337

313338
vfio-ccw supports classic (command mode) channel I/O only. Transport
314339
mode (HPF) is not supported.

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13948,7 +13948,6 @@ F: drivers/pci/hotplug/s390_pci_hpc.c
1394813948

1394913949
S390 VFIO-CCW DRIVER
1395013950
M: Cornelia Huck <[email protected]>
13951-
M: Farhan Ali <[email protected]>
1395213951
M: Eric Farman <[email protected]>
1395313952
R: Halil Pasic <[email protected]>
1395413953

arch/s390/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
3636

3737
obj-y := head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o
3838
obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
39-
obj-y += ctype.o text_dma.o
39+
obj-y += version.o ctype.o text_dma.o
4040
obj-$(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) += uv.o
4141
obj-$(CONFIG_RELOCATABLE) += machine_kexec_reloc.o
4242
obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o

arch/s390/boot/boot.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ void print_missing_facilities(void);
1212
unsigned long get_random_base(unsigned long safe_addr);
1313

1414
extern int kaslr_enabled;
15+
extern const char kernel_version[];
1516

1617
unsigned long read_ipl_report(unsigned long safe_offset);
1718

arch/s390/boot/head.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ ENTRY(startup_kdump)
361361
.quad 0 # INITRD_SIZE
362362
.quad 0 # OLDMEM_BASE
363363
.quad 0 # OLDMEM_SIZE
364+
.quad kernel_version # points to kernel version string
364365

365366
.org COMMAND_LINE
366367
.byte "root=/dev/ram0 ro"

arch/s390/boot/version.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <generated/utsrelease.h>
3+
#include <generated/compile.h>
4+
#include "boot.h"
5+
6+
const char kernel_version[] = UTS_RELEASE
7+
" (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") " UTS_VERSION;

arch/s390/hypfs/hypfs_vm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ do { \
118118
return PTR_ERR(rc); \
119119
} while(0)
120120

121-
static int hpyfs_vm_create_guest(struct dentry *systems_dir,
121+
static int hypfs_vm_create_guest(struct dentry *systems_dir,
122122
struct diag2fc_data *data)
123123
{
124124
char guest_name[NAME_LEN + 1] = {};
@@ -219,7 +219,7 @@ int hypfs_vm_create_files(struct dentry *root)
219219
}
220220

221221
for (i = 0; i < count; i++) {
222-
rc = hpyfs_vm_create_guest(dir, &(data[i]));
222+
rc = hypfs_vm_create_guest(dir, &(data[i]));
223223
if (rc)
224224
goto failed;
225225
}

arch/s390/include/asm/bitops.h

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#include <linux/typecheck.h>
3737
#include <linux/compiler.h>
38+
#include <linux/types.h>
3839
#include <asm/atomic_ops.h>
3940
#include <asm/barrier.h>
4041

@@ -55,7 +56,7 @@ __bitops_byte(unsigned long nr, volatile unsigned long *ptr)
5556
return ((unsigned char *)ptr) + ((nr ^ (BITS_PER_LONG - 8)) >> 3);
5657
}
5758

58-
static inline void set_bit(unsigned long nr, volatile unsigned long *ptr)
59+
static inline void arch_set_bit(unsigned long nr, volatile unsigned long *ptr)
5960
{
6061
unsigned long *addr = __bitops_word(nr, ptr);
6162
unsigned long mask;
@@ -76,7 +77,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *ptr)
7677
__atomic64_or(mask, (long *)addr);
7778
}
7879

79-
static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr)
80+
static inline void arch_clear_bit(unsigned long nr, volatile unsigned long *ptr)
8081
{
8182
unsigned long *addr = __bitops_word(nr, ptr);
8283
unsigned long mask;
@@ -97,7 +98,8 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr)
9798
__atomic64_and(mask, (long *)addr);
9899
}
99100

100-
static inline void change_bit(unsigned long nr, volatile unsigned long *ptr)
101+
static inline void arch_change_bit(unsigned long nr,
102+
volatile unsigned long *ptr)
101103
{
102104
unsigned long *addr = __bitops_word(nr, ptr);
103105
unsigned long mask;
@@ -118,8 +120,8 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *ptr)
118120
__atomic64_xor(mask, (long *)addr);
119121
}
120122

121-
static inline int
122-
test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
123+
static inline bool arch_test_and_set_bit(unsigned long nr,
124+
volatile unsigned long *ptr)
123125
{
124126
unsigned long *addr = __bitops_word(nr, ptr);
125127
unsigned long old, mask;
@@ -129,8 +131,8 @@ test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
129131
return (old & mask) != 0;
130132
}
131133

132-
static inline int
133-
test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
134+
static inline bool arch_test_and_clear_bit(unsigned long nr,
135+
volatile unsigned long *ptr)
134136
{
135137
unsigned long *addr = __bitops_word(nr, ptr);
136138
unsigned long old, mask;
@@ -140,8 +142,8 @@ test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
140142
return (old & ~mask) != 0;
141143
}
142144

143-
static inline int
144-
test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
145+
static inline bool arch_test_and_change_bit(unsigned long nr,
146+
volatile unsigned long *ptr)
145147
{
146148
unsigned long *addr = __bitops_word(nr, ptr);
147149
unsigned long old, mask;
@@ -151,30 +153,31 @@ test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
151153
return (old & mask) != 0;
152154
}
153155

154-
static inline void __set_bit(unsigned long nr, volatile unsigned long *ptr)
156+
static inline void arch___set_bit(unsigned long nr, volatile unsigned long *ptr)
155157
{
156158
unsigned char *addr = __bitops_byte(nr, ptr);
157159

158160
*addr |= 1 << (nr & 7);
159161
}
160162

161-
static inline void
162-
__clear_bit(unsigned long nr, volatile unsigned long *ptr)
163+
static inline void arch___clear_bit(unsigned long nr,
164+
volatile unsigned long *ptr)
163165
{
164166
unsigned char *addr = __bitops_byte(nr, ptr);
165167

166168
*addr &= ~(1 << (nr & 7));
167169
}
168170

169-
static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr)
171+
static inline void arch___change_bit(unsigned long nr,
172+
volatile unsigned long *ptr)
170173
{
171174
unsigned char *addr = __bitops_byte(nr, ptr);
172175

173176
*addr ^= 1 << (nr & 7);
174177
}
175178

176-
static inline int
177-
__test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
179+
static inline bool arch___test_and_set_bit(unsigned long nr,
180+
volatile unsigned long *ptr)
178181
{
179182
unsigned char *addr = __bitops_byte(nr, ptr);
180183
unsigned char ch;
@@ -184,8 +187,8 @@ __test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
184187
return (ch >> (nr & 7)) & 1;
185188
}
186189

187-
static inline int
188-
__test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
190+
static inline bool arch___test_and_clear_bit(unsigned long nr,
191+
volatile unsigned long *ptr)
189192
{
190193
unsigned char *addr = __bitops_byte(nr, ptr);
191194
unsigned char ch;
@@ -195,8 +198,8 @@ __test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
195198
return (ch >> (nr & 7)) & 1;
196199
}
197200

198-
static inline int
199-
__test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
201+
static inline bool arch___test_and_change_bit(unsigned long nr,
202+
volatile unsigned long *ptr)
200203
{
201204
unsigned char *addr = __bitops_byte(nr, ptr);
202205
unsigned char ch;
@@ -206,7 +209,8 @@ __test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
206209
return (ch >> (nr & 7)) & 1;
207210
}
208211

209-
static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr)
212+
static inline bool arch_test_bit(unsigned long nr,
213+
const volatile unsigned long *ptr)
210214
{
211215
const volatile unsigned char *addr;
212216

@@ -215,28 +219,30 @@ static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr)
215219
return (*addr >> (nr & 7)) & 1;
216220
}
217221

218-
static inline int test_and_set_bit_lock(unsigned long nr,
219-
volatile unsigned long *ptr)
222+
static inline bool arch_test_and_set_bit_lock(unsigned long nr,
223+
volatile unsigned long *ptr)
220224
{
221-
if (test_bit(nr, ptr))
225+
if (arch_test_bit(nr, ptr))
222226
return 1;
223-
return test_and_set_bit(nr, ptr);
227+
return arch_test_and_set_bit(nr, ptr);
224228
}
225229

226-
static inline void clear_bit_unlock(unsigned long nr,
227-
volatile unsigned long *ptr)
230+
static inline void arch_clear_bit_unlock(unsigned long nr,
231+
volatile unsigned long *ptr)
228232
{
229233
smp_mb__before_atomic();
230-
clear_bit(nr, ptr);
234+
arch_clear_bit(nr, ptr);
231235
}
232236

233-
static inline void __clear_bit_unlock(unsigned long nr,
234-
volatile unsigned long *ptr)
237+
static inline void arch___clear_bit_unlock(unsigned long nr,
238+
volatile unsigned long *ptr)
235239
{
236240
smp_mb();
237-
__clear_bit(nr, ptr);
241+
arch___clear_bit(nr, ptr);
238242
}
239243

244+
#include <asm-generic/bitops-instrumented.h>
245+
240246
/*
241247
* Functions which use MSB0 bit numbering.
242248
* The bits are numbered:
@@ -261,7 +267,8 @@ static inline void clear_bit_inv(unsigned long nr, volatile unsigned long *ptr)
261267
return clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
262268
}
263269

264-
static inline int test_and_clear_bit_inv(unsigned long nr, volatile unsigned long *ptr)
270+
static inline bool test_and_clear_bit_inv(unsigned long nr,
271+
volatile unsigned long *ptr)
265272
{
266273
return test_and_clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
267274
}
@@ -276,8 +283,8 @@ static inline void __clear_bit_inv(unsigned long nr, volatile unsigned long *ptr
276283
return __clear_bit(nr ^ (BITS_PER_LONG - 1), ptr);
277284
}
278285

279-
static inline int test_bit_inv(unsigned long nr,
280-
const volatile unsigned long *ptr)
286+
static inline bool test_bit_inv(unsigned long nr,
287+
const volatile unsigned long *ptr)
281288
{
282289
return test_bit(nr ^ (BITS_PER_LONG - 1), ptr);
283290
}

arch/s390/include/asm/page.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ static inline int devmem_is_allowed(unsigned long pfn)
177177
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \
178178
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
179179

180+
#define ARCH_ZONE_DMA_BITS 31
181+
180182
#include <asm-generic/memory_model.h>
181183
#include <asm-generic/getorder.h>
182184

arch/s390/include/asm/setup.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#define INITRD_SIZE_OFFSET 0x10410
5555
#define OLDMEM_BASE_OFFSET 0x10418
5656
#define OLDMEM_SIZE_OFFSET 0x10420
57+
#define KERNEL_VERSION_OFFSET 0x10428
5758
#define COMMAND_LINE_OFFSET 0x10480
5859

5960
#ifndef __ASSEMBLY__
@@ -74,7 +75,8 @@ struct parmarea {
7475
unsigned long initrd_size; /* 0x10410 */
7576
unsigned long oldmem_base; /* 0x10418 */
7677
unsigned long oldmem_size; /* 0x10420 */
77-
char pad1[0x10480 - 0x10428]; /* 0x10428 - 0x10480 */
78+
unsigned long kernel_version; /* 0x10428 */
79+
char pad1[0x10480 - 0x10430]; /* 0x10430 - 0x10480 */
7880
char command_line[ARCH_COMMAND_LINE_SIZE]; /* 0x10480 */
7981
};
8082

0 commit comments

Comments
 (0)